mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 02:48:48 +00:00
Bug 1029981 - Observers should use MOZ_UTF16 to compare someData. r=nfroyd
This commit is contained in:
parent
4980b5bc66
commit
bb7664bd5c
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user