From 19bebbc68d40338e0402aad67c4ab1bce274b17c Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Thu, 22 May 2014 06:48:50 +0300 Subject: [PATCH] Bug 869836 - Part 2: Use AppendLiteral instead of `Append(NS_LITERAL_STRING(...))`. r=ehsan --- accessible/src/base/TextAttrs.cpp | 2 +- accessible/src/generic/Accessible.cpp | 8 +- content/base/src/WebSocket.cpp | 2 +- content/base/src/nsContentUtils.cpp | 14 ++- content/base/src/nsDOMTokenList.cpp | 3 +- content/base/src/nsPlainTextSerializer.cpp | 2 +- content/base/test/TestPlainTextSerializer.cpp | 4 +- docshell/base/nsDocShell.cpp | 2 +- dom/base/Console.cpp | 2 +- dom/base/URLSearchParams.cpp | 4 +- dom/bluetooth/bluez/BluetoothHfpManager.cpp | 4 +- dom/indexedDB/IDBObjectStore.cpp | 2 +- dom/indexedDB/KeyPath.cpp | 3 +- dom/src/notification/Notification.cpp | 4 +- dom/src/storage/DOMStorageManager.cpp | 17 +-- dom/src/storage/DOMStorageObserver.cpp | 4 +- dom/system/OSFileConstants.cpp | 20 +-- dom/system/gonk/nsVolumeService.cpp | 2 +- dom/xslt/xml/txXMLParser.cpp | 5 +- dom/xslt/xpath/txNodeTypeTest.cpp | 6 +- dom/xslt/xslt/txXSLTPatterns.cpp | 4 +- extensions/gio/nsGIOProtocolHandler.cpp | 2 +- .../gnomevfs/nsGnomeVFSProtocolHandler.cpp | 2 +- gfx/thebes/gfxDWriteFontList.cpp | 4 +- layout/generic/nsFrame.cpp | 7 +- layout/mathml/nsMathMLChar.cpp | 3 +- layout/style/Declaration.cpp | 4 +- layout/style/nsCSSRules.cpp | 10 +- layout/style/nsCSSValue.cpp | 8 +- layout/style/nsComputedDOMStyle.cpp | 38 +++--- layout/style/nsROCSSPrimitiveValue.cpp | 2 +- layout/style/nsStyleUtil.cpp | 2 +- netwerk/cache2/CacheFileUtils.cpp | 6 +- netwerk/cache2/OldWrappers.cpp | 2 +- netwerk/protocol/about/nsAboutCacheEntry.cpp | 2 +- netwerk/protocol/http/Http2Compression.cpp | 12 +- netwerk/protocol/http/Http2Stream.cpp | 8 +- netwerk/protocol/http/HttpBaseChannel.cpp | 3 +- netwerk/protocol/http/SpdyStream3.cpp | 20 +-- netwerk/protocol/http/SpdyStream31.cpp | 20 +-- netwerk/test/TestSocketTransport.cpp | 2 +- netwerk/test/TestStreamTransport.cpp | 4 +- parser/html/nsHtml5TreeOperation.cpp | 2 +- parser/html/nsParserUtils.cpp | 6 +- .../manager/ssl/src/TransportSecurityInfo.cpp | 30 ++--- security/manager/ssl/src/nsNSSCallbacks.cpp | 2 +- security/manager/ssl/src/nsNSSCertHelper.cpp | 116 +++++++++--------- security/manager/ssl/src/nsNSSErrors.cpp | 12 +- storage/src/mozStorageBindingParams.cpp | 2 +- toolkit/components/places/nsNavHistory.cpp | 18 +-- .../components/places/nsNavHistoryQuery.cpp | 8 +- toolkit/components/telemetry/Telemetry.cpp | 2 +- .../exthandler/nsExternalHelperAppService.cpp | 2 +- uriloader/exthandler/win/nsMIMEInfoWin.cpp | 2 +- uriloader/prefetch/nsOfflineCacheUpdate.cpp | 2 +- widget/windows/JumpListItem.cpp | 2 +- xpcom/base/VisualEventTracer.cpp | 10 +- xpcom/base/nsMacUtilsImpl.cpp | 14 +-- xpcom/glue/nsThreadUtils.cpp | 2 +- xpcom/io/nsLocalFileUnix.cpp | 7 +- xpcom/io/nsLocalFileWin.cpp | 3 +- 61 files changed, 265 insertions(+), 252 deletions(-) diff --git a/accessible/src/base/TextAttrs.cpp b/accessible/src/base/TextAttrs.cpp index 526ff1196cb5..84370ae4aae1 100644 --- a/accessible/src/base/TextAttrs.cpp +++ b/accessible/src/base/TextAttrs.cpp @@ -518,7 +518,7 @@ TextAttrsMgr::FontSizeTextAttr:: nsAutoString value; value.AppendInt(pts); - value.Append(NS_LITERAL_STRING("pt")); + value.AppendLiteral("pt"); nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::font_size, value); } diff --git a/accessible/src/generic/Accessible.cpp b/accessible/src/generic/Accessible.cpp index 53d3fdb9eeb9..bdc3e1fe5f4c 100644 --- a/accessible/src/generic/Accessible.cpp +++ b/accessible/src/generic/Accessible.cpp @@ -3323,16 +3323,16 @@ KeyBinding::ToAtkFormat(nsAString& aValue) const { nsAutoString modifierName; if (mModifierMask & kControl) - aValue.Append(NS_LITERAL_STRING("")); + aValue.AppendLiteral(""); if (mModifierMask & kAlt) - aValue.Append(NS_LITERAL_STRING("")); + aValue.AppendLiteral(""); if (mModifierMask & kShift) - aValue.Append(NS_LITERAL_STRING("")); + aValue.AppendLiteral(""); if (mModifierMask & kMeta) - aValue.Append(NS_LITERAL_STRING("")); + aValue.AppendLiteral(""); aValue.Append(mKey); } diff --git a/content/base/src/WebSocket.cpp b/content/base/src/WebSocket.cpp index a71c601f7662..7607e1bb2dc9 100644 --- a/content/base/src/WebSocket.cpp +++ b/content/base/src/WebSocket.cpp @@ -704,7 +704,7 @@ WebSocket::Init(JSContext* aCx, } if (!mRequestedProtocolList.IsEmpty()) { - mRequestedProtocolList.Append(NS_LITERAL_CSTRING(", ")); + mRequestedProtocolList.AppendLiteral(", "); } AppendUTF16toUTF8(aProtocolArray[index], mRequestedProtocolList); diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index ee656e1a6714..33fc64491a59 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -3891,7 +3891,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode, content->GetAttr(kNameSpaceID_XMLNS, name->LocalName(), uriStr); // really want something like nsXMLContentSerializer::SerializeAttr - tagName.Append(NS_LITERAL_STRING(" xmlns")); // space important + tagName.AppendLiteral(" xmlns"); // space important if (name->GetPrefix()) { tagName.Append(char16_t(':')); name->LocalName()->ToString(nameStr); @@ -3899,8 +3899,9 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode, } else { setDefaultNamespace = true; } - tagName.Append(NS_LITERAL_STRING("=\"") + uriStr + - NS_LITERAL_STRING("\"")); + tagName.AppendLiteral("=\""); + tagName.Append(uriStr); + tagName.Append('"'); } } } @@ -3913,8 +3914,9 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode, // default namespace attr in, so that our kids will be in our // namespace. info->GetNamespaceURI(uriStr); - tagName.Append(NS_LITERAL_STRING(" xmlns=\"") + uriStr + - NS_LITERAL_STRING("\"")); + tagName.AppendLiteral(" xmlns=\""); + tagName.Append(uriStr); + tagName.Append('"'); } } @@ -6116,7 +6118,7 @@ nsContentUtils::IsPatternMatching(nsAString& aValue, nsAString& aPattern, // The pattern has to match the entire value. aPattern.Insert(NS_LITERAL_STRING("^(?:"), 0); - aPattern.Append(NS_LITERAL_STRING(")$")); + aPattern.AppendLiteral(")$"); JS::Rooted re(cx, JS_NewUCRegExpObjectNoStatics(cx, diff --git a/content/base/src/nsDOMTokenList.cpp b/content/base/src/nsDOMTokenList.cpp index 80254fe09475..9a2d87bc5956 100644 --- a/content/base/src/nsDOMTokenList.cpp +++ b/content/base/src/nsDOMTokenList.cpp @@ -146,7 +146,8 @@ nsDOMTokenList::AddInternal(const nsAttrValue* aAttr, if (oneWasAdded || (!resultStr.IsEmpty() && !nsContentUtils::IsHTMLWhitespace(resultStr.Last()))) { - resultStr.Append(NS_LITERAL_STRING(" ") + aToken); + resultStr.Append(' '); + resultStr.Append(aToken); } else { resultStr.Append(aToken); } diff --git a/content/base/src/nsPlainTextSerializer.cpp b/content/base/src/nsPlainTextSerializer.cpp index fa8f40751817..98bb5db2681b 100644 --- a/content/base/src/nsPlainTextSerializer.cpp +++ b/content/base/src/nsPlainTextSerializer.cpp @@ -1394,7 +1394,7 @@ nsPlainTextSerializer::EndLine(bool aSoftlinebreak, bool aBreakBySpace) // If breaker character is ASCII space with RFC 3676 support (delsp=yes), // add twice space. if ((mFlags & nsIDocumentEncoder::OutputFormatDelSp) && aBreakBySpace) - mCurrentLine.Append(NS_LITERAL_STRING(" ")); + mCurrentLine.AppendLiteral(" "); else mCurrentLine.Append(char16_t(' ')); } diff --git a/content/base/test/TestPlainTextSerializer.cpp b/content/base/test/TestPlainTextSerializer.cpp index 7151733dfa47..be77795361e3 100644 --- a/content/base/test/TestPlainTextSerializer.cpp +++ b/content/base/test/TestPlainTextSerializer.cpp @@ -77,11 +77,11 @@ TestCJKWithFlowedDelSp() for (uint32_t i = 0; i < 36; i++) { result.Append(0x5341); } - result.Append(NS_LITERAL_STRING(" \r\n")); + result.AppendLiteral(" \r\n"); for (uint32_t i = 0; i < 4; i++) { result.Append(0x5341); } - result.Append(NS_LITERAL_STRING("\r\n")); + result.AppendLiteral("\r\n"); if (!test.Equals(result)) { fail("Wrong HTML to CJK text serialization with format=flowed; delsp=yes"); diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 623d5ffb7277..d9638dc3e0ef 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -4451,7 +4451,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI, rv2 = nestedURI->GetInnerURI(getter_AddRefs(tempURI)); if (NS_SUCCEEDED(rv2) && tempURI) { tempURI->GetScheme(scheme); - formatStrs[0].Append(NS_LITERAL_STRING(", ")); + formatStrs[0].AppendLiteral(", "); AppendASCIItoUTF16(scheme, formatStrs[0]); } nestedURI = do_QueryInterface(tempURI); diff --git a/dom/base/Console.cpp b/dom/base/Console.cpp index 7effee2e6ab6..2dc25466e60e 100644 --- a/dom/base/Console.cpp +++ b/dom/base/Console.cpp @@ -1589,7 +1589,7 @@ Console::IncreaseCounter(JSContext* aCx, const ConsoleStackEntry& aFrame, if (key.IsEmpty()) { key.Append(aFrame.mFilename); - key.Append(NS_LITERAL_STRING(":")); + key.Append(':'); key.AppendInt(aFrame.mLineNumber); } diff --git a/dom/base/URLSearchParams.cpp b/dom/base/URLSearchParams.cpp index 9707476a780c..2092146d7f02 100644 --- a/dom/base/URLSearchParams.cpp +++ b/dom/base/URLSearchParams.cpp @@ -327,11 +327,11 @@ URLSearchParams::SerializeEnumerator(const nsAString& aName, if (data->mFirst) { data->mFirst = false; } else { - data->mValue.Append(NS_LITERAL_STRING("&")); + data->mValue.Append('&'); } data->Serialize(NS_ConvertUTF16toUTF8(aName)); - data->mValue.Append(NS_LITERAL_STRING("=")); + data->mValue.Append('='); data->Serialize(NS_ConvertUTF16toUTF8(aArray->ElementAt(i))); } diff --git a/dom/bluetooth/bluez/BluetoothHfpManager.cpp b/dom/bluetooth/bluez/BluetoothHfpManager.cpp index 983e20ab61b5..d096d628cdd2 100644 --- a/dom/bluetooth/bluez/BluetoothHfpManager.cpp +++ b/dom/bluetooth/bluez/BluetoothHfpManager.cpp @@ -1067,9 +1067,9 @@ BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, #endif // MOZ_B2G_RIL } else { nsCString warningMsg; - warningMsg.Append(NS_LITERAL_CSTRING("Unsupported AT command: ")); + warningMsg.AppendLiteral("Unsupported AT command: "); warningMsg.Append(msg); - warningMsg.Append(NS_LITERAL_CSTRING(", reply with ERROR")); + warningMsg.AppendLiteral(", reply with ERROR"); BT_WARNING(warningMsg.get()); SendLine("ERROR"); diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp index a971d91f432e..fc4dbbf5e238 100644 --- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -3257,7 +3257,7 @@ AddHelper::DoDatabaseWork(mozIStorageConnection* aConnection) } if (index) { - fileIds.Append(NS_LITERAL_STRING(" ")); + fileIds.Append(' '); } fileIds.AppendInt(id); } diff --git a/dom/indexedDB/KeyPath.cpp b/dom/indexedDB/KeyPath.cpp index b9a357113f4e..59f7e37c8ae6 100644 --- a/dom/indexedDB/KeyPath.cpp +++ b/dom/indexedDB/KeyPath.cpp @@ -457,7 +457,8 @@ KeyPath::SerializeToString(nsAString& aString) const // It also makes serializing easier :-) uint32_t len = mStrings.Length(); for (uint32_t i = 0; i < len; ++i) { - aString.Append(NS_LITERAL_STRING(",") + mStrings[i]); + aString.Append(','); + aString.Append(mStrings[i]); } return; diff --git a/dom/src/notification/Notification.cpp b/dom/src/notification/Notification.cpp index 157203bf870c..e1d2af25f215 100644 --- a/dom/src/notification/Notification.cpp +++ b/dom/src/notification/Notification.cpp @@ -431,10 +431,10 @@ Notification::Notification(const nsAString& aID, const nsAString& aTitle, const // The name of the alert is of the form origin#tag/ID. alertName.AppendLiteral("#"); if (!mTag.IsEmpty()) { - alertName.Append(NS_LITERAL_STRING("tag:")); + alertName.AppendLiteral("tag:"); alertName.Append(mTag); } else { - alertName.Append(NS_LITERAL_STRING("notag:")); + alertName.AppendLiteral("notag:"); alertName.Append(mID); } diff --git a/dom/src/storage/DOMStorageManager.cpp b/dom/src/storage/DOMStorageManager.cpp index 3e7f681249ce..d8d3585a10d4 100644 --- a/dom/src/storage/DOMStorageManager.cpp +++ b/dom/src/storage/DOMStorageManager.cpp @@ -157,7 +157,8 @@ CreateScopeKey(nsIPrincipal* aPrincipal, rv = uri->GetScheme(scheme); NS_ENSURE_SUCCESS(rv, rv); - key.Append(NS_LITERAL_CSTRING(":") + scheme); + key.Append(':'); + key.Append(scheme); int32_t port = NS_GetRealPort(uri); if (port != -1) { @@ -184,9 +185,10 @@ CreateScopeKey(nsIPrincipal* aPrincipal, aKey.Truncate(); aKey.AppendInt(appId); - aKey.Append(NS_LITERAL_CSTRING(":") + (isInBrowserElement ? - NS_LITERAL_CSTRING("t") : NS_LITERAL_CSTRING("f")) + - NS_LITERAL_CSTRING(":") + key); + aKey.Append(':'); + aKey.Append(isInBrowserElement ? 't' : 'f'); + aKey.Append(':'); + aKey.Append(key); } return NS_OK; @@ -238,9 +240,10 @@ CreateQuotaDBKey(nsIPrincipal* aPrincipal, aKey.Truncate(); aKey.AppendInt(appId); - aKey.Append(NS_LITERAL_CSTRING(":") + (isInBrowserElement ? - NS_LITERAL_CSTRING("t") : NS_LITERAL_CSTRING("f")) + - NS_LITERAL_CSTRING(":") + subdomainsDBKey); + aKey.Append(':'); + aKey.Append(isInBrowserElement ? 't' : 'f'); + aKey.Append(':'); + aKey.Append(subdomainsDBKey); } return NS_OK; diff --git a/dom/src/storage/DOMStorageObserver.cpp b/dom/src/storage/DOMStorageObserver.cpp index b90d29bb7233..dc7e15171882 100644 --- a/dom/src/storage/DOMStorageObserver.cpp +++ b/dom/src/storage/DOMStorageObserver.cpp @@ -272,14 +272,14 @@ DOMStorageObserver::Observe(nsISupports* aSubject, nsAutoCString scope; scope.AppendInt(appId); - scope.Append(NS_LITERAL_CSTRING(":t:")); + scope.AppendLiteral(":t:"); db->AsyncClearMatchingScope(scope); Notify("app-data-cleared", scope); if (!browserOnly) { scope.Truncate(); scope.AppendInt(appId); - scope.Append(NS_LITERAL_CSTRING(":f:")); + scope.AppendLiteral(":f:"); db->AsyncClearMatchingScope(scope); Notify("app-data-cleared", scope); } diff --git a/dom/system/OSFileConstants.cpp b/dom/system/OSFileConstants.cpp index aa5317346dc9..cbbbba51a18f 100644 --- a/dom/system/OSFileConstants.cpp +++ b/dom/system/OSFileConstants.cpp @@ -903,14 +903,14 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle global) // and we need to provide the full path. nsAutoString libxul; libxul.Append(gPaths->libDir); - libxul.Append(NS_LITERAL_STRING("/XUL")); + libxul.AppendLiteral("/XUL"); #else // On other platforms, libxul is a library "xul" with regular // library prefix/suffix. nsAutoString libxul; - libxul.Append(NS_LITERAL_STRING(DLL_PREFIX)); - libxul.Append(NS_LITERAL_STRING("xul")); - libxul.Append(NS_LITERAL_STRING(DLL_SUFFIX)); + libxul.AppendLiteral(DLL_PREFIX); + libxul.AppendLiteral("xul"); + libxul.AppendLiteral(DLL_SUFFIX); #endif // defined(XP_MACOSX) if (!SetStringProperty(cx, objPath, "libxul", libxul)) { @@ -973,14 +973,14 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle global) nsAutoString libsqlite3; #if defined(ANDROID) // On Android, we use the system's libsqlite3 - libsqlite3.Append(NS_LITERAL_STRING(DLL_PREFIX)); - libsqlite3.Append(NS_LITERAL_STRING("sqlite3")); - libsqlite3.Append(NS_LITERAL_STRING(DLL_SUFFIX)); + libsqlite3.AppendLiteral(DLL_PREFIX); + libsqlite3.AppendLiteral("sqlite3"); + libsqlite3.AppendLiteral(DLL_SUFFIX); #elif defined(XP_WIN) // On Windows, for some reason, this is part of nss3.dll - libsqlite3.Append(NS_LITERAL_STRING(DLL_PREFIX)); - libsqlite3.Append(NS_LITERAL_STRING("nss3")); - libsqlite3.Append(NS_LITERAL_STRING(DLL_SUFFIX)); + libsqlite3.AppendLiteral(DLL_PREFIX); + libsqlite3.AppendLiteral("nss3"); + libsqlite3.AppendLiteral(DLL_SUFFIX); #else // On other platforms, we link sqlite3 into libxul libsqlite3 = libxul; diff --git a/dom/system/gonk/nsVolumeService.cpp b/dom/system/gonk/nsVolumeService.cpp index ef058cc388ba..f1a0aa993078 100644 --- a/dom/system/gonk/nsVolumeService.cpp +++ b/dom/system/gonk/nsVolumeService.cpp @@ -224,7 +224,7 @@ nsVolumeService::GetVolumeByPath(const nsAString& aPath, nsIVolume **aResult) for (volIndex = 0; volIndex < numVolumes; volIndex++) { nsRefPtr vol = mVolumeArray[volIndex]; NS_ConvertUTF16toUTF8 volMountPointSlash(vol->MountPoint()); - volMountPointSlash.Append(NS_LITERAL_CSTRING("/")); + volMountPointSlash.Append('/'); nsDependentCSubstring testStr(realPathBuf, volMountPointSlash.Length()); if (volMountPointSlash.Equals(testStr)) { vol.forget(aResult); diff --git a/dom/xslt/xml/txXMLParser.cpp b/dom/xslt/xml/txXMLParser.cpp index cfd3eca9752f..72b59f8a578f 100644 --- a/dom/xslt/xml/txXMLParser.cpp +++ b/dom/xslt/xml/txXMLParser.cpp @@ -39,8 +39,9 @@ txParseDocumentFromURI(const nsAString& aHref, const txXPathNode& aLoader, loadGroup, true, &theDocument); if (NS_FAILED(rv)) { - aErrMsg.Append(NS_LITERAL_STRING("Document load of ") + - aHref + NS_LITERAL_STRING(" failed.")); + aErrMsg.AppendLiteral("Document load of "); + aErrMsg.Append(aHref); + aErrMsg.AppendLiteral(" failed."); return NS_FAILED(rv) ? rv : NS_ERROR_FAILURE; } diff --git a/dom/xslt/xpath/txNodeTypeTest.cpp b/dom/xslt/xpath/txNodeTypeTest.cpp index a783b20400ab..650a1ae5fefc 100644 --- a/dom/xslt/xpath/txNodeTypeTest.cpp +++ b/dom/xslt/xpath/txNodeTypeTest.cpp @@ -62,10 +62,10 @@ txNodeTypeTest::toString(nsAString& aDest) { switch (mNodeType) { case COMMENT_TYPE: - aDest.Append(NS_LITERAL_STRING("comment()")); + aDest.AppendLiteral("comment()"); break; case TEXT_TYPE: - aDest.Append(NS_LITERAL_STRING("text()")); + aDest.AppendLiteral("text()"); break; case PI_TYPE: aDest.AppendLiteral("processing-instruction("); @@ -79,7 +79,7 @@ txNodeTypeTest::toString(nsAString& aDest) aDest.Append(char16_t(')')); break; case NODE_TYPE: - aDest.Append(NS_LITERAL_STRING("node()")); + aDest.AppendLiteral("node()"); break; } } diff --git a/dom/xslt/xslt/txXSLTPatterns.cpp b/dom/xslt/xslt/txXSLTPatterns.cpp index 2074c1bf3bde..a61ad001632f 100644 --- a/dom/xslt/xslt/txXSLTPatterns.cpp +++ b/dom/xslt/xslt/txXSLTPatterns.cpp @@ -304,7 +304,7 @@ txIdPattern::toString(nsAString& aDest) nsAutoString str; mIds[count]->ToString(str); aDest.Append(str); - aDest.Append(NS_LITERAL_STRING("')")); + aDest.AppendLiteral("')"); #ifdef DEBUG aDest.Append(char16_t('}')); #endif @@ -360,7 +360,7 @@ txKeyPattern::toString(nsAString& aDest) aDest.Append(tmp); aDest.AppendLiteral(", "); aDest.Append(mValue); - aDest.Append(NS_LITERAL_STRING("')")); + aDest.AppendLiteral("')"); #ifdef DEBUG aDest.Append(char16_t('}')); #endif diff --git a/extensions/gio/nsGIOProtocolHandler.cpp b/extensions/gio/nsGIOProtocolHandler.cpp index 2972e6420130..acc7be41a9d2 100644 --- a/extensions/gio/nsGIOProtocolHandler.cpp +++ b/extensions/gio/nsGIOProtocolHandler.cpp @@ -788,7 +788,7 @@ mount_operation_ask_password (GMountOperation *mount_op, nsAutoString key, realm; NS_ConvertUTF8toUTF16 dispHost(scheme); - dispHost.Append(NS_LITERAL_STRING("://")); + dispHost.AppendLiteral("://"); dispHost.Append(NS_ConvertUTF8toUTF16(hostPort)); key = dispHost; diff --git a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp index beab6d13d862..ad7e3db46e02 100644 --- a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp +++ b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp @@ -185,7 +185,7 @@ ProxiedAuthCallback(gconstpointer in, nsAutoString key, realm; NS_ConvertUTF8toUTF16 dispHost(scheme); - dispHost.Append(NS_LITERAL_STRING("://")); + dispHost.AppendLiteral("://"); dispHost.Append(NS_ConvertUTF8toUTF16(hostPort)); key = dispHost; diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index b384b67793b9..811887bf3e22 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -184,7 +184,7 @@ gfxDWriteFontFamily::FindStyleVariations(FontInfoData *aFontInfoData) if (FAILED(hr)) { continue; } - fullID.Append(NS_LITERAL_STRING(" ")); + fullID.Append(' '); fullID.Append(faceName); gfxDWriteFontEntry *fe = new gfxDWriteFontEntry(fullID, font); @@ -1626,7 +1626,7 @@ DirectWriteFontInfo::LoadFontFamilyData(const nsAString& aFamilyName) if (FAILED(hr)) { continue; } - fullID.Append(NS_LITERAL_STRING(" ")); + fullID.Append(' '); fullID.Append(fontName); FontFaceData fontData; diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 45f04e303339..0470d70ada81 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -5542,9 +5542,12 @@ nsFrame::MakeFrameName(const nsAString& aType, nsAString& aResult) const if (GetType() == nsGkAtoms::subDocumentFrame) { nsAutoString src; mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::src, src); - buf.Append(NS_LITERAL_STRING(" src=") + src); + buf.AppendLiteral(" src="); + buf.Append(src); } - aResult.Append(NS_LITERAL_STRING("(") + buf + NS_LITERAL_STRING(")")); + aResult.Append('('); + aResult.Append(buf); + aResult.Append(')'); } char buf[40]; PR_snprintf(buf, sizeof(buf), "(%d)", ContentIndexInContainer(this)); diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index cf247c777fc0..d123f4ed2d08 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -1005,7 +1005,8 @@ AddFallbackFonts(nsAString& aFontName, const nsAString& aFallbackFamilies) ++p; // may advance past p_end } - aFontName.Append(NS_LITERAL_STRING(",") + aFallbackFamilies); + aFontName.Append(','); + aFontName.Append(aFallbackFamilies); return; insert: diff --git a/layout/style/Declaration.cpp b/layout/style/Declaration.cpp index d946fa1b2203..82df493c3808 100644 --- a/layout/style/Declaration.cpp +++ b/layout/style/Declaration.cpp @@ -343,14 +343,14 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue, AppendValueToString(eCSSProperty_border_image_slice, aValue, aSerialization); if (!widthDefault || !outsetDefault) { - aValue.Append(NS_LITERAL_STRING(" /")); + aValue.AppendLiteral(" /"); if (!widthDefault) { aValue.Append(char16_t(' ')); AppendValueToString(eCSSProperty_border_image_width, aValue, aSerialization); } if (!outsetDefault) { - aValue.Append(NS_LITERAL_STRING(" / ")); + aValue.AppendLiteral(" / "); AppendValueToString(eCSSProperty_border_image_outset, aValue, aSerialization); } diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp index 42902af1c8d8..85f99ae8145b 100644 --- a/layout/style/nsCSSRules.cpp +++ b/layout/style/nsCSSRules.cpp @@ -428,7 +428,7 @@ ImportRule::GetCssText(nsAString& aCssText) { aCssText.AssignLiteral("@import url("); nsStyleUtil::AppendEscapedCSSString(mURLSpec, aCssText); - aCssText.Append(NS_LITERAL_STRING(")")); + aCssText.Append(')'); if (mMedia) { nsAutoString mediaText; mMedia->GetText(mediaText); @@ -687,9 +687,9 @@ GroupRule::AppendRulesToCssText(nsAString& aCssText) if (domRule) { nsAutoString cssText; domRule->GetCssText(cssText); - aCssText.Append(NS_LITERAL_STRING(" ") + - cssText + - NS_LITERAL_STRING("\n")); + aCssText.AppendLiteral(" "); + aCssText.Append(cssText); + aCssText.Append('\n'); } } @@ -1311,7 +1311,7 @@ NameSpaceRule::GetCssText(nsAString& aCssText) } aCssText.AppendLiteral("url("); nsStyleUtil::AppendEscapedCSSString(mURLSpec, aCssText); - aCssText.Append(NS_LITERAL_STRING(");")); + aCssText.AppendLiteral(");"); return NS_OK; } diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index 27dc9e047834..aa7770f03cb5 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -1121,17 +1121,17 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult, } } else if (eCSSUnit_URL == unit || eCSSUnit_Image == unit) { - aResult.Append(NS_LITERAL_STRING("url(")); + aResult.AppendLiteral("url("); nsStyleUtil::AppendEscapedCSSString( nsDependentString(GetOriginalURLValue()), aResult); - aResult.Append(NS_LITERAL_STRING(")")); + aResult.Append(')'); } else if (eCSSUnit_Element == unit) { - aResult.Append(NS_LITERAL_STRING("-moz-element(#")); + aResult.AppendLiteral("-moz-element(#"); nsAutoString tmpStr; GetStringValue(tmpStr); nsStyleUtil::AppendEscapedCSSIdent(tmpStr, aResult); - aResult.Append(NS_LITERAL_STRING(")")); + aResult.Append(')'); } else if (eCSSUnit_Percent == unit) { aResult.AppendFloat(GetPercentValue() * 100.0f); diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index daff16e9cd42..aeb1a759e2b4 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -670,7 +670,7 @@ nsComputedDOMStyle::UpdateCurrentStyleSources(bool aNeedsLayoutFlush) nsAutoString assertMsg( NS_LITERAL_STRING("we should be in a pseudo-element that is expected to contain elements (")); assertMsg.Append(nsDependentString(pseudoAtom->GetUTF16String())); - assertMsg.Append(NS_LITERAL_STRING(")")); + assertMsg.Append(')'); NS_ASSERTION(nsCSSPseudoElements::PseudoElementContainsElements(pseudo), NS_LossyConvertUTF16toASCII(assertMsg).get()); } @@ -1314,48 +1314,48 @@ nsComputedDOMStyle::MatrixToCSSValue(gfx3DMatrix& matrix) nsAutoString resultString(NS_LITERAL_STRING("matrix")); if (is3D) { - resultString.Append(NS_LITERAL_STRING("3d")); + resultString.AppendLiteral("3d"); } - resultString.Append(NS_LITERAL_STRING("(")); + resultString.Append('('); resultString.AppendFloat(matrix._11); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._12); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); if (is3D) { resultString.AppendFloat(matrix._13); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._14); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); } resultString.AppendFloat(matrix._21); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._22); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); if (is3D) { resultString.AppendFloat(matrix._23); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._24); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._31); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._32); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._33); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._34); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); } resultString.AppendFloat(matrix._41); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._42); if (is3D) { - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._43); - resultString.Append(NS_LITERAL_STRING(", ")); + resultString.AppendLiteral(", "); resultString.AppendFloat(matrix._44); } - resultString.Append(NS_LITERAL_STRING(")")); + resultString.Append(')'); /* Create a value to hold our result. */ nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue; diff --git a/layout/style/nsROCSSPrimitiveValue.cpp b/layout/style/nsROCSSPrimitiveValue.cpp index 263c4a06abaf..8ee91c2550fc 100644 --- a/layout/style/nsROCSSPrimitiveValue.cpp +++ b/layout/style/nsROCSSPrimitiveValue.cpp @@ -247,7 +247,7 @@ nsROCSSPrimitiveValue::GetCssText(nsAString& aCssText) tmpStr.Append(comma + colorValue); } - tmpStr.Append(NS_LITERAL_STRING(")")); + tmpStr.Append(')'); break; } diff --git a/layout/style/nsStyleUtil.cpp b/layout/style/nsStyleUtil.cpp index 74dac0f1ae93..299f386748d5 100644 --- a/layout/style/nsStyleUtil.cpp +++ b/layout/style/nsStyleUtil.cpp @@ -342,7 +342,7 @@ nsStyleUtil::SerializeFunctionalAlternates( AppendEscapedCSSIdent(v.value, funcParams); } else { if (!funcParams.IsEmpty()) { - funcParams.Append(NS_LITERAL_STRING(", ")); + funcParams.AppendLiteral(", "); } AppendEscapedCSSIdent(v.value, funcParams); } diff --git a/netwerk/cache2/CacheFileUtils.cpp b/netwerk/cache2/CacheFileUtils.cpp index 585019fb4479..c71eaddd75b8 100644 --- a/netwerk/cache2/CacheFileUtils.cpp +++ b/netwerk/cache2/CacheFileUtils.cpp @@ -232,11 +232,11 @@ AppendKeyPrefix(nsILoadContextInfo* aInfo, nsACString &_retval) */ if (aInfo->IsAnonymous()) { - _retval.Append(NS_LITERAL_CSTRING("a,")); + _retval.AppendLiteral("a,"); } if (aInfo->IsInBrowserElement()) { - _retval.Append(NS_LITERAL_CSTRING("b,")); + _retval.AppendLiteral("b,"); } if (aInfo->AppId() != nsILoadContextInfo::NO_APP_ID) { @@ -246,7 +246,7 @@ AppendKeyPrefix(nsILoadContextInfo* aInfo, nsACString &_retval) } if (aInfo->IsPrivate()) { - _retval.Append(NS_LITERAL_CSTRING("p,")); + _retval.AppendLiteral("p,"); } } diff --git a/netwerk/cache2/OldWrappers.cpp b/netwerk/cache2/OldWrappers.cpp index a96c770a2571..ccc257e0ba32 100644 --- a/netwerk/cache2/OldWrappers.cpp +++ b/netwerk/cache2/OldWrappers.cpp @@ -566,7 +566,7 @@ GetCacheSessionNameForStoragePolicy( // recognize it too. sessionName.Assign(NS_LITERAL_CSTRING("other")); if (isPrivate) - sessionName.Append(NS_LITERAL_CSTRING("-private")); + sessionName.AppendLiteral("-private"); } if (appId != nsILoadContextInfo::NO_APP_ID || inBrowser) { diff --git a/netwerk/protocol/about/nsAboutCacheEntry.cpp b/netwerk/protocol/about/nsAboutCacheEntry.cpp index cf1b88e23426..c8c88c89fd86 100644 --- a/netwerk/protocol/about/nsAboutCacheEntry.cpp +++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp @@ -409,7 +409,7 @@ nsAboutCacheEntry::WriteCacheEntryDescription(nsICacheEntry *entry) if (NS_FAILED(entry->GetStorageDataSize(&dataSize))) dataSize = 0; s.AppendInt((int32_t)dataSize); // XXX nsICacheEntryInfo interfaces should be fixed. - s.Append(NS_LITERAL_CSTRING(" B")); + s.AppendLiteral(" B"); APPEND_ROW("Data size", s); // TODO - mayhemer diff --git a/netwerk/protocol/http/Http2Compression.cpp b/netwerk/protocol/http/Http2Compression.cpp index 91ebee042950..35ac966c8e57 100644 --- a/netwerk/protocol/http/Http2Compression.cpp +++ b/netwerk/protocol/http/Http2Compression.cpp @@ -424,7 +424,7 @@ Http2Decompressor::OutputHeader(const nsACString &name, const nsACString &value) if (name.Equals(NS_LITERAL_CSTRING(":status"))) { nsAutoCString status(NS_LITERAL_CSTRING("HTTP/2.0 ")); status.Append(value); - status.Append(NS_LITERAL_CSTRING("\r\n")); + status.AppendLiteral("\r\n"); mOutput->Insert(status, 0); mHeaderStatus = value; } else if (name.Equals(NS_LITERAL_CSTRING(":authority"))) { @@ -445,24 +445,24 @@ Http2Decompressor::OutputHeader(const nsACString &name, const nsACString &value) } mOutput->Append(name); - mOutput->Append(NS_LITERAL_CSTRING(": ")); + mOutput->AppendLiteral(": "); // Special handling for set-cookie according to the spec bool isSetCookie = name.Equals(NS_LITERAL_CSTRING("set-cookie")); int32_t valueLen = value.Length(); for (int32_t i = 0; i < valueLen; ++i) { if (value[i] == '\0') { if (isSetCookie) { - mOutput->Append(NS_LITERAL_CSTRING("\r\n")); + mOutput->AppendLiteral("\r\n"); mOutput->Append(name); - mOutput->Append(NS_LITERAL_CSTRING(": ")); + mOutput->AppendLiteral(": "); } else { - mOutput->Append(NS_LITERAL_CSTRING(", ")); + mOutput->AppendLiteral(", "); } } else { mOutput->Append(value[i]); } } - mOutput->Append(NS_LITERAL_CSTRING("\r\n")); + mOutput->AppendLiteral("\r\n"); return NS_OK; } diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp index 1c2b75ba56c7..78c140d8edf6 100644 --- a/netwerk/protocol/http/Http2Stream.cpp +++ b/netwerk/protocol/http/Http2Stream.cpp @@ -249,13 +249,13 @@ Http2Stream::CreatePushHashKey(const nsCString &scheme, nsCString &outKey) { outOrigin = scheme; - outOrigin.Append(NS_LITERAL_CSTRING("://")); + outOrigin.AppendLiteral("://"); outOrigin.Append(hostHeader); outKey = outOrigin; - outKey.Append(NS_LITERAL_CSTRING("/[http2.")); + outKey.AppendLiteral("/[http2."); outKey.AppendInt(serial); - outKey.Append(NS_LITERAL_CSTRING("]")); + outKey.Append(']'); outKey.Append(pathInfo); } @@ -876,7 +876,7 @@ Http2Stream::ConvertResponseHeaders(Http2Decompressor *decompressor, } aHeadersIn.Truncate(); - aHeadersOut.Append(NS_LITERAL_CSTRING("X-Firefox-Spdy: " NS_HTTP2_DRAFT_TOKEN "\r\n\r\n")); + aHeadersOut.Append("X-Firefox-Spdy: " NS_HTTP2_DRAFT_TOKEN "\r\n\r\n"); LOG (("decoded response headers are:\n%s", aHeadersOut.BeginReading())); if (mIsTunnel) { aHeadersOut.Truncate(); diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 4896a50eea29..ef3f54d865cc 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -1730,7 +1730,8 @@ HttpBaseChannel::AddCookiesToRequest() cookie = mUserSetCookieHeader; } else if (!mUserSetCookieHeader.IsEmpty()) { - cookie.Append(NS_LITERAL_CSTRING("; ") + mUserSetCookieHeader); + cookie.AppendLiteral("; "); + cookie.Append(mUserSetCookieHeader); } } else { diff --git a/netwerk/protocol/http/SpdyStream3.cpp b/netwerk/protocol/http/SpdyStream3.cpp index 7174c27ccdac..69c684a0bb02 100644 --- a/netwerk/protocol/http/SpdyStream3.cpp +++ b/netwerk/protocol/http/SpdyStream3.cpp @@ -236,13 +236,13 @@ SpdyStream3::CreatePushHashKey(const nsCString &scheme, nsCString &outKey) { outOrigin = scheme; - outOrigin.Append(NS_LITERAL_CSTRING("://")); + outOrigin.AppendLiteral("://"); outOrigin.Append(hostHeader); outKey = outOrigin; - outKey.Append(NS_LITERAL_CSTRING("/[spdy3.")); + outKey.AppendLiteral("/[spdy3."); outKey.AppendInt(serial); - outKey.Append(NS_LITERAL_CSTRING("]")); + outKey.Append(']'); outKey.Append(pathInfo); } @@ -1163,9 +1163,9 @@ SpdyStream3::ConvertHeaders(nsACString &aHeadersOut) // create UI feedback. aHeadersOut.Append(version); - aHeadersOut.Append(NS_LITERAL_CSTRING(" ")); + aHeadersOut.Append(' '); aHeadersOut.Append(status); - aHeadersOut.Append(NS_LITERAL_CSTRING("\r\n")); + aHeadersOut.AppendLiteral("\r\n"); const unsigned char *nvpair = reinterpret_cast (mDecompressBuffer.get()) + 4; @@ -1244,7 +1244,7 @@ SpdyStream3::ConvertHeaders(nsACString &aHeadersOut) valueLen); aHeadersOut.Append(nameString); - aHeadersOut.Append(NS_LITERAL_CSTRING(": ")); + aHeadersOut.AppendLiteral(": "); // expand nullptr bytes in the value string for (char *cPtr = valueString.BeginWriting(); @@ -1256,12 +1256,12 @@ SpdyStream3::ConvertHeaders(nsACString &aHeadersOut) } // NULLs are really "\r\nhdr: " - aHeadersOut.Append(NS_LITERAL_CSTRING("\r\n")); + aHeadersOut.AppendLiteral("\r\n"); aHeadersOut.Append(nameString); - aHeadersOut.Append(NS_LITERAL_CSTRING(": ")); + aHeadersOut.AppendLiteral(": "); } - aHeadersOut.Append(NS_LITERAL_CSTRING("\r\n")); + aHeadersOut.AppendLiteral("\r\n"); } // move to the next name/value pair in this block nvpair += 8 + nameLen + valueLen; @@ -1272,7 +1272,7 @@ SpdyStream3::ConvertHeaders(nsACString &aHeadersOut) nvpair += 4; } while (lastHeaderByte >= nvpair); - aHeadersOut.Append(NS_LITERAL_CSTRING("X-Firefox-Spdy: 3\r\n\r\n")); + aHeadersOut.AppendLiteral("X-Firefox-Spdy: 3\r\n\r\n"); LOG (("decoded response headers are:\n%s", aHeadersOut.BeginReading())); diff --git a/netwerk/protocol/http/SpdyStream31.cpp b/netwerk/protocol/http/SpdyStream31.cpp index 88678f110425..7929ee463ad2 100644 --- a/netwerk/protocol/http/SpdyStream31.cpp +++ b/netwerk/protocol/http/SpdyStream31.cpp @@ -241,13 +241,13 @@ SpdyStream31::CreatePushHashKey(const nsCString &scheme, nsCString &outKey) { outOrigin = scheme; - outOrigin.Append(NS_LITERAL_CSTRING("://")); + outOrigin.AppendLiteral("://"); outOrigin.Append(hostHeader); outKey = outOrigin; - outKey.Append(NS_LITERAL_CSTRING("/[spdy3_1.")); + outKey.AppendLiteral("/[spdy3_1."); outKey.AppendInt(serial); - outKey.Append(NS_LITERAL_CSTRING("]")); + outKey.Append(']'); outKey.Append(pathInfo); } @@ -1179,9 +1179,9 @@ SpdyStream31::ConvertHeaders(nsACString &aHeadersOut) // create UI feedback. aHeadersOut.Append(version); - aHeadersOut.Append(NS_LITERAL_CSTRING(" ")); + aHeadersOut.Append(' '); aHeadersOut.Append(status); - aHeadersOut.Append(NS_LITERAL_CSTRING("\r\n")); + aHeadersOut.AppendLiteral("\r\n"); const unsigned char *nvpair = reinterpret_cast (mDecompressBuffer.get()) + 4; @@ -1260,7 +1260,7 @@ SpdyStream31::ConvertHeaders(nsACString &aHeadersOut) valueLen); aHeadersOut.Append(nameString); - aHeadersOut.Append(NS_LITERAL_CSTRING(": ")); + aHeadersOut.AppendLiteral(": "); // expand NULL bytes in the value string for (char *cPtr = valueString.BeginWriting(); @@ -1272,12 +1272,12 @@ SpdyStream31::ConvertHeaders(nsACString &aHeadersOut) } // NULLs are really "\r\nhdr: " - aHeadersOut.Append(NS_LITERAL_CSTRING("\r\n")); + aHeadersOut.AppendLiteral("\r\n"); aHeadersOut.Append(nameString); - aHeadersOut.Append(NS_LITERAL_CSTRING(": ")); + aHeadersOut.AppendLiteral(": "); } - aHeadersOut.Append(NS_LITERAL_CSTRING("\r\n")); + aHeadersOut.AppendLiteral("\r\n"); } // move to the next name/value pair in this block nvpair += 8 + nameLen + valueLen; @@ -1288,7 +1288,7 @@ SpdyStream31::ConvertHeaders(nsACString &aHeadersOut) nvpair += 4; } while (lastHeaderByte >= nvpair); - aHeadersOut.Append(NS_LITERAL_CSTRING("X-Firefox-Spdy: 3.1\r\n\r\n")); + aHeadersOut.AppendLiteral("X-Firefox-Spdy: 3.1\r\n\r\n"); LOG (("decoded response headers are:\n%s", aHeadersOut.BeginReading())); diff --git a/netwerk/test/TestSocketTransport.cpp b/netwerk/test/TestSocketTransport.cpp index 6179976f10ae..b630b6eb8058 100644 --- a/netwerk/test/TestSocketTransport.cpp +++ b/netwerk/test/TestSocketTransport.cpp @@ -56,7 +56,7 @@ public: { mBuf.Assign(NS_LITERAL_CSTRING("GET ")); mBuf.Append(path); - mBuf.Append(NS_LITERAL_CSTRING(" HTTP/1.0\r\n\r\n")); + mBuf.AppendLiteral(" HTTP/1.0\r\n\r\n"); } virtual ~MyHandler() {} diff --git a/netwerk/test/TestStreamTransport.cpp b/netwerk/test/TestStreamTransport.cpp index e0abe5066fcb..9fbcc109b312 100644 --- a/netwerk/test/TestStreamTransport.cpp +++ b/netwerk/test/TestStreamTransport.cpp @@ -297,7 +297,7 @@ main(int argc, char* argv[]) if (NS_FAILED(rv)) return rv; nsAutoCString newName(leafName); - newName.Append(NS_LITERAL_CSTRING(".1")); + newName.AppendLiteral(".1"); rv = destFile->SetNativeLeafName(newName); if (NS_FAILED(rv)) return rv; @@ -305,7 +305,7 @@ main(int argc, char* argv[]) NS_ASSERTION(NS_SUCCEEDED(rv), "RunTest failed"); newName = leafName; - newName.Append(NS_LITERAL_CSTRING(".2")); + newName.AppendLiteral(".2"); rv = destFile->SetNativeLeafName(newName); if (NS_FAILED(rv)) return rv; diff --git a/parser/html/nsHtml5TreeOperation.cpp b/parser/html/nsHtml5TreeOperation.cpp index d73f45f5d6c3..bb1e56ae4d9e 100644 --- a/parser/html/nsHtml5TreeOperation.cpp +++ b/parser/html/nsHtml5TreeOperation.cpp @@ -937,7 +937,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder, nsAutoString klass; node->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, klass); if (!klass.IsEmpty()) { - klass.Append(NS_LITERAL_STRING(" error")); + klass.AppendLiteral(" error"); node->SetAttr(kNameSpaceID_None, nsGkAtoms::_class, klass, true); } else { node->SetAttr(kNameSpaceID_None, diff --git a/parser/html/nsParserUtils.cpp b/parser/html/nsParserUtils.cpp index 4015e7b29d1d..7fa34231973d 100644 --- a/parser/html/nsParserUtils.cpp +++ b/parser/html/nsParserUtils.cpp @@ -169,8 +169,8 @@ nsParserUtils::ParseFragment(const nsAString& aFragment, if (aIsXML) { // XHTML if (aBaseURI) { - base.Append(NS_LITERAL_CSTRING(XHTML_DIV_TAG)); - base.Append(NS_LITERAL_CSTRING(" xml:base=\"")); + base.AppendLiteral(XHTML_DIV_TAG); + base.AppendLiteral(" xml:base=\""); aBaseURI->GetSpec(spec); // nsEscapeHTML is good enough, because we only need to get // quotes, ampersands, and angle brackets @@ -178,7 +178,7 @@ nsParserUtils::ParseFragment(const nsAString& aFragment, if (escapedSpec) base += escapedSpec; NS_Free(escapedSpec); - base.Append(NS_LITERAL_CSTRING("\"")); + base.Append('"'); tagStack.AppendElement(NS_ConvertUTF8toUTF16(base)); } else { tagStack.AppendElement(NS_LITERAL_STRING(XHTML_DIV_TAG)); diff --git a/security/manager/ssl/src/TransportSecurityInfo.cpp b/security/manager/ssl/src/TransportSecurityInfo.cpp index deb36a0c857c..2479b49ece4a 100644 --- a/security/manager/ssl/src/TransportSecurityInfo.cpp +++ b/security/manager/ssl/src/TransportSecurityInfo.cpp @@ -590,7 +590,7 @@ formatPlainErrorMessage(const nsXPIDLCString &host, int32_t port, if (NS_SUCCEEDED(rv)) { returnedMessage.Append(formattedString); - returnedMessage.Append(NS_LITERAL_STRING("\n\n")); + returnedMessage.AppendLiteral("\n\n"); } } @@ -659,7 +659,7 @@ AppendErrorTextUntrusted(PRErrorCode errTrust, if (NS_SUCCEEDED(rv)) { returnedMessage.Append(formattedString); - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); } } @@ -702,7 +702,7 @@ GetSubjectAltNames(CERTCertificate *nssCert, case certDNSName: name.AssignASCII((char*)current->name.other.data, current->name.other.len); if (!allNames.IsEmpty()) { - allNames.Append(NS_LITERAL_STRING(", ")); + allNames.AppendLiteral(", "); } ++nameCount; allNames.Append(name); @@ -727,7 +727,7 @@ GetSubjectAltNames(CERTCertificate *nssCert, } if (!name.IsEmpty()) { if (!allNames.IsEmpty()) { - allNames.Append(NS_LITERAL_STRING(", ")); + allNames.AppendLiteral(", "); } ++nameCount; allNames.Append(name); @@ -770,7 +770,7 @@ AppendErrorTextMismatch(const nsString &host, formattedString); if (NS_SUCCEEDED(rv)) { returnedMessage.Append(formattedString); - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); } return; } @@ -803,9 +803,9 @@ AppendErrorTextMismatch(const nsString &host, message); if (NS_SUCCEEDED(rv)) { returnedMessage.Append(message); - returnedMessage.Append(NS_LITERAL_STRING("\n ")); + returnedMessage.AppendLiteral("\n "); returnedMessage.Append(allNames); - returnedMessage.Append(NS_LITERAL_STRING(" \n")); + returnedMessage.AppendLiteral(" \n"); } } else if (nameCount == 1) { @@ -824,7 +824,7 @@ AppendErrorTextMismatch(const nsString &host, formattedString); if (NS_SUCCEEDED(rv)) { returnedMessage.Append(formattedString); - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); } } else { // nameCount == 0 @@ -833,7 +833,7 @@ AppendErrorTextMismatch(const nsString &host, message); if (NS_SUCCEEDED(rv)) { returnedMessage.Append(message); - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); } } } @@ -908,7 +908,7 @@ AppendErrorTextTime(nsIX509Cert* ix509, if (NS_SUCCEEDED(rv)) { returnedMessage.Append(formattedString); - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); } } @@ -933,14 +933,14 @@ AppendErrorTextCode(PRErrorCode errorCodeToReport, params, 1, formattedString); if (NS_SUCCEEDED(rv)) { - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); returnedMessage.Append(formattedString); - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); } else { - returnedMessage.Append(NS_LITERAL_STRING(" (")); + returnedMessage.AppendLiteral(" ("); returnedMessage.Append(idU); - returnedMessage.Append(NS_LITERAL_STRING(")")); + returnedMessage.Append(')'); } } } @@ -989,7 +989,7 @@ formatOverridableCertErrorMessage(nsISSLStatus & sslStatus, returnedMessage); NS_ENSURE_SUCCESS(rv, rv); - returnedMessage.Append(NS_LITERAL_STRING("\n\n")); + returnedMessage.AppendLiteral("\n\n"); RefPtr ix509; rv = sslStatus.GetServerCert(byRef(ix509)); diff --git a/security/manager/ssl/src/nsNSSCallbacks.cpp b/security/manager/ssl/src/nsNSSCallbacks.cpp index 7e4b943e458a..e236a97d32cc 100644 --- a/security/manager/ssl/src/nsNSSCallbacks.cpp +++ b/security/manager/ssl/src/nsNSSCallbacks.cpp @@ -1207,7 +1207,7 @@ void HandshakeCallback(PRFileDesc* fd, void* client_data) { nsAutoString msg; msg.Append(NS_ConvertASCIItoUTF16(hostName)); - msg.Append(NS_LITERAL_STRING(" : server does not support RFC 5746, see CVE-2009-3555")); + msg.AppendLiteral(" : server does not support RFC 5746, see CVE-2009-3555"); nsContentUtils::LogSimpleConsoleError(msg, "SSL"); } diff --git a/security/manager/ssl/src/nsNSSCertHelper.cpp b/security/manager/ssl/src/nsNSSCertHelper.cpp index f0d7e85601dd..091634984c01 100644 --- a/security/manager/ssl/src/nsNSSCertHelper.cpp +++ b/security/manager/ssl/src/nsNSSCertHelper.cpp @@ -635,7 +635,7 @@ ProcessRawBytes(nsINSSComponent *nssComponent, SECItem *data, nsAutoString value; value.AppendInt(i_pv); text.Append(value); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); return NS_OK; } @@ -652,7 +652,7 @@ ProcessRawBytes(nsINSSComponent *nssComponent, SECItem *data, if (NS_FAILED(rv)) return rv; - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } // This prints the value of the byte out into a @@ -666,7 +666,7 @@ ProcessRawBytes(nsINSSComponent *nssComponent, SECItem *data, PR_snprintf(buffer, 5, "%02x ", data->data[i]); AppendASCIItoUTF16(buffer, text); if ((i+1)%16 == 0) { - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } } return NS_OK; @@ -692,37 +692,37 @@ ProcessNSCertTypeExtensions(SECItem *extData, if (nsCertType & NS_CERT_TYPE_SSL_CLIENT) { nssComponent->GetPIPNSSBundleString("VerifySSLClient", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (nsCertType & NS_CERT_TYPE_SSL_SERVER) { nssComponent->GetPIPNSSBundleString("VerifySSLServer", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (nsCertType & NS_CERT_TYPE_EMAIL) { nssComponent->GetPIPNSSBundleString("CertDumpCertTypeEmail", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (nsCertType & NS_CERT_TYPE_OBJECT_SIGNING) { nssComponent->GetPIPNSSBundleString("VerifyObjSign", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (nsCertType & NS_CERT_TYPE_SSL_CA) { nssComponent->GetPIPNSSBundleString("VerifySSLCA", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (nsCertType & NS_CERT_TYPE_EMAIL_CA) { nssComponent->GetPIPNSSBundleString("CertDumpEmailCA", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (nsCertType & NS_CERT_TYPE_OBJECT_SIGNING_CA) { nssComponent->GetPIPNSSBundleString("VerifyObjSign", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } return NS_OK; } @@ -746,37 +746,37 @@ ProcessKeyUsageExtension(SECItem *extData, nsAString &text, if (keyUsage & KU_DIGITAL_SIGNATURE) { nssComponent->GetPIPNSSBundleString("CertDumpKUSign", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (keyUsage & KU_NON_REPUDIATION) { nssComponent->GetPIPNSSBundleString("CertDumpKUNonRep", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (keyUsage & KU_KEY_ENCIPHERMENT) { nssComponent->GetPIPNSSBundleString("CertDumpKUEnc", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (keyUsage & KU_DATA_ENCIPHERMENT) { nssComponent->GetPIPNSSBundleString("CertDumpKUDEnc", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (keyUsage & KU_KEY_AGREEMENT) { nssComponent->GetPIPNSSBundleString("CertDumpKUKA", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (keyUsage & KU_KEY_CERT_SIGN) { nssComponent->GetPIPNSSBundleString("CertDumpKUCertSign", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } if (keyUsage & KU_CRL_SIGN) { nssComponent->GetPIPNSSBundleString("CertDumpKUCRLSigner", local); text.Append(local.get()); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); } return NS_OK; @@ -816,7 +816,7 @@ ProcessBasicConstraints(SECItem *extData, params, 1, local); if (NS_FAILED(rv2)) return rv2; - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); text.Append(local.get()); } return NS_OK; @@ -856,14 +856,14 @@ ProcessExtKeyUsage(SECItem *extData, if (NS_SUCCEEDED(rv)) { // display name and OID in parentheses text.Append(local); - text.Append(NS_LITERAL_STRING(" (")); + text.AppendLiteral(" ("); text.Append(oidname); - text.Append(NS_LITERAL_STRING(")")); + text.Append(')'); } else // If there is no bundle string, just display the OID itself text.Append(oidname); - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); oids++; } @@ -1140,9 +1140,9 @@ ProcessGeneralName(PLArenaPool *arena, break; } text.Append(key); - text.Append(NS_LITERAL_STRING(": ")); + text.AppendLiteral(": "); text.Append(value); - text.Append(NS_LITERAL_STRING(SEPARATOR)); + text.AppendLiteral(SEPARATOR); finish: return rv; } @@ -1212,7 +1212,7 @@ ProcessSubjectKeyId(SECItem *extData, nssComponent->GetPIPNSSBundleString("CertDumpKeyID", local); text.Append(local); - text.Append(NS_LITERAL_STRING(": ")); + text.AppendLiteral(": "); ProcessRawBytes(nssComponent, &decoded, text); finish: @@ -1243,15 +1243,15 @@ ProcessAuthKeyId(SECItem *extData, if (ret->keyID.len > 0) { nssComponent->GetPIPNSSBundleString("CertDumpKeyID", local); text.Append(local); - text.Append(NS_LITERAL_STRING(": ")); + text.AppendLiteral(": "); ProcessRawBytes(nssComponent, &ret->keyID, text); - text.Append(NS_LITERAL_STRING(SEPARATOR)); + text.AppendLiteral(SEPARATOR); } if (ret->authCertIssuer) { nssComponent->GetPIPNSSBundleString("CertDumpIssuer", local); text.Append(local); - text.Append(NS_LITERAL_STRING(": ")); + text.AppendLiteral(": "); rv = ProcessGeneralNames(arena, ret->authCertIssuer, text, nssComponent); if (NS_FAILED(rv)) goto finish; @@ -1260,7 +1260,7 @@ ProcessAuthKeyId(SECItem *extData, if (ret->authCertSerialNumber.len > 0) { nssComponent->GetPIPNSSBundleString("CertDumpSerialNo", local); text.Append(local); - text.Append(NS_LITERAL_STRING(": ")); + text.AppendLiteral(": "); ProcessRawBytes(nssComponent, &ret->authCertSerialNumber, text); } @@ -1304,7 +1304,7 @@ ProcessUserNotice(SECItem *der_notice, default: break; } - text.Append(NS_LITERAL_STRING(" - ")); + text.AppendLiteral(" - "); itemList = notice->noticeReference.noticeNumbers; while (*itemList) { unsigned long number; @@ -1312,15 +1312,15 @@ ProcessUserNotice(SECItem *der_notice, if (SEC_ASN1DecodeInteger(*itemList, &number) == SECSuccess) { PR_snprintf(buffer, sizeof(buffer), "#%d", number); if (itemList != notice->noticeReference.noticeNumbers) - text.Append(NS_LITERAL_STRING(", ")); + text.AppendLiteral(", "); AppendASCIItoUTF16(buffer, text); } itemList++; } } if (notice->displayText.len != 0) { - text.Append(NS_LITERAL_STRING(SEPARATOR)); - text.Append(NS_LITERAL_STRING(" ")); + text.AppendLiteral(SEPARATOR); + text.AppendLiteral(" "); switch (notice->displayText.type) { case siAsciiString: case siVisibleString: @@ -1379,8 +1379,8 @@ ProcessCertificatePolicies(SECItem *extData, // next to the correct OID. if (policyInfo->oid == ev_oid_tag) { - text.Append(NS_LITERAL_STRING(":")); - text.Append(NS_LITERAL_STRING(SEPARATOR)); + text.Append(':'); + text.AppendLiteral(SEPARATOR); needColon = false; nssComponent->GetPIPNSSBundleString("CertDumpPolicyOidEV", local); text.Append(local); @@ -1391,18 +1391,18 @@ ProcessCertificatePolicies(SECItem *extData, /* Add all qualifiers on separate lines, indented */ policyQualifiers = policyInfo->policyQualifiers; if (needColon) - text.Append(NS_LITERAL_STRING(":")); - text.Append(NS_LITERAL_STRING(SEPARATOR)); + text.Append(':'); + text.AppendLiteral(SEPARATOR); while (*policyQualifiers) { - text.Append(NS_LITERAL_STRING(" ")); + text.AppendLiteral(" "); policyQualifier = *policyQualifiers++; switch(policyQualifier->oid) { case SEC_OID_PKIX_CPS_POINTER_QUALIFIER: nssComponent->GetPIPNSSBundleString("CertDumpCPSPointer", local); text.Append(local); - text.Append(NS_LITERAL_STRING(":")); - text.Append(NS_LITERAL_STRING(SEPARATOR)); - text.Append(NS_LITERAL_STRING(" ")); + text.Append(':'); + text.AppendLiteral(SEPARATOR); + text.AppendLiteral(" "); /* The CPS pointer ought to be the cPSuri alternative of the Qualifier choice. */ rv = ProcessIA5String(&policyQualifier->qualifierValue, @@ -1413,20 +1413,20 @@ ProcessCertificatePolicies(SECItem *extData, case SEC_OID_PKIX_USER_NOTICE_QUALIFIER: nssComponent->GetPIPNSSBundleString("CertDumpUserNotice", local); text.Append(local); - text.Append(NS_LITERAL_STRING(": ")); + text.AppendLiteral(": "); rv = ProcessUserNotice(&policyQualifier->qualifierValue, text, nssComponent); break; default: GetDefaultOIDFormat(&policyQualifier->qualifierID, nssComponent, local, '.'); text.Append(local); - text.Append(NS_LITERAL_STRING(": ")); + text.AppendLiteral(": "); ProcessRawBytes(nssComponent, &policyQualifier->qualifierValue, text); } - text.Append(NS_LITERAL_STRING(SEPARATOR)); + text.AppendLiteral(SEPARATOR); } /* while policyQualifiers */ } /* if policyQualifiers */ - text.Append(NS_LITERAL_STRING(SEPARATOR)); + text.AppendLiteral(SEPARATOR); } finish: @@ -1474,48 +1474,48 @@ ProcessCrlDistPoints(SECItem *extData, } if (point->reasons.len) { reasons = point->reasons.data[0]; - text.Append(NS_LITERAL_STRING(" ")); + text.Append(' '); comma = 0; if (reasons & RF_UNUSED) { nssComponent->GetPIPNSSBundleString("CertDumpUnused", local); text.Append(local); comma = 1; } if (reasons & RF_KEY_COMPROMISE) { - if (comma) text.Append(NS_LITERAL_STRING(", ")); + if (comma) text.AppendLiteral(", "); nssComponent->GetPIPNSSBundleString("CertDumpKeyCompromise", local); text.Append(local); comma = 1; } if (reasons & RF_CA_COMPROMISE) { - if (comma) text.Append(NS_LITERAL_STRING(", ")); + if (comma) text.AppendLiteral(", "); nssComponent->GetPIPNSSBundleString("CertDumpCACompromise", local); text.Append(local); comma = 1; } if (reasons & RF_AFFILIATION_CHANGED) { - if (comma) text.Append(NS_LITERAL_STRING(", ")); + if (comma) text.AppendLiteral(", "); nssComponent->GetPIPNSSBundleString("CertDumpAffiliationChanged", local); text.Append(local); comma = 1; } if (reasons & RF_SUPERSEDED) { - if (comma) text.Append(NS_LITERAL_STRING(", ")); + if (comma) text.AppendLiteral(", "); nssComponent->GetPIPNSSBundleString("CertDumpSuperseded", local); text.Append(local); comma = 1; } if (reasons & RF_CESSATION_OF_OPERATION) { - if (comma) text.Append(NS_LITERAL_STRING(", ")); + if (comma) text.AppendLiteral(", "); nssComponent->GetPIPNSSBundleString("CertDumpCessation", local); text.Append(local); comma = 1; } if (reasons & RF_CERTIFICATE_HOLD) { - if (comma) text.Append(NS_LITERAL_STRING(", ")); + if (comma) text.AppendLiteral(", "); nssComponent->GetPIPNSSBundleString("CertDumpHold", local); text.Append(local); comma = 1; } - text.Append(NS_LITERAL_STRING(SEPARATOR)); + text.AppendLiteral(SEPARATOR); } if (point->crlIssuer) { nssComponent->GetPIPNSSBundleString("CertDumpIssuer", local); text.Append(local); - text.Append(NS_LITERAL_STRING(": ")); + text.AppendLiteral(": "); rv = ProcessGeneralNames(arena, point->crlIssuer, text, nssComponent); if (NS_FAILED(rv)) @@ -1561,7 +1561,7 @@ ProcessAuthInfoAccess(SECItem *extData, goto finish; } text.Append(local); - text.Append(NS_LITERAL_STRING(": ")); + text.AppendLiteral(": "); rv = ProcessGeneralName(arena, desc->location, text, nssComponent); if (NS_FAILED(rv)) goto finish; @@ -1690,7 +1690,7 @@ ProcessSingleExtension(CERTCertExtension *extension, } else { nssComponent->GetPIPNSSBundleString("CertDumpNonCritical", text); } - text.Append(NS_LITERAL_STRING(SEPARATOR).get()); + text.AppendLiteral(SEPARATOR); nsresult rv = ProcessExtensionData(oidTag, &extension->value, extvalue, ev_oid_tag, nssComponent); if (NS_FAILED(rv)) { @@ -1780,7 +1780,7 @@ ProcessTime(PRTime dispTime, const char16_t *displayName, &explodedTimeGMT, tempString); text.Append(tempString); - text.Append(NS_LITERAL_STRING(" GMT)")); + text.AppendLiteral(" GMT)"); nsCOMPtr printableItem = new nsNSSASN1PrintableItem(); @@ -2202,10 +2202,10 @@ getNSSCertNicknamesFromCertList(CERTCertList *certList) nssComponent->GetPIPNSSBundleString("NicknameExpired", expiredString); nssComponent->GetPIPNSSBundleString("NicknameNotYetValid", notYetValidString); - expiredStringLeadingSpace.Append(NS_LITERAL_STRING(" ")); + expiredStringLeadingSpace.Append(' '); expiredStringLeadingSpace.Append(expiredString); - notYetValidStringLeadingSpace.Append(NS_LITERAL_STRING(" ")); + notYetValidStringLeadingSpace.Append(' '); notYetValidStringLeadingSpace.Append(notYetValidString); NS_ConvertUTF16toUTF8 aUtf8ExpiredString(expiredStringLeadingSpace); diff --git a/security/manager/ssl/src/nsNSSErrors.cpp b/security/manager/ssl/src/nsNSSErrors.cpp index 7dd5c347616c..28272e32b260 100644 --- a/security/manager/ssl/src/nsNSSErrors.cpp +++ b/security/manager/ssl/src/nsNSSErrors.cpp @@ -63,7 +63,7 @@ nsNSSErrors::getErrorMessageFromCode(PRErrorCode err, if (NS_SUCCEEDED(rv)) { returnedMessage.Append(defMsg); - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); } } @@ -71,7 +71,7 @@ nsNSSErrors::getErrorMessageFromCode(PRErrorCode err, { // no localized string available, use NSS' internal returnedMessage.AppendASCII(PR_ErrorToString(err, PR_LANGUAGE_EN)); - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); } if (nss_error_id_str) @@ -89,14 +89,14 @@ nsNSSErrors::getErrorMessageFromCode(PRErrorCode err, params, 1, formattedString); if (NS_SUCCEEDED(rv)) { - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); returnedMessage.Append(formattedString); - returnedMessage.Append(NS_LITERAL_STRING("\n")); + returnedMessage.Append('\n'); } else { - returnedMessage.Append(NS_LITERAL_STRING("(")); + returnedMessage.Append('('); returnedMessage.Append(idU); - returnedMessage.Append(NS_LITERAL_STRING(")")); + returnedMessage.Append(')'); } } diff --git a/storage/src/mozStorageBindingParams.cpp b/storage/src/mozStorageBindingParams.cpp index 15cccd31ff30..4eec10b58436 100644 --- a/storage/src/mozStorageBindingParams.cpp +++ b/storage/src/mozStorageBindingParams.cpp @@ -172,7 +172,7 @@ AsyncBindingParams::iterateOverNamedParameters(const nsACString &aName, if (oneIdx == 0) { nsAutoCString errMsg(aName); - errMsg.Append(NS_LITERAL_CSTRING(" is not a valid named parameter.")); + errMsg.AppendLiteral(" is not a valid named parameter."); closureThunk->err = new Error(SQLITE_RANGE, errMsg.get()); return PL_DHASH_STOP; } diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp index 3ed773de8da4..9f090fd66154 100644 --- a/toolkit/components/places/nsNavHistory.cpp +++ b/toolkit/components/places/nsNavHistory.cpp @@ -1774,10 +1774,10 @@ PlacesSQLQueryBuilder::SelectAsDay() mQueryString.Append(dayRange); if (i < HISTORY_DATE_CONT_NUM(daysOfHistory)) - mQueryString.Append(NS_LITERAL_CSTRING(" UNION ALL ")); + mQueryString.AppendLiteral(" UNION ALL "); } - mQueryString.Append(NS_LITERAL_CSTRING(") ")); // TOUTER END + mQueryString.AppendLiteral(") "); // TOUTER END return NS_OK; } @@ -2108,13 +2108,13 @@ nsNavHistory::ConstructQueryString( "{QUERY_OPTIONS} " ); - queryString.Append(NS_LITERAL_CSTRING("ORDER BY ")); + queryString.AppendLiteral("ORDER BY "); if (sortingMode == nsINavHistoryQueryOptions::SORT_BY_DATE_DESCENDING) - queryString.Append(NS_LITERAL_CSTRING("last_visit_date DESC ")); + queryString.AppendLiteral("last_visit_date DESC "); else - queryString.Append(NS_LITERAL_CSTRING("visit_count DESC ")); + queryString.AppendLiteral("visit_count DESC "); - queryString.Append(NS_LITERAL_CSTRING("LIMIT ")); + queryString.AppendLiteral("LIMIT "); queryString.AppendInt(aOptions->MaxResults()); nsAutoCString additionalQueryOptions; @@ -2562,7 +2562,7 @@ nsNavHistory::RemovePagesFromHost(const nsACString& aHost, bool aEntireDomain) NS_ASSERTION(revHostDot[revHostDot.Length() - 1] == '.', "Invalid rev. host"); nsAutoString revHostSlash(revHostDot); revHostSlash.Truncate(revHostSlash.Length() - 1); - revHostSlash.Append(NS_LITERAL_STRING("/")); + revHostSlash.Append('/'); // build condition string based on host selection type nsAutoCString conditionString; @@ -3663,11 +3663,11 @@ CreatePlacesPersistURN(nsNavHistoryQueryResultNode *aResultNode, aURN.Assign(NS_LITERAL_CSTRING("urn:places-persist:")); aURN.Append(uri); - aURN.Append(NS_LITERAL_CSTRING(",")); + aURN.Append(','); if (aValue != UNDEFINED_URN_VALUE) aURN.AppendInt(aValue); - aURN.Append(NS_LITERAL_CSTRING(",")); + aURN.Append(','); if (!aTitle.IsEmpty()) { nsAutoCString escapedTitle; bool success = NS_Escape(aTitle, escapedTitle, url_XAlphas); diff --git a/toolkit/components/places/nsNavHistoryQuery.cpp b/toolkit/components/places/nsNavHistoryQuery.cpp index 027d56d486d3..baac329ec42b 100644 --- a/toolkit/components/places/nsNavHistoryQuery.cpp +++ b/toolkit/components/places/nsNavHistoryQuery.cpp @@ -386,14 +386,14 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries, int32_t minVisits; if (NS_SUCCEEDED(query->GetMinVisits(&minVisits)) && minVisits >= 0) { AppendAmpersandIfNonempty(queryString); - queryString.Append(NS_LITERAL_CSTRING(QUERYKEY_MIN_VISITS "=")); + queryString.AppendLiteral(QUERYKEY_MIN_VISITS "="); AppendInt32(queryString, minVisits); } int32_t maxVisits; if (NS_SUCCEEDED(query->GetMaxVisits(&maxVisits)) && maxVisits >= 0) { AppendAmpersandIfNonempty(queryString); - queryString.Append(NS_LITERAL_CSTRING(QUERYKEY_MAX_VISITS "=")); + queryString.AppendLiteral(QUERYKEY_MAX_VISITS "="); AppendInt32(queryString, maxVisits); } @@ -418,7 +418,7 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries, NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY); AppendAmpersandIfNonempty(queryString); - queryString.Append(NS_LITERAL_CSTRING(QUERYKEY_DOMAIN "=")); + queryString.AppendLiteral(QUERYKEY_DOMAIN "="); queryString.Append(escapedDomain); } @@ -439,7 +439,7 @@ nsNavHistory::QueriesToQueryString(nsINavHistoryQuery **aQueries, NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY); AppendAmpersandIfNonempty(queryString); - queryString.Append(NS_LITERAL_CSTRING(QUERYKEY_URI "=")); + queryString.AppendLiteral(QUERYKEY_URI "="); queryString.Append(escaped); } diff --git a/toolkit/components/telemetry/Telemetry.cpp b/toolkit/components/telemetry/Telemetry.cpp index 3d8d3d5ff8ce..0996b3cbe1c3 100644 --- a/toolkit/components/telemetry/Telemetry.cpp +++ b/toolkit/components/telemetry/Telemetry.cpp @@ -1483,7 +1483,7 @@ AddonHistogramName(const nsACString &id, const nsACString &name, nsACString &ret) { ret.Append(id); - ret.Append(NS_LITERAL_CSTRING(":")); + ret.Append(':'); ret.Append(name); } diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index 435f2f819f3b..c715e7eaa426 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -1408,7 +1408,7 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel) // Add an additional .part to prevent the OS from running this file in the // default application. - tempLeafName.Append(NS_LITERAL_CSTRING(".part")); + tempLeafName.AppendLiteral(".part"); rv = mTempFile->Append(NS_ConvertUTF8toUTF16(tempLeafName)); // make this file unique!!! diff --git a/uriloader/exthandler/win/nsMIMEInfoWin.cpp b/uriloader/exthandler/win/nsMIMEInfoWin.cpp index a8a1031bdc36..eaafa1abecfc 100644 --- a/uriloader/exthandler/win/nsMIMEInfoWin.cpp +++ b/uriloader/exthandler/win/nsMIMEInfoWin.cpp @@ -793,7 +793,7 @@ nsMIMEInfoWin::GetPossibleLocalHandlers(nsIArray **_retval) if (NS_SUCCEEDED(rv)) { nsAutoString openWithListPath(NS_LITERAL_STRING("SystemFileAssociations\\")); openWithListPath.Append(perceivedType); // no period - openWithListPath.Append(NS_LITERAL_STRING("\\OpenWithList")); + openWithListPath.AppendLiteral("\\OpenWithList"); nsresult rv = appKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT, openWithListPath, diff --git a/uriloader/prefetch/nsOfflineCacheUpdate.cpp b/uriloader/prefetch/nsOfflineCacheUpdate.cpp index edbdb480a0bd..3d939103c2b5 100644 --- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp +++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp @@ -108,7 +108,7 @@ LogToConsole(const char * message, nsOfflineCacheUpdateItem * item = nullptr) nsAutoCString uriSpec; item->mURI->GetSpec(uriSpec); - messageUTF16.Append(NS_LITERAL_STRING(", URL=")); + messageUTF16.AppendLiteral(", URL="); messageUTF16.Append(NS_ConvertUTF8toUTF16(uriSpec)); } consoleService->LogStringMessage(messageUTF16.get()); diff --git a/widget/windows/JumpListItem.cpp b/widget/windows/JumpListItem.cpp index 7bf475394809..68bd9ea8795b 100644 --- a/widget/windows/JumpListItem.cpp +++ b/widget/windows/JumpListItem.cpp @@ -359,7 +359,7 @@ nsresult JumpListShortcut::GetShellLink(nsCOMPtr& item, handlerApp->GetParameterCount(&count); for (uint32_t idx = 0; idx < count; idx++) { if (idx > 0) - appArgs.Append(NS_LITERAL_STRING(" ")); + appArgs.Append(' '); nsAutoString param; rv = handlerApp->GetParameter(idx, param); if (NS_FAILED(rv)) diff --git a/xpcom/base/VisualEventTracer.cpp b/xpcom/base/VisualEventTracer.cpp index fe7b20c1f987..5f7a6909bd83 100644 --- a/xpcom/base/VisualEventTracer.cpp +++ b/xpcom/base/VisualEventTracer.cpp @@ -571,12 +571,12 @@ VisualEventTracerLog::GetJSONString(nsACString& aResult) while (batch) { if (batch != mBatch) { // This is not the first batch we are writting, add comma - buffer.Append(NS_LITERAL_CSTRING(",\n")); + buffer.AppendLiteral(",\n"); } - buffer.Append(NS_LITERAL_CSTRING("{\"thread\":\"")); + buffer.AppendLiteral("{\"thread\":\""); buffer.Append(batch->mThreadNameCopy); - buffer.Append(NS_LITERAL_CSTRING("\",\"log\":[\n")); + buffer.AppendLiteral("\",\"log\":[\n"); static const int kBufferSize = 2048; char buf[kBufferSize]; @@ -603,13 +603,13 @@ VisualEventTracerLog::GetJSONString(nsACString& aResult) buffer.Append(buf); } - buffer.Append(NS_LITERAL_CSTRING("]}\n")); + buffer.AppendLiteral("]}\n"); RecordBatch* next = batch->mNextBatch; batch = next; } - buffer.Append(NS_LITERAL_CSTRING("]}\n")); + buffer.AppendLiteral("]}\n"); aResult.Assign(buffer); return NS_OK; diff --git a/xpcom/base/nsMacUtilsImpl.cpp b/xpcom/base/nsMacUtilsImpl.cpp index 854b3a5178b8..ee8249f69780 100644 --- a/xpcom/base/nsMacUtilsImpl.cpp +++ b/xpcom/base/nsMacUtilsImpl.cpp @@ -61,28 +61,28 @@ nsMacUtilsImpl::GetArchString(nsAString& aArchString) // The order in the string must always be the same so // don't do this in the loop. if (foundPPC) { - mBinaryArchs.Append(NS_LITERAL_STRING("ppc")); + mBinaryArchs.AppendLiteral("ppc"); } if (foundX86) { if (!mBinaryArchs.IsEmpty()) { - mBinaryArchs.Append(NS_LITERAL_STRING("-")); + mBinaryArchs.Append('-'); } - mBinaryArchs.Append(NS_LITERAL_STRING("i386")); + mBinaryArchs.AppendLiteral("i386"); } if (foundPPC64) { if (!mBinaryArchs.IsEmpty()) { - mBinaryArchs.Append(NS_LITERAL_STRING("-")); + mBinaryArchs.Append('-'); } - mBinaryArchs.Append(NS_LITERAL_STRING("ppc64")); + mBinaryArchs.AppendLiteral("ppc64"); } if (foundX86_64) { if (!mBinaryArchs.IsEmpty()) { - mBinaryArchs.Append(NS_LITERAL_STRING("-")); + mBinaryArchs.Append('-'); } - mBinaryArchs.Append(NS_LITERAL_STRING("x86_64")); + mBinaryArchs.AppendLiteral("x86_64"); } aArchString.Assign(mBinaryArchs); diff --git a/xpcom/glue/nsThreadUtils.cpp b/xpcom/glue/nsThreadUtils.cpp index 930b53b773b8..8da4e9f8f907 100644 --- a/xpcom/glue/nsThreadUtils.cpp +++ b/xpcom/glue/nsThreadUtils.cpp @@ -323,7 +323,7 @@ nsThreadPoolNaming::SetThreadPoolName(const nsACString & aPoolName, nsIThread * aThread) { nsCString name(aPoolName); - name.Append(NS_LITERAL_CSTRING(" #")); + name.AppendLiteral(" #"); name.AppendInt(++mCounter, 10); // The counter is declared as volatile if (aThread) { diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index afd66e9e712a..70cab7c02490 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -530,11 +530,10 @@ nsLocalFile::AppendRelativeNativePath(const nsACString& aFragment) return NS_ERROR_FILE_UNRECOGNIZED_PATH; } - if (mPath.EqualsLiteral("/")) { - mPath.Append(aFragment); - } else { - mPath.Append(NS_LITERAL_CSTRING("/") + aFragment); + if (!mPath.EqualsLiteral("/")) { + mPath.Append('/'); } + mPath.Append(aFragment); return NS_OK; } diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index 1ff691b511be..c0d546070144 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -1454,7 +1454,8 @@ nsLocalFile::AppendInternal(const nsAFlatString& aNode, MakeDirty(); - mWorkingPath.Append(NS_LITERAL_STRING("\\") + aNode); + mWorkingPath.Append('\\'); + mWorkingPath.Append(node); return NS_OK; }