Bug 870698 - Part 2: Replace Append("") with AppendLiteral(""). r=erahm
authorChris Peterson <cpeterson@mozilla.com>
Sun, 03 Sep 2017 22:14:11 -0700
changeset 382613 c81b52d58ea4df9c46c0bf46a89e9f1dbb532fe5
parent 382612 947050c037c7422c718d8104b441655b2c72a13c
child 382614 3e20920201248575c1490dcd4ad33277c29b62a5
push id95361
push usercpeterson@mozilla.com
push dateSun, 24 Sep 2017 07:13:39 +0000
treeherdermozilla-inbound@39ac3246ab5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs870698
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 870698 - Part 2: Replace Append("") with AppendLiteral(""). r=erahm MozReview-Commit-ID: CrkIP4iHP1U
caps/ExpandedPrincipal.cpp
dom/media/eme/MediaKeySession.cpp
dom/media/gmp/GMPServiceChild.cpp
dom/media/gtest/TestMP4Demuxer.cpp
dom/media/systemservices/MediaParent.cpp
dom/workers/test/gtest/TestReadWrite.cpp
extensions/auth/nsHttpNegotiateAuth.cpp
extensions/cookie/nsPermissionManager.cpp
gfx/src/DriverCrashGuard.cpp
gfx/thebes/gfxUserFontSet.cpp
gfx/thebes/gfxUtils.cpp
image/imgLoader.cpp
ipc/glue/GeckoChildProcessHost.cpp
js/xpconnect/loader/mozJSSubScriptLoader.cpp
layout/forms/nsComboboxControlFrame.cpp
layout/painting/DisplayItemClipChain.cpp
layout/painting/DisplayItemScrollClip.cpp
layout/painting/nsDisplayList.cpp
layout/style/StyleRule.cpp
netwerk/cookie/CookieServiceChild.cpp
netwerk/cookie/nsCookieService.cpp
netwerk/ipc/NeckoCommon.h
netwerk/ipc/NeckoParent.cpp
netwerk/protocol/ftp/nsFtpConnectionThread.cpp
netwerk/protocol/http/Http2Stream.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
security/manager/ssl/tests/gtest/DataStorageTest.cpp
toolkit/components/downloads/ApplicationReputation.cpp
toolkit/components/terminator/nsTerminator.cpp
toolkit/components/url-classifier/LookupCache.cpp
toolkit/crashreporter/nsExceptionHandler.cpp
toolkit/system/osxproxy/ProxyUtils.mm
toolkit/system/windowsproxy/ProxyUtils.cpp
widget/ContentCache.cpp
widget/cocoa/GfxInfo.mm
widget/windows/GfxInfo.cpp
xpcom/base/LogModulePrefWatcher.cpp
xpcom/base/SystemMemoryReporter.cpp
--- a/caps/ExpandedPrincipal.cpp
+++ b/caps/ExpandedPrincipal.cpp
@@ -70,17 +70,17 @@ ExpandedPrincipal::Create(nsTArray<nsCOM
       origin.AppendLiteral(", ");
     }
 
     nsAutoCString subOrigin;
     DebugOnly<nsresult> rv = ep->mPrincipals.ElementAt(i)->GetOrigin(subOrigin);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
     origin.Append(subOrigin);
   }
-  origin.Append("]]");
+  origin.AppendLiteral("]]");
 
   ep->FinishInit(origin, aAttrs);
   return ep.forget();
 }
 
 NS_IMETHODIMP
 ExpandedPrincipal::GetDomain(nsIURI** aDomain)
 {
@@ -193,17 +193,17 @@ ExpandedPrincipal::GetScriptLocation(nsA
 
     nsAutoCString spec;
     nsresult rv =
       nsJSPrincipals::get(mPrincipals.ElementAt(i))->GetScriptLocation(spec);
     NS_ENSURE_SUCCESS(rv, rv);
 
     aStr.Append(spec);
   }
-  aStr.Append("]]");
+  aStr.AppendLiteral("]]");
   return NS_OK;
 }
 
 //////////////////////////////////////////
 // Methods implementing nsISerializable //
 //////////////////////////////////////////
 
 NS_IMETHODIMP
--- a/dom/media/eme/MediaKeySession.cpp
+++ b/dom/media/eme/MediaKeySession.cpp
@@ -149,17 +149,17 @@ MediaKeySession::UpdateKeyStatusMap()
     nsAutoCString message(
       nsPrintfCString("MediaKeySession[%p,'%s'] key statuses change {",
                       this, NS_ConvertUTF16toUTF8(mSessionId).get()));
     using IntegerType = typename std::underlying_type<MediaKeyStatus>::type;
     for (const CDMCaps::KeyStatus& status : keyStatuses) {
       message.Append(nsPrintfCString(" (%s,%s)", ToHexString(status.mId).get(),
         MediaKeyStatusValues::strings[static_cast<IntegerType>(status.mStatus)].value));
     }
-    message.Append(" }");
+    message.AppendLiteral(" }");
     // Use %s so we aren't exposing random strings to printf interpolation.
     EME_LOG("%s", message.get());
   }
 }
 
 MediaKeyStatusMap*
 MediaKeySession::KeyStatuses() const
 {
--- a/dom/media/gmp/GMPServiceChild.cpp
+++ b/dom/media/gmp/GMPServiceChild.cpp
@@ -221,32 +221,32 @@ struct GMPCapabilityAndVersion
       mCapabilities.AppendElement(Move(cap));
     }
   }
 
   nsCString ToString() const
   {
     nsCString s;
     s.Append(mName);
-    s.Append(" version=");
+    s.AppendLiteral(" version=");
     s.Append(mVersion);
-    s.Append(" tags=[");
+    s.AppendLiteral(" tags=[");
     nsCString tags;
     for (const GMPCapability& cap : mCapabilities) {
       if (!tags.IsEmpty()) {
-        tags.Append(" ");
+        tags.AppendLiteral(" ");
       }
       tags.Append(cap.mAPIName);
       for (const nsCString& tag : cap.mAPITags) {
-        tags.Append(":");
+        tags.AppendLiteral(":");
         tags.Append(tag);
       }
     }
     s.Append(tags);
-    s.Append("]");
+    s.AppendLiteral("]");
     return s;
   }
 
   nsCString mName;
   nsCString mVersion;
   nsTArray<GMPCapability> mCapabilities;
 };
 
@@ -254,17 +254,17 @@ StaticMutex sGMPCapabilitiesMutex;
 StaticAutoPtr<nsTArray<GMPCapabilityAndVersion>> sGMPCapabilities;
 
 static nsCString
 GMPCapabilitiesToString()
 {
   nsCString s;
   for (const GMPCapabilityAndVersion& gmp : *sGMPCapabilities) {
     if (!s.IsEmpty()) {
-      s.Append(", ");
+      s.AppendLiteral(", ");
     }
     s.Append(gmp.ToString());
   }
   return s;
 }
 
 /* static */
 void
--- a/dom/media/gtest/TestMP4Demuxer.cpp
+++ b/dom/media/gtest/TestMP4Demuxer.cpp
@@ -179,27 +179,27 @@ static nsCString
 ToCryptoString(const CryptoSample& aCrypto)
 {
   nsCString res;
   if (aCrypto.mValid) {
     res.AppendPrintf("%d %d ", aCrypto.mMode, aCrypto.mIVSize);
     for (size_t i = 0; i < aCrypto.mKeyId.Length(); i++) {
       res.AppendPrintf("%02x", aCrypto.mKeyId[i]);
     }
-    res.Append(" ");
+    res.AppendLiteral(" ");
     for (size_t i = 0; i < aCrypto.mIV.Length(); i++) {
       res.AppendPrintf("%02x", aCrypto.mIV[i]);
     }
     EXPECT_EQ(aCrypto.mPlainSizes.Length(), aCrypto.mEncryptedSizes.Length());
     for (size_t i = 0; i < aCrypto.mPlainSizes.Length(); i++) {
       res.AppendPrintf(" %d,%d", aCrypto.mPlainSizes[i],
                        aCrypto.mEncryptedSizes[i]);
     }
   } else {
-    res.Append("no crypto");
+    res.AppendLiteral("no crypto");
   }
   return res;
 }
 
 #ifndef XP_WIN // VC2013 doesn't support C++11 array initialization.
 
 TEST(MP4Demuxer, CENCFragVideo)
 {
--- a/dom/media/systemservices/MediaParent.cpp
+++ b/dom/media/systemservices/MediaParent.cpp
@@ -139,23 +139,23 @@ class OriginKeyStore : public nsISupport
 
           aString.AssignLiteral("[Expanded Principal [");
 
           for (uint32_t i = 0; i < info.whitelist().Length(); i++) {
             nsAutoCString str;
             PrincipalInfoToString(info.whitelist()[i], str);
 
             if (i != 0) {
-              aString.Append(", ");
+              aString.AppendLiteral(", ");
             }
 
             aString.Append(str);
           }
 
-          aString.Append("]]");
+          aString.AppendLiteral("]]");
           return;
         }
 
         default:
           MOZ_CRASH("Unknown PrincipalInfo type!");
       }
     }
 
--- a/dom/workers/test/gtest/TestReadWrite.cpp
+++ b/dom/workers/test/gtest/TestReadWrite.cpp
@@ -149,43 +149,43 @@ TEST(ServiceWorkerRegistrar, TestWrongVe
   const nsTArray<ServiceWorkerRegistrationData>& data = swr->TestGetData();
   ASSERT_EQ((uint32_t)0, data.Length()) << "No data should be found in an empty file";
 }
 
 TEST(ServiceWorkerRegistrar, TestReadData)
 {
   nsAutoCString buffer(SERVICEWORKERREGISTRAR_VERSION "\n");
 
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("scope 0\ncurrentWorkerURL 0\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("scope 0\ncurrentWorkerURL 0\n");
   buffer.Append(SERVICEWORKERREGISTRAR_TRUE "\n");
-  buffer.Append("cacheName 0\n");
+  buffer.AppendLiteral("cacheName 0\n");
   buffer.AppendInt(nsIServiceWorkerRegistrationInfo::UPDATE_VIA_CACHE_IMPORTS, 16);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(0);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(0);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(0);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("\n");
-  buffer.Append("scope 1\ncurrentWorkerURL 1\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral("scope 1\ncurrentWorkerURL 1\n");
   buffer.Append(SERVICEWORKERREGISTRAR_FALSE "\n");
-  buffer.Append("cacheName 1\n");
+  buffer.AppendLiteral("cacheName 1\n");
   buffer.AppendInt(nsIServiceWorkerRegistrationInfo::UPDATE_VIA_CACHE_ALL, 16);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   PRTime ts = PR_Now();
   buffer.AppendInt(ts);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(ts);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(ts);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
 
   RefPtr<ServiceWorkerRegistrarTest> swr = new ServiceWorkerRegistrarTest;
 
   nsresult rv = swr->TestReadData();
   ASSERT_EQ(NS_OK, rv) << "ReadData() should not fail";
@@ -328,23 +328,23 @@ TEST(ServiceWorkerRegistrar, TestWriteDa
     ASSERT_NE((int64_t)0, data[i].lastUpdateTime());
   }
 }
 
 TEST(ServiceWorkerRegistrar, TestVersion2Migration)
 {
   nsAutoCString buffer("2" "\n");
 
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("spec 0\nscope 0\nscriptSpec 0\ncurrentWorkerURL 0\nactiveCache 0\nwaitingCache 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("spec 0\nscope 0\nscriptSpec 0\ncurrentWorkerURL 0\nactiveCache 0\nwaitingCache 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("\n");
-  buffer.Append("spec 1\nscope 1\nscriptSpec 1\ncurrentWorkerURL 1\nactiveCache 1\nwaitingCache 1\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral("spec 1\nscope 1\nscriptSpec 1\ncurrentWorkerURL 1\nactiveCache 1\nwaitingCache 1\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
 
   RefPtr<ServiceWorkerRegistrarTest> swr = new ServiceWorkerRegistrarTest;
 
   nsresult rv = swr->TestReadData();
   ASSERT_EQ(NS_OK, rv) << "ReadData() should not fail";
 
@@ -389,23 +389,23 @@ TEST(ServiceWorkerRegistrar, TestVersion
   ASSERT_EQ((int64_t)0, data[1].currentWorkerActivatedTime());
   ASSERT_EQ((int64_t)0, data[1].lastUpdateTime());
 }
 
 TEST(ServiceWorkerRegistrar, TestVersion3Migration)
 {
   nsAutoCString buffer("3" "\n");
 
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("spec 0\nscope 0\ncurrentWorkerURL 0\ncacheName 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("spec 0\nscope 0\ncurrentWorkerURL 0\ncacheName 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("\n");
-  buffer.Append("spec 1\nscope 1\ncurrentWorkerURL 1\ncacheName 1\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral("spec 1\nscope 1\ncurrentWorkerURL 1\ncacheName 1\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
 
   RefPtr<ServiceWorkerRegistrarTest> swr = new ServiceWorkerRegistrarTest;
 
   nsresult rv = swr->TestReadData();
   ASSERT_EQ(NS_OK, rv) << "ReadData() should not fail";
 
@@ -450,23 +450,23 @@ TEST(ServiceWorkerRegistrar, TestVersion
   ASSERT_EQ((int64_t)0, data[1].currentWorkerActivatedTime());
   ASSERT_EQ((int64_t)0, data[1].lastUpdateTime());
 }
 
 TEST(ServiceWorkerRegistrar, TestVersion4Migration)
 {
   nsAutoCString buffer("4" "\n");
 
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("scope 0\ncurrentWorkerURL 0\ncacheName 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("scope 0\ncurrentWorkerURL 0\ncacheName 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("\n");
-  buffer.Append("scope 1\ncurrentWorkerURL 1\ncacheName 1\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral("scope 1\ncurrentWorkerURL 1\ncacheName 1\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
 
   RefPtr<ServiceWorkerRegistrarTest> swr = new ServiceWorkerRegistrarTest;
 
   nsresult rv = swr->TestReadData();
   ASSERT_EQ(NS_OK, rv) << "ReadData() should not fail";
 
@@ -513,27 +513,27 @@ TEST(ServiceWorkerRegistrar, TestVersion
   ASSERT_EQ((int64_t)0, data[1].currentWorkerActivatedTime());
   ASSERT_EQ((int64_t)0, data[1].lastUpdateTime());
 }
 
 TEST(ServiceWorkerRegistrar, TestVersion5Migration)
 {
   nsAutoCString buffer("5" "\n");
 
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("scope 0\ncurrentWorkerURL 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TRUE "\n");
-  buffer.Append("cacheName 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("scope 0\ncurrentWorkerURL 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TRUE "\n");
+  buffer.AppendLiteral("cacheName 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("\n");
-  buffer.Append("scope 1\ncurrentWorkerURL 1\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_FALSE "\n");
-  buffer.Append("cacheName 1\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral("scope 1\ncurrentWorkerURL 1\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_FALSE "\n");
+  buffer.AppendLiteral("cacheName 1\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
 
   RefPtr<ServiceWorkerRegistrarTest> swr = new ServiceWorkerRegistrarTest;
 
   nsresult rv = swr->TestReadData();
   ASSERT_EQ(NS_OK, rv) << "ReadData() should not fail";
 
@@ -578,31 +578,31 @@ TEST(ServiceWorkerRegistrar, TestVersion
   ASSERT_EQ((int64_t)0, data[1].currentWorkerActivatedTime());
   ASSERT_EQ((int64_t)0, data[1].lastUpdateTime());
 }
 
 TEST(ServiceWorkerRegistrar, TestVersion6Migration)
 {
   nsAutoCString buffer("6" "\n");
 
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("scope 0\ncurrentWorkerURL 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TRUE "\n");
-  buffer.Append("cacheName 0\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("scope 0\ncurrentWorkerURL 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TRUE "\n");
+  buffer.AppendLiteral("cacheName 0\n");
   buffer.AppendInt(nsIRequest::LOAD_NORMAL, 16);
-  buffer.Append("\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("\n");
-  buffer.Append("scope 1\ncurrentWorkerURL 1\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_FALSE "\n");
-  buffer.Append("cacheName 1\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral("scope 1\ncurrentWorkerURL 1\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_FALSE "\n");
+  buffer.AppendLiteral("cacheName 1\n");
   buffer.AppendInt(nsIRequest::VALIDATE_ALWAYS, 16);
-  buffer.Append("\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
 
   RefPtr<ServiceWorkerRegistrarTest> swr = new ServiceWorkerRegistrarTest;
 
   nsresult rv = swr->TestReadData();
   ASSERT_EQ(NS_OK, rv) << "ReadData() should not fail";
 
@@ -647,44 +647,44 @@ TEST(ServiceWorkerRegistrar, TestVersion
   ASSERT_EQ((int64_t)0, data[1].currentWorkerActivatedTime());
   ASSERT_EQ((int64_t)0, data[1].lastUpdateTime());
 }
 
 TEST(ServiceWorkerRegistrar, TestVersion7Migration)
 {
   nsAutoCString buffer("7" "\n");
 
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("scope 0\ncurrentWorkerURL 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TRUE "\n");
-  buffer.Append("cacheName 0\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("scope 0\ncurrentWorkerURL 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TRUE "\n");
+  buffer.AppendLiteral("cacheName 0\n");
   buffer.AppendInt(nsIRequest::LOAD_NORMAL, 16);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(0);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(0);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(0);
-  buffer.Append("\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("\n");
-  buffer.Append("scope 1\ncurrentWorkerURL 1\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_FALSE "\n");
-  buffer.Append("cacheName 1\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral("scope 1\ncurrentWorkerURL 1\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_FALSE "\n");
+  buffer.AppendLiteral("cacheName 1\n");
   buffer.AppendInt(nsIRequest::VALIDATE_ALWAYS, 16);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   PRTime ts = PR_Now();
   buffer.AppendInt(ts);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(ts);
-  buffer.Append("\n");
+  buffer.AppendLiteral("\n");
   buffer.AppendInt(ts);
-  buffer.Append("\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
 
   RefPtr<ServiceWorkerRegistrarTest> swr = new ServiceWorkerRegistrarTest;
 
   nsresult rv = swr->TestReadData();
   ASSERT_EQ(NS_OK, rv) << "ReadData() should not fail";
 
@@ -730,36 +730,36 @@ TEST(ServiceWorkerRegistrar, TestVersion
   ASSERT_EQ((int64_t)ts, data[1].lastUpdateTime());
 }
 
 TEST(ServiceWorkerRegistrar, TestDedupeRead)
 {
   nsAutoCString buffer("3" "\n");
 
   // unique entries
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("spec 0\nscope 0\ncurrentWorkerURL 0\ncacheName 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("spec 0\nscope 0\ncurrentWorkerURL 0\ncacheName 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("\n");
-  buffer.Append("spec 1\nscope 1\ncurrentWorkerURL 1\ncacheName 1\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral("spec 1\nscope 1\ncurrentWorkerURL 1\ncacheName 1\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   // dupe entries
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("spec 1\nscope 0\ncurrentWorkerURL 0\ncacheName 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("spec 1\nscope 0\ncurrentWorkerURL 0\ncacheName 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("^appId=123&inBrowser=1\n");
-  buffer.Append("spec 2\nscope 0\ncurrentWorkerURL 0\ncacheName 0\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("^appId=123&inBrowser=1\n");
+  buffer.AppendLiteral("spec 2\nscope 0\ncurrentWorkerURL 0\ncacheName 0\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
-  buffer.Append("\n");
-  buffer.Append("spec 3\nscope 1\ncurrentWorkerURL 1\ncacheName 1\n");
-  buffer.Append(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
+  buffer.AppendLiteral("\n");
+  buffer.AppendLiteral("spec 3\nscope 1\ncurrentWorkerURL 1\ncacheName 1\n");
+  buffer.AppendLiteral(SERVICEWORKERREGISTRAR_TERMINATOR "\n");
 
   ASSERT_TRUE(CreateFile(buffer)) << "CreateFile should not fail";
 
   RefPtr<ServiceWorkerRegistrarTest> swr = new ServiceWorkerRegistrarTest;
 
   nsresult rv = swr->TestReadData();
   ASSERT_EQ(NS_OK, rv) << "ReadData() should not fail";
 
--- a/extensions/auth/nsHttpNegotiateAuth.cpp
+++ b/extensions/auth/nsHttpNegotiateAuth.cpp
@@ -379,17 +379,17 @@ class GetNextTokenRunnable final : publi
 
         NS_IMETHODIMP ObtainCredentialsAndFlags(char **aCreds, uint32_t *aFlags)
         {
             nsresult rv;
 
             // Use negotiate service to call GenerateCredentials outside of main thread
             nsAutoCString contractId;
             contractId.AssignLiteral(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
-            contractId.Append("negotiate");
+            contractId.AppendLiteral("negotiate");
             nsCOMPtr<nsIHttpAuthenticator> authenticator =
               do_GetService(contractId.get(), &rv);
             NS_ENSURE_SUCCESS(rv, rv);
 
             nsISupports *sessionState = mSessionState;
             nsISupports *continuationState = mContinuationState;
             // The continuationState is for the sake of completeness propagated
             // to the caller (despite it is not changed in any GenerateCredentials
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -668,17 +668,17 @@ UpgradeHostToOriginAndInsert(const nsACS
     nsCOMPtr<nsIPrincipal> principal;
     nsAutoCString origin;
 
     // If this is an ipv6 URI, we need to surround it in '[', ']' before trying to
     // parse it as a URI.
     if (aHost.FindChar(':') != -1) {
       hostSegment.AssignLiteral("[");
       hostSegment.Append(aHost);
-      hostSegment.Append("]");
+      hostSegment.AppendLiteral("]");
     } else {
       hostSegment.Assign(aHost);
     }
 
     // http:// URI default
     rv = NS_NewURI(getter_AddRefs(uri), NS_LITERAL_CSTRING("http://") + hostSegment);
     NS_ENSURE_SUCCESS(rv, rv);
 
--- a/gfx/src/DriverCrashGuard.cpp
+++ b/gfx/src/DriverCrashGuard.cpp
@@ -186,17 +186,17 @@ DriverCrashGuard::Crashed()
 
 nsCOMPtr<nsIFile>
 DriverCrashGuard::GetGuardFile()
 {
   MOZ_ASSERT(XRE_IsParentProcess());
 
   nsCString filename;
   filename.Assign(sCrashGuardNames[size_t(mType)]);
-  filename.Append(".guard");
+  filename.AppendLiteral(".guard");
 
   nsCOMPtr<nsIFile> file;
   NS_GetSpecialDirectory(NS_APP_USER_PROFILE_LOCAL_50_DIR, getter_AddRefs(file));
   if (!file) {
     return nullptr;
   }
   if (!NS_SUCCEEDED(file->AppendNative(filename))) {
     return nullptr;
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -1448,17 +1448,17 @@ gfxUserFontSet::UserFontCache::Entry::Re
             nsCString spec = mURI->GetSpecOrDefault();
             spec.ReplaceChar('/', '\\');
             // Some fonts are loaded using horrendously-long data: URIs;
             // truncate those before reporting them.
             bool isData;
             if (NS_SUCCEEDED(mURI->get()->SchemeIs("data", &isData)) && isData &&
                 spec.Length() > 255) {
                 spec.Truncate(252);
-                spec.Append("...");
+                spec.AppendLiteral("...");
             }
             path.AppendPrintf(", url=%s", spec.get());
         }
         if (mPrincipal) {
             nsCOMPtr<nsIURI> uri;
             mPrincipal->get()->GetURI(getter_AddRefs(uri));
             if (uri) {
                 nsCString spec = uri->GetSpecOrDefault();
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -1055,17 +1055,17 @@ EncodeSourceSurfaceInternal(SourceSurfac
 
   // base 64, result will be null-terminated
   nsCString encodedImg;
   rv = Base64Encode(Substring(imgData.begin(), imgSize), encodedImg);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCString string("data:");
   string.Append(aMimeType);
-  string.Append(";base64,");
+  string.AppendLiteral(";base64,");
   string.Append(encodedImg);
 
   if (aFile) {
 #ifdef ANDROID
     if (aFile == stdout || aFile == stderr) {
       // ADB logcat cuts off long strings so we will break it down
       const char* cStr = string.BeginReading();
       size_t len = strlen(cStr);
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -249,115 +249,119 @@ private:
                           const ImageMemoryCounter& aCounter)
   {
     nsAutoCString pathPrefix(NS_LITERAL_CSTRING("explicit/"));
     pathPrefix.Append(aPathPrefix);
     pathPrefix.Append(aCounter.Type() == imgIContainer::TYPE_RASTER
                         ? "/raster/"
                         : "/vector/");
     pathPrefix.Append(aCounter.IsUsed() ? "used/" : "unused/");
-    pathPrefix.Append("image(");
+    pathPrefix.AppendLiteral("image(");
     pathPrefix.AppendInt(aCounter.IntrinsicSize().width);
-    pathPrefix.Append("x");
+    pathPrefix.AppendLiteral("x");
     pathPrefix.AppendInt(aCounter.IntrinsicSize().height);
-    pathPrefix.Append(", ");
+    pathPrefix.AppendLiteral(", ");
 
     if (aCounter.URI().IsEmpty()) {
-      pathPrefix.Append("<unknown URI>");
+      pathPrefix.AppendLiteral("<unknown URI>");
     } else {
       pathPrefix.Append(aCounter.URI());
     }
 
-    pathPrefix.Append(")/");
+    pathPrefix.AppendLiteral(")/");
 
     ReportSurfaces(aHandleReport, aData, pathPrefix, aCounter);
 
     ReportSourceValue(aHandleReport, aData, pathPrefix, aCounter.Values());
   }
 
   static void ReportSurfaces(nsIHandleReportCallback* aHandleReport,
                              nsISupports* aData,
                              const nsACString& aPathPrefix,
                              const ImageMemoryCounter& aCounter)
   {
     for (const SurfaceMemoryCounter& counter : aCounter.Surfaces()) {
       nsAutoCString surfacePathPrefix(aPathPrefix);
-      surfacePathPrefix.Append(counter.IsLocked() ? "locked/" : "unlocked/");
+      if (counter.IsLocked()) {
+        surfacePathPrefix.AppendLiteral("locked/");
+      } else {
+        surfacePathPrefix.AppendLiteral("unlocked/");
+      }
       if (counter.IsFactor2()) {
-        surfacePathPrefix.Append("factor2/");
+        surfacePathPrefix.AppendLiteral("factor2/");
       }
       if (counter.CannotSubstitute()) {
-        surfacePathPrefix.Append("cannot_substitute/");
+        surfacePathPrefix.AppendLiteral("cannot_substitute/");
       }
-      surfacePathPrefix.Append("surface(");
+      surfacePathPrefix.AppendLiteral("surface(");
       surfacePathPrefix.AppendInt(counter.Key().Size().width);
-      surfacePathPrefix.Append("x");
+      surfacePathPrefix.AppendLiteral("x");
       surfacePathPrefix.AppendInt(counter.Key().Size().height);
 
       if (counter.Values().SharedHandles() > 0) {
-        surfacePathPrefix.Append(", shared:");
+        surfacePathPrefix.AppendLiteral(", shared:");
         surfacePathPrefix.AppendInt(uint32_t(counter.Values().SharedHandles()));
       }
 
       if (counter.Type() == SurfaceMemoryCounterType::NORMAL) {
         PlaybackType playback = counter.Key().Playback();
         surfacePathPrefix.Append(playback == PlaybackType::eAnimated
                                  ? " (animation)"
                                  : "");
 
         if (counter.Key().Flags() != DefaultSurfaceFlags()) {
-          surfacePathPrefix.Append(", flags:");
+          surfacePathPrefix.AppendLiteral(", flags:");
           surfacePathPrefix.AppendInt(uint32_t(counter.Key().Flags()),
                                       /* aRadix = */ 16);
         }
       } else if (counter.Type() == SurfaceMemoryCounterType::COMPOSITING) {
-        surfacePathPrefix.Append(", compositing frame");
+        surfacePathPrefix.AppendLiteral(", compositing frame");
       } else if (counter.Type() == SurfaceMemoryCounterType::COMPOSITING_PREV) {
-        surfacePathPrefix.Append(", compositing prev frame");
+        surfacePathPrefix.AppendLiteral(", compositing prev frame");
       } else {
         MOZ_ASSERT_UNREACHABLE("Unknown counter type");
       }
 
-      surfacePathPrefix.Append(")/");
+      surfacePathPrefix.AppendLiteral(")/");
 
       ReportValues(aHandleReport, aData, surfacePathPrefix, counter.Values());
     }
   }
 
   static void ReportTotal(nsIHandleReportCallback* aHandleReport,
                           nsISupports* aData,
                           bool aExplicit,
                           const char* aPathPrefix,
                           const char* aPathInfix,
                           const MemoryTotal& aTotal)
   {
     nsAutoCString pathPrefix;
     if (aExplicit) {
-      pathPrefix.Append("explicit/");
+      pathPrefix.AppendLiteral("explicit/");
     }
     pathPrefix.Append(aPathPrefix);
 
     nsAutoCString rasterUsedPrefix(pathPrefix);
-    rasterUsedPrefix.Append("/raster/used/");
+    rasterUsedPrefix.AppendLiteral("/raster/used/");
     rasterUsedPrefix.Append(aPathInfix);
     ReportValues(aHandleReport, aData, rasterUsedPrefix, aTotal.UsedRaster());
 
     nsAutoCString rasterUnusedPrefix(pathPrefix);
-    rasterUnusedPrefix.Append("/raster/unused/");
+    rasterUnusedPrefix.AppendLiteral("/raster/unused/");
     rasterUnusedPrefix.Append(aPathInfix);
     ReportValues(aHandleReport, aData, rasterUnusedPrefix,
                  aTotal.UnusedRaster());
 
     nsAutoCString vectorUsedPrefix(pathPrefix);
-    vectorUsedPrefix.Append("/vector/used/");
+    vectorUsedPrefix.AppendLiteral("/vector/used/");
     vectorUsedPrefix.Append(aPathInfix);
     ReportValues(aHandleReport, aData, vectorUsedPrefix, aTotal.UsedVector());
 
     nsAutoCString vectorUnusedPrefix(pathPrefix);
-    vectorUnusedPrefix.Append("/vector/unused/");
+    vectorUnusedPrefix.AppendLiteral("/vector/unused/");
     vectorUnusedPrefix.Append(aPathInfix);
     ReportValues(aHandleReport, aData, vectorUnusedPrefix,
                  aTotal.UnusedVector());
   }
 
   static void ReportValues(nsIHandleReportCallback* aHandleReport,
                            nsISupports* aData,
                            const nsACString& aPathPrefix,
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -759,17 +759,17 @@ GeckoChildProcessHost::PerformAsyncLaunc
     nsCString path;
     NS_CopyUnicodeToNative(nsDependentString(gGREBinPath), path);
 #  if defined(OS_LINUX) || defined(OS_BSD)
     const char *ld_library_path = PR_GetEnv("LD_LIBRARY_PATH");
     nsCString new_ld_lib_path(path.get());
 
 #   if (MOZ_WIDGET_GTK == 3)
     if (mProcessType == GeckoProcessType_Plugin) {
-      new_ld_lib_path.Append("/gtk2:");
+      new_ld_lib_path.AppendLiteral("/gtk2:");
       new_ld_lib_path.Append(path.get());
     }
 #   endif // (MOZ_WIDGET_GTK == 3)
     if (ld_library_path && *ld_library_path) {
       new_ld_lib_path.Append(':');
       new_ld_lib_path.Append(ld_library_path);
     }
     newEnvVars["LD_LIBRARY_PATH"] = new_ld_lib_path.get();
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -124,17 +124,17 @@ ReportError(JSContext* cx, const char* o
     }
 
     nsAutoCString spec;
     nsresult rv = uri->GetSpec(spec);
     if (NS_FAILED(rv))
         spec.AssignLiteral("(unknown)");
 
     nsAutoCString msg(origMsg);
-    msg.Append(": ");
+    msg.AppendLiteral(": ");
     msg.Append(spec);
     ReportError(cx, msg);
 }
 
 static bool
 PrepareScript(nsIURI* uri,
               JSContext* cx,
               HandleObject targetObj,
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -1696,26 +1696,25 @@ NS_IMETHODIMP
 nsComboboxControlFrame::GenerateStateKey(nsIContent* aContent,
                                         nsIDocument* aDocument,
                                         nsACString& aKey)
 {
   nsresult rv = nsContentUtils::GenerateStateKey(aContent, aDocument, aKey);
   if (NS_FAILED(rv) || aKey.IsEmpty()) {
     return rv;
   }
-  aKey.Append("CCF");
+  aKey.AppendLiteral("CCF");
   return NS_OK;
 }
 
 // Fennec uses a custom combobox built-in widget.
 //
 
 /* static */
 bool
 nsComboboxControlFrame::ToolkitHasNativePopup()
 {
 #ifdef MOZ_USE_NATIVE_POPUP_WINDOWS
   return true;
 #else
   return false;
 #endif /* MOZ_USE_NATIVE_POPUP_WINDOWS */
 }
-
--- a/layout/painting/DisplayItemClipChain.cpp
+++ b/layout/painting/DisplayItemClipChain.cpp
@@ -39,17 +39,17 @@ DisplayItemClipChain::ToString(const Dis
   for (auto* sc = aClipChain; sc; sc = sc->mParent) {
     if (sc->mASR) {
       str.AppendPrintf("<%s> [0x%p]", sc->mClip.ToString().get(), sc->mASR->mScrollableFrame);
 
     } else {
       str.AppendPrintf("<%s> [root asr]", sc->mClip.ToString().get());
     }
     if (sc->mParent) {
-      str.Append(", ");
+      str.AppendLiteral(", ");
     }
   }
   return str;
 }
 
 bool
 DisplayItemClipChain::HasRoundedCorners() const
 {
--- a/layout/painting/DisplayItemScrollClip.cpp
+++ b/layout/painting/DisplayItemScrollClip.cpp
@@ -43,15 +43,15 @@ DisplayItemScrollClip::HasRoundedCorners
 DisplayItemScrollClip::ToString(const DisplayItemScrollClip* aScrollClip)
 {
   nsAutoCString str;
   for (const DisplayItemScrollClip* scrollClip = aScrollClip;
        scrollClip; scrollClip = scrollClip->mParent) {
     str.AppendPrintf("<%s>%s", scrollClip->mClip ? scrollClip->mClip->ToString().get() : "null",
                      scrollClip->mIsAsyncScrollable ? " [async-scrollable]" : "");
     if (scrollClip->mParent) {
-      str.Append(", ");
+      str.AppendLiteral(", ");
     }
   }
   return str;
 }
 
 } // namespace mozilla
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -153,17 +153,17 @@ ActiveScrolledRoot::IsAncestor(const Act
 
 /* static */ nsCString
 ActiveScrolledRoot::ToString(const ActiveScrolledRoot* aActiveScrolledRoot)
 {
   nsAutoCString str;
   for (auto* asr = aActiveScrolledRoot; asr; asr = asr->mParent) {
     str.AppendPrintf("<0x%p>", asr->mScrollableFrame);
     if (asr->mParent) {
-      str.Append(", ");
+      str.AppendLiteral(", ");
     }
   }
   return str;
 }
 
 static inline CSSAngle
 MakeCSSAngle(const nsCSSValue& aValue)
 {
--- a/layout/style/StyleRule.cpp
+++ b/layout/style/StyleRule.cpp
@@ -1338,21 +1338,21 @@ StyleRule::List(FILE* out, int32_t aInde
     str.AppendLiteral("{ ");
     mDeclaration->ToString(buffer);
     AppendUTF16toUTF8(buffer, str);
     str.Append('}');
     CSSStyleSheet* sheet = GetStyleSheet();
     if (sheet) {
       nsIURI* uri = sheet->GetSheetURI();
       if (uri) {
-        str.Append(" /* ");
+        str.AppendLiteral(" /* ");
         str.Append(uri->GetSpecOrDefault());
         str.Append(':');
         str.AppendInt(mLineNumber);
-        str.Append(" */");
+        str.AppendLiteral(" */");
       }
     }
   }
   else {
     str.AppendLiteral("{ null declaration }");
   }
   str.Append('\n');
   fprintf_stderr(out, "%s", str.get());
--- a/netwerk/cookie/CookieServiceChild.cpp
+++ b/netwerk/cookie/CookieServiceChild.cpp
@@ -300,21 +300,21 @@ CookieServiceChild::GetCookieStringFromC
 
     // check if the cookie has expired
     if (cookie->Expiry() <= currentTime) {
       continue;
     }
 
     if (!cookie->Name().IsEmpty() || !cookie->Value().IsEmpty()) {
       if (!aCookieString.IsEmpty()) {
-        aCookieString.Append("; ");
+        aCookieString.AppendLiteral("; ");
       }
       if (!cookie->Name().IsEmpty()) {
         aCookieString.Append(cookie->Name().get());
-        aCookieString.Append("=");
+        aCookieString.AppendLiteral("=");
         aCookieString.Append(cookie->Value().get());
       } else {
         aCookieString.Append(cookie->Value().get());
       }
     }
   }
 }
 
@@ -611,9 +611,8 @@ CookieServiceChild::SetCookieStringFromH
 NS_IMETHODIMP
 CookieServiceChild::RunInTransaction(nsICookieTransactionCallback* aCallback)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 } // namespace net
 } // namespace mozilla
-
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -1539,17 +1539,17 @@ nsresult
 nsCookieService::CreateTableWorker(const char* aName)
 {
   // Create the table.
   // We default originAttributes to empty string: this is so if users revert to
   // an older Firefox version that doesn't know about this field, any cookies
   // set will still work once they upgrade back.
   nsAutoCString command("CREATE TABLE ");
   command.Append(aName);
-  command.Append(" ("
+  command.AppendLiteral(" ("
       "id INTEGER PRIMARY KEY, "
       "baseDomain TEXT, "
       "originAttributes TEXT NOT NULL DEFAULT '', "
       "name TEXT, "
       "value TEXT, "
       "host TEXT, "
       "path TEXT, "
       "expiry INTEGER, "
--- a/netwerk/ipc/NeckoCommon.h
+++ b/netwerk/ipc/NeckoCommon.h
@@ -30,22 +30,22 @@ class TabChild;
 
 #define NECKO_MAYBE_ABORT(msg)                                                 \
   do {                                                                         \
     bool abort = NECKO_ERRORS_ARE_FATAL_DEFAULT;                               \
     const char *e = PR_GetEnv("NECKO_ERRORS_ARE_FATAL");                       \
     if (e)                                                                     \
       abort = (*e == '0') ? false : true;                                      \
     if (abort) {                                                               \
-      msg.Append(" (set NECKO_ERRORS_ARE_FATAL=0 in your environment to "      \
-                      "convert this error into a warning.)");                  \
+      msg.AppendLiteral(" (set NECKO_ERRORS_ARE_FATAL=0 in your environment "  \
+                        "to convert this error into a warning.)");             \
       NS_RUNTIMEABORT(msg.get());                                              \
     } else {                                                                   \
-      msg.Append(" (set NECKO_ERRORS_ARE_FATAL=1 in your environment to "      \
-                      "convert this warning into a fatal error.)");            \
+      msg.AppendLiteral(" (set NECKO_ERRORS_ARE_FATAL=1 in your environment "  \
+                        "to convert this warning into a fatal error.)");       \
       NS_WARNING(msg.get());                                                   \
     }                                                                          \
   } while (0)
 
 #define DROP_DEAD()                                                            \
   do {                                                                         \
     nsPrintfCString msg("NECKO ERROR: '%s' UNIMPLEMENTED",                     \
                         __FUNCTION__);                                         \
@@ -117,14 +117,12 @@ MissingRequiredTabChild(mozilla::dom::Ta
       printf_stderr("WARNING: child tried to open %s IPDL channel w/o "
                     "security info\n", context);
       return true;
     }
   }
   return false;
 }
 
-
 } // namespace net
 } // namespace mozilla
 
 #endif // mozilla_net_NeckoCommon_h
-
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -188,25 +188,25 @@ NeckoParent::GetValidatedOriginAttribute
   aSerialized.mOriginAttributes.CreateAnonymizedSuffix(serializedSuffix);
 
   nsAutoCString debugString;
   for (uint32_t i = 0; i < contextArray.Length(); i++) {
     const TabContext& tabContext = contextArray[i];
 
     if (!ChromeUtils::IsOriginAttributesEqual(aSerialized.mOriginAttributes,
                                               tabContext.OriginAttributesRef())) {
-      debugString.Append("(");
+      debugString.AppendLiteral("(");
       debugString.Append(serializedSuffix);
-      debugString.Append(",");
+      debugString.AppendLiteral(",");
 
       nsAutoCString tabSuffix;
       tabContext.OriginAttributesRef().CreateAnonymizedSuffix(tabSuffix);
       debugString.Append(tabSuffix);
 
-      debugString.Append(")");
+      debugString.AppendLiteral(")");
       continue;
     }
 
     aAttrs = aSerialized.mOriginAttributes;
     return nullptr;
   }
 
   // This may be a ServiceWorker: when a push notification is received, FF wakes
@@ -219,17 +219,17 @@ NeckoParent::GetValidatedOriginAttribute
         swm->MayHaveActiveServiceWorkerInstance(static_cast<ContentParent*>(aContent),
                                                 aRequestingPrincipal)) {
       aAttrs = aSerialized.mOriginAttributes;
       return nullptr;
     }
   }
 
   nsAutoCString errorString;
-  errorString.Append("GetValidatedOriginAttributes | App does not have permission -");
+  errorString.AppendLiteral("GetValidatedOriginAttributes | App does not have permission -");
   errorString.Append(debugString);
 
   // Leak the buffer on the heap to make sure that it lives long enough, as
   // MOZ_CRASH_ANNOTATE expects the pointer passed to it to live to the end of
   // the program.
   char * error = strdup(errorString.BeginReading());
   CrashWithReason(error);
   return "App does not have permission";
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -741,17 +741,18 @@ nsFtpState::S_user() {
                 return NS_ERROR_FAILURE;
 
             mUsername = info->User();
             mPassword = info->Password();
         }
         // XXX Is UTF-8 the best choice?
         AppendUTF16toUTF8(mUsername, usernameStr);
     }
-    usernameStr.Append(CRLF);
+
+    usernameStr.AppendLiteral(CRLF);
 
     return SendFTPCommand(usernameStr);
 }
 
 FTP_STATE
 nsFtpState::R_user() {
     mReconnectAndLoginAgain = false;
     if (mResponseCode/100 == 3) {
@@ -833,17 +834,18 @@ nsFtpState::S_pass() {
             if (NS_FAILED(rv) || !retval)
                 return NS_ERROR_FAILURE;
 
             mPassword = info->Password();
         }
         // XXX Is UTF-8 the best choice?
         AppendUTF16toUTF8(mPassword, passwordStr);
     }
-    passwordStr.Append(CRLF);
+
+    passwordStr.AppendLiteral(CRLF);
 
     return SendFTPCommand(passwordStr);
 }
 
 FTP_STATE
 nsFtpState::R_pass() {
     if (mResponseCode/100 == 3) {
         // send account info
@@ -1011,17 +1013,17 @@ nsFtpState::S_cwd() {
     nsAutoCString cwdStr;
     if (mAction != PUT)
         cwdStr = mPath;
     if (cwdStr.IsEmpty() || cwdStr.First() != '/')
         cwdStr.Insert(mPwd,0);
     if (mServerType == FTP_VMS_TYPE)
         ConvertDirspecToVMS(cwdStr);
     cwdStr.Insert("CWD ",0);
-    cwdStr.Append(CRLF);
+    cwdStr.AppendLiteral(CRLF);
 
     return SendFTPCommand(cwdStr);
 }
 
 FTP_STATE
 nsFtpState::R_cwd() {
     if (mResponseCode/100 == 2) {
         if (mAction == PUT)
@@ -1036,17 +1038,17 @@ nsFtpState::R_cwd() {
 nsresult
 nsFtpState::S_size() {
     nsAutoCString sizeBuf(mPath);
     if (sizeBuf.IsEmpty() || sizeBuf.First() != '/')
         sizeBuf.Insert(mPwd,0);
     if (mServerType == FTP_VMS_TYPE)
         ConvertFilespecToVMS(sizeBuf);
     sizeBuf.Insert("SIZE ",0);
-    sizeBuf.Append(CRLF);
+    sizeBuf.AppendLiteral(CRLF);
 
     return SendFTPCommand(sizeBuf);
 }
 
 FTP_STATE
 nsFtpState::R_size() {
     if (mResponseCode/100 == 2) {
         PR_sscanf(mResponseMsg.get() + 4, "%llu", &mFileSize);
@@ -1060,17 +1062,17 @@ nsFtpState::R_size() {
 nsresult
 nsFtpState::S_mdtm() {
     nsAutoCString mdtmBuf(mPath);
     if (mdtmBuf.IsEmpty() || mdtmBuf.First() != '/')
         mdtmBuf.Insert(mPwd,0);
     if (mServerType == FTP_VMS_TYPE)
         ConvertFilespecToVMS(mdtmBuf);
     mdtmBuf.Insert("MDTM ",0);
-    mdtmBuf.Append(CRLF);
+    mdtmBuf.AppendLiteral(CRLF);
 
     return SendFTPCommand(mdtmBuf);
 }
 
 FTP_STATE
 nsFtpState::R_mdtm() {
     if (mResponseCode == 213) {
         mResponseMsg.Cut(0,4);
@@ -1203,17 +1205,18 @@ nsFtpState::R_list() {
 nsresult
 nsFtpState::S_retr() {
     nsAutoCString retrStr(mPath);
     if (retrStr.IsEmpty() || retrStr.First() != '/')
         retrStr.Insert(mPwd,0);
     if (mServerType == FTP_VMS_TYPE)
         ConvertFilespecToVMS(retrStr);
     retrStr.Insert("RETR ",0);
-    retrStr.Append(CRLF);
+    retrStr.AppendLiteral(CRLF);
+
     return SendFTPCommand(retrStr);
 }
 
 FTP_STATE
 nsFtpState::R_retr() {
     if (mResponseCode/100 == 2) {
         //(DONE)
         mNextState = FTP_COMPLETE;
@@ -1234,24 +1237,22 @@ nsFtpState::R_retr() {
     if (mResponseCode/100 == 5) {
         mRETRFailed = true;
         return FTP_S_PASV;
     }
 
     return FTP_S_CWD;
 }
 
-
 nsresult
 nsFtpState::S_rest() {
-
     nsAutoCString restString("REST ");
     // The int64_t cast is needed to avoid ambiguity
     restString.AppendInt(int64_t(mChannel->StartPos()), 10);
-    restString.Append(CRLF);
+    restString.AppendLiteral(CRLF);
 
     return SendFTPCommand(restString);
 }
 
 FTP_STATE
 nsFtpState::R_rest() {
     if (mResponseCode/100 == 4) {
         // If REST fails, then we can't resume
@@ -1283,17 +1284,17 @@ nsFtpState::S_stor() {
     if (storStr.First() == '/')
         storStr.Cut(0,1);
 
     if (mServerType == FTP_VMS_TYPE)
         ConvertFilespecToVMS(storStr);
 
     NS_UnescapeURL(storStr);
     storStr.Insert("STOR ",0);
-    storStr.Append(CRLF);
+    storStr.AppendLiteral(CRLF);
 
     return SendFTPCommand(storStr);
 }
 
 FTP_STATE
 nsFtpState::R_stor() {
     if (mResponseCode/100 == 2) {
         //(DONE)
--- a/netwerk/protocol/http/Http2Stream.cpp
+++ b/netwerk/protocol/http/Http2Stream.cpp
@@ -1070,18 +1070,18 @@ Http2Stream::ConvertResponseHeaders(Http
     uint32_t ratio =
       aHeadersIn.Length() * 100 / aHeadersOut.Length();
     Telemetry::Accumulate(Telemetry::SPDY_SYN_REPLY_RATIO, ratio);
   }
 
   // The decoding went ok. Now we can customize and clean up.
 
   aHeadersIn.Truncate();
-  aHeadersOut.Append("X-Firefox-Spdy: h2");
-  aHeadersOut.Append("\r\n\r\n");
+  aHeadersOut.AppendLiteral("X-Firefox-Spdy: h2");
+  aHeadersOut.AppendLiteral("\r\n\r\n");
   LOG (("decoded response headers are:\n%s", aHeadersOut.BeginReading()));
   if (mIsTunnel && !mPlainTextTunnel) {
     aHeadersOut.Truncate();
     LOG(("Http2Stream::ConvertHeaders %p 0x%X headers removed for tunnel\n",
          this, mStreamID));
   }
   return NS_OK;
 }
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -1944,17 +1944,17 @@ nsHttpTransaction::CheckForStickyAuthSch
   }
 
   Tokenizer p(auth);
   nsAutoCString schema;
   while (p.ReadWord(schema)) {
       ToLowerCase(schema);
 
       nsAutoCString contractid;
-      contractid.Assign(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
+      contractid.AssignLiteral(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
       contractid.Append(schema);
 
       // using a new instance because of thread safety of auth modules refcnt
       nsCOMPtr<nsIHttpAuthenticator> authenticator(do_CreateInstance(contractid.get()));
       if (authenticator) {
           uint32_t flags;
           nsresult rv = authenticator->GetAuthFlags(&flags);
           if (NS_SUCCEEDED(rv) && (flags & nsIHttpAuthenticator::CONNECTION_BASED)) {
--- a/security/manager/ssl/tests/gtest/DataStorageTest.cpp
+++ b/security/manager/ssl/tests/gtest/DataStorageTest.cpp
@@ -125,32 +125,32 @@ TEST_F(psm_DataStorageTest, InputValidat
   nsCString longKey("a");
   for (int i = 0; i < 8; i++) {
     longKey.Append(longKey);
   }
   // A key of length 256 will work
   EXPECT_EQ(NS_OK, storage->Put(longKey, testValue, DataStorage_Persistent));
   result = storage->Get(longKey, DataStorage_Persistent);
   EXPECT_STREQ("value", result.get());
-  longKey.Append("a");
+  longKey.AppendLiteral("a");
   // A key longer than that will not work
   EXPECT_EQ(NS_ERROR_INVALID_ARG,
             storage->Put(longKey, testValue, DataStorage_Persistent));
   result = storage->Get(longKey, DataStorage_Persistent);
   EXPECT_TRUE(result.IsEmpty());
 
   nsCString longValue("a");
   for (int i = 0; i < 10; i++) {
     longValue.Append(longValue);
   }
   // A value of length 1024 will work
   EXPECT_EQ(NS_OK, storage->Put(testKey, longValue, DataStorage_Persistent));
   result = storage->Get(testKey, DataStorage_Persistent);
   EXPECT_STREQ(longValue.get(), result.get());
-  longValue.Append("a");
+  longValue.AppendLiteral("a");
   // A value longer than that will not work
   storage->Remove(testKey, DataStorage_Persistent);
   EXPECT_EQ(NS_ERROR_INVALID_ARG,
             storage->Put(testKey, longValue, DataStorage_Persistent));
   result = storage->Get(testKey, DataStorage_Persistent);
   EXPECT_TRUE(result.IsEmpty());
 }
 
--- a/toolkit/components/downloads/ApplicationReputation.cpp
+++ b/toolkit/components/downloads/ApplicationReputation.cpp
@@ -1068,17 +1068,17 @@ PendingLookup::GetStrippedSpec(nsIURI* a
          PromiseFlatCString(escaped).get(), this));
     return rv;
   }
 
   nsCString temp;
   rv = url->GetHostPort(temp);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  escaped.Append("://");
+  escaped.AppendLiteral("://");
   escaped.Append(temp);
 
   rv = url->GetFilePath(temp);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // nsIUrl.filePath starts with '/'
   escaped.Append(temp);
 
--- a/toolkit/components/terminator/nsTerminator.cpp
+++ b/toolkit/components/terminator/nsTerminator.cpp
@@ -510,17 +510,17 @@ nsTerminator::UpdateTelemetry()
   telemetryData->AppendLiteral("{");
   size_t fields = 0;
   for (auto& shutdownStep : sShutdownSteps) {
     if (shutdownStep.mTicks < 0) {
       // Ignore this field.
       continue;
     }
     if (fields++ > 0) {
-      telemetryData->Append(", ");
+      telemetryData->AppendLiteral(", ");
     }
     telemetryData->AppendLiteral(R"(")");
     telemetryData->Append(shutdownStep.mTopic);
     telemetryData->AppendLiteral(R"(": )");
     telemetryData->AppendInt(shutdownStep.mTicks);
   }
   telemetryData->AppendLiteral("}");
 
--- a/toolkit/components/url-classifier/LookupCache.cpp
+++ b/toolkit/components/url-classifier/LookupCache.cpp
@@ -418,17 +418,17 @@ LookupCache::GetHostKeys(const nsACStrin
   const nsACString& host = Substring(begin, iter);
 
   if (IsCanonicalizedIP(host)) {
     nsCString *key = aHostKeys->AppendElement();
     if (!key)
       return NS_ERROR_OUT_OF_MEMORY;
 
     key->Assign(host);
-    key->Append("/");
+    key->AppendLiteral("/");
     return NS_OK;
   }
 
   nsTArray<nsCString> hostComponents;
   ParseString(PromiseFlatCString(host), '.', hostComponents);
 
   if (hostComponents.Length() < 2) {
     // no host or toplevel host, this won't match anything in the db
@@ -437,27 +437,27 @@ LookupCache::GetHostKeys(const nsACStrin
 
   // First check with two domain components
   int32_t last = int32_t(hostComponents.Length()) - 1;
   nsCString *lookupHost = aHostKeys->AppendElement();
   if (!lookupHost)
     return NS_ERROR_OUT_OF_MEMORY;
 
   lookupHost->Assign(hostComponents[last - 1]);
-  lookupHost->Append(".");
+  lookupHost->AppendLiteral(".");
   lookupHost->Append(hostComponents[last]);
-  lookupHost->Append("/");
+  lookupHost->AppendLiteral("/");
 
   // Now check with three domain components
   if (hostComponents.Length() > 2) {
     nsCString *lookupHost2 = aHostKeys->AppendElement();
     if (!lookupHost2)
       return NS_ERROR_OUT_OF_MEMORY;
     lookupHost2->Assign(hostComponents[last - 2]);
-    lookupHost2->Append(".");
+    lookupHost2->AppendLiteral(".");
     lookupHost2->Append(*lookupHost);
   }
 
   return NS_OK;
 }
 
 nsresult
 LookupCache::LoadPrefixSet()
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -1681,17 +1681,17 @@ nsresult SetExceptionHandler(nsIFile* aX
 #endif // XP_WIN32
 #else
     // On Android, we launch using the application package name instead of a
     // filename, so use the dynamically set MOZ_ANDROID_PACKAGE_NAME, or fall
     // back to the static ANDROID_PACKAGE_NAME.
     const char* androidPackageName = PR_GetEnv("MOZ_ANDROID_PACKAGE_NAME");
     if (androidPackageName != nullptr) {
       nsCString package(androidPackageName);
-      package.Append("/org.mozilla.gecko.CrashReporter");
+      package.AppendLiteral("/org.mozilla.gecko.CrashReporter");
       crashReporterPath = ToNewCString(package);
     } else {
       nsCString package(ANDROID_PACKAGE_NAME "/org.mozilla.gecko.CrashReporter");
       crashReporterPath = ToNewCString(package);
     }
 #endif // !defined(MOZ_WIDGET_ANDROID)
   }
 
--- a/toolkit/system/osxproxy/ProxyUtils.mm
+++ b/toolkit/system/osxproxy/ProxyUtils.mm
@@ -21,22 +21,22 @@ NormalizeAddr(const nsACString& aAddr, n
 {
   nsTArray<nsCString> addr;
   if (!ParseString(aAddr, '.', addr)) {
     return false;
   }
   aNormalized = "";
   for (uint32_t i = 0; i < 4; ++i) {
     if (i != 0) {
-      aNormalized.Append(".");
+      aNormalized.AppendLiteral(".");
     }
     if (i < addr.Length()) {
       aNormalized.Append(addr[i]);
     } else {
-      aNormalized.Append("0");
+      aNormalized.AppendLiteral("0");
     }
   }
   return true;
 }
 
 static PRUint32
 MaskIPv4Addr(PRUint32 aAddr, uint16_t aMaskLen)
 {
--- a/toolkit/system/windowsproxy/ProxyUtils.cpp
+++ b/toolkit/system/windowsproxy/ProxyUtils.cpp
@@ -21,22 +21,22 @@ NormalizeAddr(const nsACString& aAddr, n
 {
   nsTArray<nsCString> addr;
   if (!ParseString(aAddr, '.', addr)) {
     return false;
   }
   aNormalized = "";
   for (uint32_t i = 0; i < 4; ++i) {
     if (i != 0) {
-      aNormalized.Append(".");
+      aNormalized.AppendLiteral(".");
     }
     if (i < addr.Length()) {
       aNormalized.Append(addr[i]);
     } else {
-      aNormalized.Append("0");
+      aNormalized.AppendLiteral("0");
     }
   }
   return true;
 }
 
 static PRUint32
 MaskIPv4Addr(PRUint32 aAddr, uint16_t aMaskLen)
 {
--- a/widget/ContentCache.cpp
+++ b/widget/ContentCache.cpp
@@ -39,23 +39,23 @@ GetNotificationName(const IMENotificatio
 
 class GetRectText : public nsAutoCString
 {
 public:
   explicit GetRectText(const LayoutDeviceIntRect& aRect)
   {
     AssignLiteral("{ x=");
     AppendInt(aRect.x);
-    Append(", y=");
+    AppendLiteral(", y=");
     AppendInt(aRect.y);
-    Append(", width=");
+    AppendLiteral(", width=");
     AppendInt(aRect.width);
-    Append(", height=");
+    AppendLiteral(", height=");
     AppendInt(aRect.height);
-    Append(" }");
+    AppendLiteral(" }");
   }
   virtual ~GetRectText() {}
 };
 
 class GetWritingModeName : public nsAutoCString
 {
 public:
   explicit GetWritingModeName(const WritingMode& aWritingMode)
--- a/widget/cocoa/GfxInfo.mm
+++ b/widget/cocoa/GfxInfo.mm
@@ -289,19 +289,19 @@ GfxInfo::AddCrashReportAnnotations()
   CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDeviceID"),
                                      narrowDeviceID);
   CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterDriverVersion"),
                                      narrowDriverVersion);
   /* Add an App Note for now so that we get the data immediately. These
    * can go away after we store the above in the socorro db */
   nsAutoCString note;
   /* AppendPrintf only supports 32 character strings, mrghh. */
-  note.Append("AdapterVendorID: ");
+  note.AppendLiteral("AdapterVendorID: ");
   note.Append(narrowVendorID);
-  note.Append(", AdapterDeviceID: ");
+  note.AppendLiteral(", AdapterDeviceID: ");
   note.Append(narrowDeviceID);
   CrashReporter::AppendAppNotesToCrashReport(note);
 #endif
 }
 
 // We don't support checking driver versions on Mac.
 #define IMPLEMENT_MAC_DRIVER_BLOCKLIST(os, vendor, device, features, blockOn, ruleId) \
   APPEND_TO_DRIVER_BLOCKLIST(os, vendor, device, features, blockOn,           \
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -917,17 +917,17 @@ GfxInfo::AddCrashReportAnnotations()
   if (vendorID == GfxDriverInfo::GetDeviceVendor(VendorAll)) {
     /* if we didn't find a valid vendorID lets append the mDeviceID string to try to find out why */
     note.AppendLiteral(", ");
     LossyAppendUTF16toASCII(mDeviceID[mActiveGPUIndex], note);
     note.AppendLiteral(", ");
     LossyAppendUTF16toASCII(mDeviceKeyDebug, note);
     LossyAppendUTF16toASCII(mDeviceKeyDebug, note);
   }
-  note.Append("\n");
+  note.AppendLiteral("\n");
 
   if (mHasDualGPU) {
     nsString deviceID2, vendorID2, subsysID2;
     nsAutoString adapterDriverVersionString2;
     nsCString narrowDeviceID2, narrowVendorID2, narrowSubsysID2;
 
     // Make a slight difference between the two cases so that we
     // can see it in the crash reports.  It may come in handy.
--- a/xpcom/base/LogModulePrefWatcher.cpp
+++ b/xpcom/base/LogModulePrefWatcher.cpp
@@ -68,17 +68,17 @@ LoadPrefValue(const char* aName)
       // The pref was reset. Clear the user file.
       if (NS_FAILED(rv) || prefValue.IsEmpty()) {
         LogModule::SetLogFile(nullptr);
         return;
       }
 
       // If the pref value doesn't have a PID placeholder, append it to the end.
       if (!strstr(prefValue.get(), "%PID")) {
-        prefValue.Append("%PID");
+        prefValue.AppendLiteral("%PID");
       }
 
       LogModule::SetLogFile(prefValue.BeginReading());
     } else if (prefName.EqualsLiteral(kLoggingPrefAddTimestamp)) {
       bool addTimestamp = Preferences::GetBool(aName, false);
       LogModule::SetAddTimestamp(addTimestamp);
     } else if (prefName.EqualsLiteral(kLoggingPrefSync)) {
       bool sync = Preferences::GetBool(aName, false);
--- a/xpcom/base/SystemMemoryReporter.cpp
+++ b/xpcom/base/SystemMemoryReporter.cpp
@@ -945,20 +945,20 @@ private:
 
       AutoFile fileGuard(memFile);
 
       // Attempt to map the pid to a more useful name.
       nsAutoCString procName;
       LinuxUtils::GetThreadName(atoi(pid), procName);
 
       if (procName.IsEmpty()) {
-        procName.Append("pid=");
+        procName.AppendLiteral("pid=");
         procName.Append(pid);
       } else {
-        procName.Append(" (pid=");
+        procName.AppendLiteral(" (pid=");
         procName.Append(pid);
         procName.Append(")");
       }
 
       uint64_t gpuaddr, useraddr, size, id, sglen;
       char flags[kStringSize];
       char type[kStringSize];
       char usage[kStringSize];