Skip to content

Commit

Permalink
Bug 1029981 - Observers should use MOZ_UTF16 to compare someData. r=n…
Browse files Browse the repository at this point in the history
…froyd
  • Loading branch information
makotokato committed Jun 27, 2014
1 parent 4980b5b commit bb7664b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dom/base/nsGlobalWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dom/devicestorage/nsDeviceStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion image/src/imgLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion rdf/datasource/src/nsLocalStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit bb7664b

Please sign in to comment.