diff --git a/image/decoders/icon/win/nsIconChannel.cpp b/image/decoders/icon/win/nsIconChannel.cpp index a2ae36df1036..e29a6d7afbaa 100644 --- a/image/decoders/icon/win/nsIconChannel.cpp +++ b/image/decoders/icon/win/nsIconChannel.cpp @@ -58,11 +58,7 @@ struct ICONENTRY { // Match stock icons with names static SHSTOCKICONID GetStockIconIDForName(const nsACString &aStockName) { - // UAC shield icon - if (aStockName == NS_LITERAL_CSTRING("uac-shield")) - return SIID_SHIELD; - - return SIID_INVALID; + return aStockName.EqualsLiteral("uac-shield") ? SIID_SHIELD : SIID_INVALID; } // nsIconChannel methods diff --git a/layout/printing/nsPrintPreviewListener.cpp b/layout/printing/nsPrintPreviewListener.cpp index 121995d58ae5..a0b7c5467ca5 100644 --- a/layout/printing/nsPrintPreviewListener.cpp +++ b/layout/printing/nsPrintPreviewListener.cpp @@ -170,7 +170,7 @@ nsPrintPreviewListener::HandleEvent(nsIDOMEvent* aEvent) { nsAutoString eventString; aEvent->GetType(eventString); - if (eventString == NS_LITERAL_STRING("keydown")) { + if (eventString.EqualsLiteral("keydown")) { // Handle tabbing explicitly here since we don't want focus ending up // inside the content document, bug 244128. nsIDocument* doc = content->GetCurrentDoc(); diff --git a/netwerk/protocol/about/nsAboutCacheEntry.cpp b/netwerk/protocol/about/nsAboutCacheEntry.cpp index 4528aa899fd9..cf1b88e23426 100644 --- a/netwerk/protocol/about/nsAboutCacheEntry.cpp +++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp @@ -160,7 +160,7 @@ nsAboutCacheEntry::OpenCacheEntry(nsIURI *uri) if (!CacheObserver::UseNewCache() && mLoadInfo->IsPrivate() && - mStorageName == NS_LITERAL_CSTRING("disk")) { + mStorageName.EqualsLiteral("disk")) { // The cache v1 is storing all private entries in the memory-only // cache, so it would not be found in the v1 disk cache. mStorageName = NS_LITERAL_CSTRING("memory"); @@ -277,7 +277,7 @@ nsAboutCacheEntry::OnCacheEntryAvailable(nsICacheEntry *entry, rv = WriteCacheEntryDescription(entry); } else if (!CacheObserver::UseNewCache() && !mLoadInfo->IsPrivate() && - mStorageName == NS_LITERAL_CSTRING("memory")) { + mStorageName.EqualsLiteral("memory")) { // If we were not able to find the entry in the memory storage // try again in the disk storage. // This is a workaround for cache v1: when an originally disk diff --git a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp index 961364fd8bdf..95ccc2e0bc7a 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp +++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp @@ -781,7 +781,7 @@ nsWyciwygChannel::ReadFromCache() nsAutoCString tmpStr; rv = mCacheEntry->GetMetaDataElement("inhibit-persistent-caching", getter_Copies(tmpStr)); - if (NS_SUCCEEDED(rv) && tmpStr == NS_LITERAL_CSTRING("1")) + if (NS_SUCCEEDED(rv) && tmpStr.EqualsLiteral("1")) mLoadFlags |= INHIBIT_PERSISTENT_CACHING; // Get a transport to the cached data... diff --git a/netwerk/test/TestCookie.cpp b/netwerk/test/TestCookie.cpp index 6d81a4561f60..22b092eac86d 100644 --- a/netwerk/test/TestCookie.cpp +++ b/netwerk/test/TestCookie.cpp @@ -653,9 +653,9 @@ main(int32_t argc, char *argv[]) if (!cookie2) break; nsAutoCString name; cookie2->GetName(name); - if (name == NS_LITERAL_CSTRING("test2")) + if (name.EqualsLiteral("test2")) expiredCookie = cookie2; - else if (name == NS_LITERAL_CSTRING("test3")) + else if (name.EqualsLiteral("test3")) newDomainCookie = cookie2; } rv[5] = i == 3; diff --git a/parser/htmlparser/src/nsParser.cpp b/parser/htmlparser/src/nsParser.cpp index 159d7a9caff8..2506704d9e08 100644 --- a/parser/htmlparser/src/nsParser.cpp +++ b/parser/htmlparser/src/nsParser.cpp @@ -662,7 +662,7 @@ DetermineHTMLParseMode(const nsString& aBuffer, // Special hack for IBM's custom DOCTYPE. if (!(resultFlags & PARSE_DTD_HAVE_INTERNAL_SUBSET) && - sysIDUCS2 == NS_LITERAL_STRING( + sysIDUCS2.EqualsLiteral( "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd")) { aParseMode = eDTDMode_quirks; aDocType = eHTML_Quirks; diff --git a/widget/xpwidgets/GfxInfoBase.cpp b/widget/xpwidgets/GfxInfoBase.cpp index fe5cd81808b9..1d6d88381e99 100644 --- a/widget/xpwidgets/GfxInfoBase.cpp +++ b/widget/xpwidgets/GfxInfoBase.cpp @@ -206,31 +206,31 @@ BlacklistNodeToTextValue(nsIDOMNode *aBlacklistNode, nsAString& aValue) static OperatingSystem BlacklistOSToOperatingSystem(const nsAString& os) { - if (os == NS_LITERAL_STRING("WINNT 5.1")) + if (os.EqualsLiteral("WINNT 5.1")) return DRIVER_OS_WINDOWS_XP; - else if (os == NS_LITERAL_STRING("WINNT 5.2")) + else if (os.EqualsLiteral("WINNT 5.2")) return DRIVER_OS_WINDOWS_SERVER_2003; - else if (os == NS_LITERAL_STRING("WINNT 6.0")) + else if (os.EqualsLiteral("WINNT 6.0")) return DRIVER_OS_WINDOWS_VISTA; - else if (os == NS_LITERAL_STRING("WINNT 6.1")) + else if (os.EqualsLiteral("WINNT 6.1")) return DRIVER_OS_WINDOWS_7; - else if (os == NS_LITERAL_STRING("WINNT 6.2")) + else if (os.EqualsLiteral("WINNT 6.2")) return DRIVER_OS_WINDOWS_8; - else if (os == NS_LITERAL_STRING("WINNT 6.3")) + else if (os.EqualsLiteral("WINNT 6.3")) return DRIVER_OS_WINDOWS_8_1; - else if (os == NS_LITERAL_STRING("Linux")) + else if (os.EqualsLiteral("Linux")) return DRIVER_OS_LINUX; - else if (os == NS_LITERAL_STRING("Darwin 9")) + else if (os.EqualsLiteral("Darwin 9")) return DRIVER_OS_OS_X_10_5; - else if (os == NS_LITERAL_STRING("Darwin 10")) + else if (os.EqualsLiteral("Darwin 10")) return DRIVER_OS_OS_X_10_6; - else if (os == NS_LITERAL_STRING("Darwin 11")) + else if (os.EqualsLiteral("Darwin 11")) return DRIVER_OS_OS_X_10_7; - else if (os == NS_LITERAL_STRING("Darwin 12")) + else if (os.EqualsLiteral("Darwin 12")) return DRIVER_OS_OS_X_10_8; - else if (os == NS_LITERAL_STRING("Android")) + else if (os.EqualsLiteral("Android")) return DRIVER_OS_ANDROID; - else if (os == NS_LITERAL_STRING("All")) + else if (os.EqualsLiteral("All")) return DRIVER_OS_ALL; return DRIVER_OS_UNKNOWN; @@ -265,25 +265,25 @@ BlacklistDevicesToDeviceFamily(nsIDOMHTMLCollection* aDevices) static int32_t BlacklistFeatureToGfxFeature(const nsAString& aFeature) { - if (aFeature == NS_LITERAL_STRING("DIRECT2D")) + if (aFeature.EqualsLiteral("DIRECT2D")) return nsIGfxInfo::FEATURE_DIRECT2D; - else if (aFeature == NS_LITERAL_STRING("DIRECT3D_9_LAYERS")) + else if (aFeature.EqualsLiteral("DIRECT3D_9_LAYERS")) return nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS; - else if (aFeature == NS_LITERAL_STRING("DIRECT3D_10_LAYERS")) + else if (aFeature.EqualsLiteral("DIRECT3D_10_LAYERS")) return nsIGfxInfo::FEATURE_DIRECT3D_10_LAYERS; - else if (aFeature == NS_LITERAL_STRING("DIRECT3D_10_1_LAYERS")) + else if (aFeature.EqualsLiteral("DIRECT3D_10_1_LAYERS")) return nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS; - else if (aFeature == NS_LITERAL_STRING("DIRECT3D_11_LAYERS")) + else if (aFeature.EqualsLiteral("DIRECT3D_11_LAYERS")) return nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS; - else if (aFeature == NS_LITERAL_STRING("OPENGL_LAYERS")) + else if (aFeature.EqualsLiteral("OPENGL_LAYERS")) return nsIGfxInfo::FEATURE_OPENGL_LAYERS; - else if (aFeature == NS_LITERAL_STRING("WEBGL_OPENGL")) + else if (aFeature.EqualsLiteral("WEBGL_OPENGL")) return nsIGfxInfo::FEATURE_WEBGL_OPENGL; - else if (aFeature == NS_LITERAL_STRING("WEBGL_ANGLE")) + else if (aFeature.EqualsLiteral("WEBGL_ANGLE")) return nsIGfxInfo::FEATURE_WEBGL_ANGLE; - else if (aFeature == NS_LITERAL_STRING("WEBGL_MSAA")) + else if (aFeature.EqualsLiteral("WEBGL_MSAA")) return nsIGfxInfo::FEATURE_WEBGL_MSAA; - else if (aFeature == NS_LITERAL_STRING("STAGEFRIGHT")) + else if (aFeature.EqualsLiteral("STAGEFRIGHT")) return nsIGfxInfo::FEATURE_STAGEFRIGHT; return 0; } @@ -291,15 +291,15 @@ BlacklistFeatureToGfxFeature(const nsAString& aFeature) static int32_t BlacklistFeatureStatusToGfxFeatureStatus(const nsAString& aStatus) { - if (aStatus == NS_LITERAL_STRING("NO_INFO")) + if (aStatus.EqualsLiteral("NO_INFO")) return nsIGfxInfo::FEATURE_NO_INFO; - else if (aStatus == NS_LITERAL_STRING("BLOCKED_DRIVER_VERSION")) + else if (aStatus.EqualsLiteral("BLOCKED_DRIVER_VERSION")) return nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION; - else if (aStatus == NS_LITERAL_STRING("BLOCKED_DEVICE")) + else if (aStatus.EqualsLiteral("BLOCKED_DEVICE")) return nsIGfxInfo::FEATURE_BLOCKED_DEVICE; - else if (aStatus == NS_LITERAL_STRING("DISCOURAGED")) + else if (aStatus.EqualsLiteral("DISCOURAGED")) return nsIGfxInfo::FEATURE_DISCOURAGED; - else if (aStatus == NS_LITERAL_STRING("BLOCKED_OS_VERSION")) + else if (aStatus.EqualsLiteral("BLOCKED_OS_VERSION")) return nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION; // Do not allow it to set STATUS_UNKNOWN. @@ -310,23 +310,23 @@ BlacklistFeatureStatusToGfxFeatureStatus(const nsAString& aStatus) static VersionComparisonOp BlacklistComparatorToComparisonOp(const nsAString& op) { - if (op == NS_LITERAL_STRING("LESS_THAN")) + if (op.EqualsLiteral("LESS_THAN")) return DRIVER_LESS_THAN; - else if (op == NS_LITERAL_STRING("LESS_THAN_OR_EQUAL")) + else if (op.EqualsLiteral("LESS_THAN_OR_EQUAL")) return DRIVER_LESS_THAN_OR_EQUAL; - else if (op == NS_LITERAL_STRING("GREATER_THAN")) + else if (op.EqualsLiteral("GREATER_THAN")) return DRIVER_GREATER_THAN; - else if (op == NS_LITERAL_STRING("GREATER_THAN_OR_EQUAL")) + else if (op.EqualsLiteral("GREATER_THAN_OR_EQUAL")) return DRIVER_GREATER_THAN_OR_EQUAL; - else if (op == NS_LITERAL_STRING("EQUAL")) + else if (op.EqualsLiteral("EQUAL")) return DRIVER_EQUAL; - else if (op == NS_LITERAL_STRING("NOT_EQUAL")) + else if (op.EqualsLiteral("NOT_EQUAL")) return DRIVER_NOT_EQUAL; - else if (op == NS_LITERAL_STRING("BETWEEN_EXCLUSIVE")) + else if (op.EqualsLiteral("BETWEEN_EXCLUSIVE")) return DRIVER_BETWEEN_EXCLUSIVE; - else if (op == NS_LITERAL_STRING("BETWEEN_INCLUSIVE")) + else if (op.EqualsLiteral("BETWEEN_INCLUSIVE")) return DRIVER_BETWEEN_INCLUSIVE; - else if (op == NS_LITERAL_STRING("BETWEEN_INCLUSIVE_START")) + else if (op.EqualsLiteral("BETWEEN_INCLUSIVE_START")) return DRIVER_BETWEEN_INCLUSIVE_START; return DRIVER_COMPARISON_IGNORED; diff --git a/xpcom/base/nsMemoryInfoDumper.cpp b/xpcom/base/nsMemoryInfoDumper.cpp index eaafd3d34b3d..79c8e40220fd 100644 --- a/xpcom/base/nsMemoryInfoDumper.cpp +++ b/xpcom/base/nsMemoryInfoDumper.cpp @@ -186,7 +186,7 @@ namespace { void doMemoryReport(const nsCString& aInputStr) { - bool doMMUMemoryReport = aInputStr == NS_LITERAL_CSTRING("minimize memory report"); + bool doMMUMemoryReport = aInputStr.EqualsLiteral("minimize memory report"); LOG("FifoWatcher(command:%s) dispatching memory report runnable.", aInputStr.get()); nsRefPtr runnable = new DumpMemoryInfoToTempDirRunnable(/* identifier = */ EmptyString(), @@ -197,7 +197,7 @@ doMemoryReport(const nsCString& aInputStr) void doGCCCDump(const nsCString& aInputStr) { - bool doAllTracesGCCCDump = aInputStr == NS_LITERAL_CSTRING("gc log"); + bool doAllTracesGCCCDump = aInputStr.EqualsLiteral("gc log"); LOG("FifoWatcher(command:%s) dispatching GC/CC log runnable.", aInputStr.get()); nsRefPtr runnable = new GCAndCCLogDumpRunnable(/* identifier = */ EmptyString(),