Bug 1029981 - Observers should use MOZ_UTF16 to compare someData. r=nfroyd

This commit is contained in:
Makoto Kato 2014-06-27 17:08:13 +09:00
parent 01eecdb2f6
commit 17426a1b3f
4 changed files with 5 additions and 5 deletions

View File

@ -11402,7 +11402,7 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
#endif // MOZ_B2G
if (!nsCRT::strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
MOZ_ASSERT(!nsCRT::strcmp(NS_ConvertUTF16toUTF8(aData).get(), "intl.accept_languages"));
MOZ_ASSERT(!NS_strcmp(aData, MOZ_UTF16("intl.accept_languages")));
MOZ_ASSERT(IsInnerWindow());
// The user preferred languages have changed, we need to fire an event on

View File

@ -4234,9 +4234,9 @@ nsDOMDeviceStorage::Observe(nsISupports *aSubject,
// these notifications are specific for apps storage.
nsRefPtr<DeviceStorageFile> file =
new DeviceStorageFile(mStorageType, mStorageName);
if (!strcmp(NS_ConvertUTF16toUTF8(aData).get(), "full")) {
if (!NS_strcmp(aData, MOZ_UTF16("full"))) {
Notify("low-disk-space", file);
} else if (!strcmp(NS_ConvertUTF16toUTF8(aData).get(), "free")) {
} else if (!NS_strcmp(aData, MOZ_UTF16("free"))) {
Notify("available-disk-space", file);
}
return NS_OK;

View File

@ -1076,7 +1076,7 @@ imgLoader::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aD
{
// We listen for pref change notifications...
if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
if (!strcmp(NS_ConvertUTF16toUTF8(aData).get(), "image.http.accept")) {
if (!NS_strcmp(aData, MOZ_UTF16("image.http.accept"))) {
ReadAcceptHeaderPref();
}

View File

@ -475,7 +475,7 @@ LocalStoreImpl::Observe(nsISupports *aSubject, const char *aTopic, const char16_
// profile-less.
mInner = do_CreateInstance(NS_RDF_DATASOURCE_CONTRACTID_PREFIX "in-memory-datasource");
if (!nsCRT::strcmp(NS_ConvertUTF16toUTF8(someData).get(), "shutdown-cleanse")) {
if (!NS_strcmp(someData, MOZ_UTF16("shutdown-cleanse"))) {
nsCOMPtr<nsIFile> aFile;
rv = NS_GetSpecialDirectory(NS_APP_LOCALSTORE_50_FILE, getter_AddRefs(aFile));
if (NS_SUCCEEDED(rv))