merge mozilla-inbound to mozilla-central. r=merge a=merge
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sun, 24 Sep 2017 23:52:35 +0200
changeset 382647 b44e80e0590e6eed86a1902365424673c8c2eaec
parent 382646 d9cfaad3b11ef5cde2a55782ad67aa7eb5fd55e4 (current diff)
parent 382623 0c137ff9d95e01b7a869b6a330290467a368452e (diff)
child 382648 ad95f375733797a4802859d42b1a24d33a12330c
child 382651 7e962631ba4298bcefa571008661983d77c3e652
child 382747 b097014498107d5b56744b2946717dae2747cf2d
push id95377
push userarchaeopteryx@coole-files.de
push dateSun, 24 Sep 2017 21:55:15 +0000
treeherdermozilla-inbound@ad95f3757337 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge, merge
milestone58.0a1
first release with
nightly linux32
b44e80e0590e / 58.0a1 / 20170924220116 / files
nightly linux64
b44e80e0590e / 58.0a1 / 20170924220116 / files
nightly mac
b44e80e0590e / 58.0a1 / 20170924220116 / files
nightly win32
b44e80e0590e / 58.0a1 / 20170924220116 / files
nightly win64
b44e80e0590e / 58.0a1 / 20170924220116 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge mozilla-inbound to mozilla-central. r=merge a=merge MozReview-Commit-ID: HGJIeJkelZe
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -681,17 +681,17 @@ logging::Tree(const char* aTitle, const 
 
   nsAutoString level;
   Accessible* root = aRoot;
   do {
     const char* prefix = aPrefixFunc ? aPrefixFunc(aGetTreePrefixData, root) : "";
     printf("%s", NS_ConvertUTF16toUTF8(level).get());
     logging::AccessibleInfo(prefix, root);
     if (root->FirstChild() && !root->FirstChild()->IsDoc()) {
-      level.Append(NS_LITERAL_STRING("  "));
+      level.AppendLiteral(u"  ");
       root = root->FirstChild();
       continue;
     }
     int32_t idxInParent = root != aRoot && root->mParent ?
       root->mParent->mChildren.IndexOf(root) : -1;
     if (idxInParent != -1 &&
         idxInParent < static_cast<int32_t>(root->mParent->mChildren.Length() - 1)) {
       root = root->mParent->mChildren.ElementAt(idxInParent + 1);
@@ -719,17 +719,17 @@ logging::DOMTree(const char* aTitle, con
 {
   logging::MsgBegin(aTitle, "%s", aMsgText);
   nsAutoString level;
   nsINode* root = aDocument->DocumentNode();
   do {
     printf("%s", NS_ConvertUTF16toUTF8(level).get());
     logging::Node("", root);
     if (root->GetFirstChild()) {
-      level.Append(NS_LITERAL_STRING("  "));
+      level.AppendLiteral(u"  ");
       root = root->GetFirstChild();
       continue;
     }
     if (root->GetNextSibling()) {
       root = root->GetNextSibling();
       continue;
     }
     while ((root = root->GetParentNode())) {
--- 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)
 {
@@ -180,30 +180,30 @@ ExpandedPrincipal::AddonHasPermission(co
     }
   }
   return false;
 }
 
 nsresult
 ExpandedPrincipal::GetScriptLocation(nsACString& aStr)
 {
-  aStr.Assign("[Expanded Principal [");
+  aStr.AssignLiteral("[Expanded Principal [");
   for (size_t i = 0; i < mPrincipals.Length(); ++i) {
     if (i != 0) {
       aStr.AppendLiteral(", ");
     }
 
     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/chrome/nsChromeRegistryChrome.cpp
+++ b/chrome/nsChromeRegistryChrome.cpp
@@ -214,17 +214,17 @@ nsChromeRegistryChrome::IsLocaleRTL(cons
  * LocaleService::GetAppLocaleAsLangTag.
  */
 nsresult
 nsChromeRegistryChrome::GetSelectedLocale(const nsACString& aPackage,
                                           bool aAsBCP47,
                                           nsACString& aLocale)
 {
   nsAutoCString reqLocale;
-  if (aPackage.Equals("global")) {
+  if (aPackage.EqualsLiteral("global")) {
     LocaleService::GetInstance()->GetAppLocaleAsLangTag(reqLocale);
   } else {
     AutoTArray<nsCString, 10> requestedLocales;
     LocaleService::GetInstance()->GetRequestedLocales(requestedLocales);
     reqLocale.Assign(requestedLocales[0]);
   }
 
   nsCString realpackage;
--- a/dom/base/XPathGenerator.cpp
+++ b/dom/base/XPathGenerator.cpp
@@ -42,19 +42,19 @@ bool ContainNonWordCharacter(const nsASt
 }
 
 /**
  * Get the prefix according to the given namespace and assign the result to aResult.
  * */
 void GetPrefix(const nsINode* aNode, nsAString& aResult)
 {
   if (aNode->IsXULElement()) {
-    aResult.Assign(NS_LITERAL_STRING("xul"));
+    aResult.AssignLiteral(u"xul");
   } else if (aNode->IsHTMLElement()) {
-    aResult.Assign(NS_LITERAL_STRING("xhtml"));
+    aResult.AssignLiteral(u"xhtml");
   }
 }
 
 void GetNameAttribute(const nsINode* aNode, nsAString& aResult)
 {
   if (aNode->HasName()) {
     const Element* elem = aNode->AsElement();
     elem->GetAttr(kNameSpaceID_None, nsGkAtoms::name, aResult);
@@ -78,34 +78,34 @@ void GenerateConcatExpression(const nsAS
   const char16_t* quoteBeginPtr = nullptr;
   for (; cur < end; ++cur) {
     if (char16_t('\'') == *cur) {
       if (nonQuoteBeginPtr) {
         result.Append(nonQuoteBeginPtr, cur - nonQuoteBeginPtr);
         nonQuoteBeginPtr = nullptr;
       }
       if (!quoteBeginPtr) {
-        result.Append(NS_LITERAL_STRING("\',\""));
+        result.AppendLiteral(u"\',\"");
         quoteBeginPtr = cur;
       }
     } else {
       if (!nonQuoteBeginPtr) {
         nonQuoteBeginPtr = cur;
       }
       if (quoteBeginPtr) {
         result.Append(quoteBeginPtr, cur - quoteBeginPtr);
-        result.Append(NS_LITERAL_STRING("\",\'"));
+        result.AppendLiteral(u"\",\'");
         quoteBeginPtr = nullptr;
       }
     }
   }
 
   if (quoteBeginPtr) {
     result.Append(quoteBeginPtr, cur - quoteBeginPtr);
-    result.Append(NS_LITERAL_STRING("\",\'"));
+    result.AppendLiteral(u"\",\'");
   } else if (nonQuoteBeginPtr) {
     result.Append(nonQuoteBeginPtr, cur - nonQuoteBeginPtr);
   }
 
   // Prepend concat(' and append ').
   aResult.Assign(NS_LITERAL_STRING("concat(\'") + result + NS_LITERAL_STRING("\')"));
 }
 
@@ -182,15 +182,15 @@ void XPathGenerator::Generate(const nsIN
   nsAutoString namePart;
   nsAutoString countPart;
   if (!nodeNameAttribute.IsEmpty()) {
     nsAutoString quotedArgument;
     QuoteArgument(nodeNameAttribute, quotedArgument);
     namePart.Assign(NS_LITERAL_STRING("[@name=") + quotedArgument + NS_LITERAL_STRING("]"));
   }
   if (count != 1) {
-    countPart.Assign(NS_LITERAL_STRING("["));
+    countPart.AssignLiteral(u"[");
     countPart.AppendInt(count);
-    countPart.Append(NS_LITERAL_STRING("]"));
+    countPart.AppendLiteral(u"]");
   }
   Generate(aNode->GetParentNode(), aResult);
   aResult.Append(NS_LITERAL_STRING("/") + tag + namePart + countPart);
 }
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -1630,17 +1630,17 @@ nsContentUtils::SandboxFlagsToString(uin
     return;
   }
 
   aString.Truncate();
 
 #define SANDBOX_KEYWORD(string, atom, flags)                \
   if (!(aFlags & (flags))) {                                \
     if (!aString.IsEmpty()) {                               \
-      aString.Append(NS_LITERAL_STRING(" "));               \
+      aString.AppendLiteral(u" ");                          \
     }                                                       \
     aString.Append(nsDependentAtomString(nsGkAtoms::atom)); \
   }
 #include "IframeSandboxKeywordList.h"
 #undef SANDBOX_KEYWORD
 }
 
 nsIBidiKeyboard*
@@ -7188,17 +7188,17 @@ nsContentUtils::IsPatternMatching(nsAStr
   AutoJSContext cx;
   AutoDisableJSInterruptCallback disabler(cx);
 
   // We can use the junk scope here, because we're just using it for
   // regexp evaluation, not actual script execution.
   JSAutoCompartment ac(cx, xpc::UnprivilegedJunkScope());
 
   // The pattern has to match the entire value.
-  aPattern.Insert(NS_LITERAL_STRING("^(?:"), 0);
+  aPattern.InsertLiteral(u"^(?:", 0);
   aPattern.AppendLiteral(")$");
 
   JS::Rooted<JSObject*> re(cx,
     JS_NewUCRegExpObject(cx,
                          static_cast<char16_t*>(aPattern.BeginWriting()),
                          aPattern.Length(), JSREG_UNICODE));
   if (!re) {
     // Remove extra patterns added above to report with the original pattern.
--- a/dom/base/test/gtest/TestXPathGenerator.cpp
+++ b/dom/base/test/gtest/TestXPathGenerator.cpp
@@ -6,135 +6,135 @@
 
 #include "gtest/gtest.h"
 #include "XPathGenerator.h"
 #include "nsString.h"
 
 TEST(TestXPathGenerator, TestQuoteArgumentWithoutQuote)
 {
   nsAutoString arg;
-  arg.Assign(NS_LITERAL_STRING("testing"));
+  arg.AssignLiteral(u"testing");
 
   nsAutoString expectedResult;
-  expectedResult.Assign(NS_LITERAL_STRING("\'testing\'"));
+  expectedResult.AssignLiteral(u"\'testing\'");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator, TestQuoteArgumentWithSingleQuote)
 {
   nsAutoString arg;
-  arg.Assign(NS_LITERAL_STRING("\'testing\'"));
+  arg.AssignLiteral(u"\'testing\'");
 
   nsAutoString expectedResult;
-  expectedResult.Assign(NS_LITERAL_STRING("\"\'testing\'\""));
+  expectedResult.AssignLiteral(u"\"\'testing\'\"");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator, TestQuoteArgumentWithDoubleQuote)
 {
   nsAutoString arg;
-  arg.Assign(NS_LITERAL_STRING("\"testing\""));
+  arg.AssignLiteral(u"\"testing\"");
 
   nsAutoString expectedResult;
-  expectedResult.Assign(NS_LITERAL_STRING("\'\"testing\"\'"));
+  expectedResult.AssignLiteral(u"\'\"testing\"\'");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator, TestQuoteArgumentWithSingleAndDoubleQuote)
 {
   nsAutoString arg;
-  arg.Assign(NS_LITERAL_STRING("\'testing\""));
+  arg.AssignLiteral(u"\'testing\"");
 
   nsAutoString expectedResult;
-  expectedResult.Assign(NS_LITERAL_STRING("concat(\'\',\"\'\",\'testing\"\')"));
+  expectedResult.AssignLiteral(u"concat(\'\',\"\'\",\'testing\"\')");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
   printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), NS_ConvertUTF16toUTF8(expectedResult).get());
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator, TestQuoteArgumentWithDoubleQuoteAndASequenceOfSingleQuote)
 {
   nsAutoString arg;
-  arg.Assign(NS_LITERAL_STRING("\'\'\'\'testing\""));
+  arg.AssignLiteral(u"\'\'\'\'testing\"");
 
   nsAutoString expectedResult;
-  expectedResult.Assign(NS_LITERAL_STRING("concat(\'\',\"\'\'\'\'\",\'testing\"\')"));
+  expectedResult.AssignLiteral(u"concat(\'\',\"\'\'\'\'\",\'testing\"\')");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
   printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), NS_ConvertUTF16toUTF8(expectedResult).get());
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator, TestQuoteArgumentWithDoubleQuoteAndTwoSequencesOfSingleQuote)
 {
   nsAutoString arg;
-  arg.Assign(NS_LITERAL_STRING("\'\'\'\'testing\'\'\'\'\'\'\""));
+  arg.AssignLiteral(u"\'\'\'\'testing\'\'\'\'\'\'\"");
 
   nsAutoString expectedResult;
-  expectedResult.Assign(NS_LITERAL_STRING("concat(\'\',\"\'\'\'\'\",\'testing\',\"\'\'\'\'\'\'\",\'\"\')"));
+  expectedResult.AssignLiteral(u"concat(\'\',\"\'\'\'\'\",\'testing\',\"\'\'\'\'\'\'\",\'\"\')");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
   printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), NS_ConvertUTF16toUTF8(expectedResult).get());
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator, TestQuoteArgumentWithDoubleQuoteAndTwoSequencesOfSingleQuoteInMiddle)
 {
   nsAutoString arg;
-  arg.Assign(NS_LITERAL_STRING("t\'\'\'\'estin\'\'\'\'\'\'\"g"));
+  arg.AssignLiteral(u"t\'\'\'\'estin\'\'\'\'\'\'\"g");
 
   nsAutoString expectedResult;
-  expectedResult.Assign(NS_LITERAL_STRING("concat(\'t\',\"\'\'\'\'\",\'estin\',\"\'\'\'\'\'\'\",\'\"g\')"));
+  expectedResult.AssignLiteral(u"concat(\'t\',\"\'\'\'\'\",\'estin\',\"\'\'\'\'\'\'\",\'\"g\')");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
   printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), NS_ConvertUTF16toUTF8(expectedResult).get());
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator, TestEscapeNameWithNormalCharacters)
 {
   nsAutoString arg;
-  arg.Assign(NS_LITERAL_STRING("testing"));
+  arg.AssignLiteral(u"testing");
 
   nsAutoString expectedResult;
-  expectedResult.Assign(NS_LITERAL_STRING("testing"));
+  expectedResult.AssignLiteral(u"testing");
 
   nsAutoString result;
   XPathGenerator::EscapeName(arg, result);
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator, TestEscapeNameWithSpecialCharacters)
 {
   nsAutoString arg;
-  arg.Assign(NS_LITERAL_STRING("^testing!"));
+  arg.AssignLiteral(u"^testing!");
 
   nsAutoString expectedResult;
-  expectedResult.Assign(NS_LITERAL_STRING("*[local-name()=\'^testing!\']"));
+  expectedResult.AssignLiteral(u"*[local-name()=\'^testing!\']");
 
   nsAutoString result;
   XPathGenerator::EscapeName(arg, result);
   printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(), NS_ConvertUTF16toUTF8(expectedResult).get());
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
--- a/dom/fetch/InternalRequest.h
+++ b/dom/fetch/InternalRequest.h
@@ -136,17 +136,17 @@ public:
   // request's url list.
   void
   GetURL(nsACString& aURL) const
   {
     aURL.Assign(GetURLWithoutFragment());
     if (GetFragment().IsEmpty()) {
       return;
     }
-    aURL.Append(NS_LITERAL_CSTRING("#"));
+    aURL.AppendLiteral("#");
     aURL.Append(GetFragment());
   }
 
   const nsCString&
   GetURLWithoutFragment() const
   {
     MOZ_RELEASE_ASSERT(!mURLList.IsEmpty(),
                        "Internal Request's urlList should not be empty.");
--- a/dom/flyweb/FlyWebService.cpp
+++ b/dom/flyweb/FlyWebService.cpp
@@ -797,21 +797,21 @@ FlyWebMDNSService::PairWithService(const
   if (discInfo->mService.mCert.IsEmpty()) {
     url.AssignLiteral("http://");
   } else {
     url.AssignLiteral("https://");
   }
   url.Append(aInfo->mService.mHostname);
   if (!discInfo->mService.mPath.IsEmpty()) {
     if (discInfo->mService.mPath.Find("/") != 0) {
-      url.Append(NS_LITERAL_STRING("/"));
+      url.AppendLiteral(u"/");
     }
     url.Append(discInfo->mService.mPath);
   } else {
-    url.Append(NS_LITERAL_STRING("/"));
+    url.AppendLiteral(u"/");
   }
   nsCOMPtr<nsIURI> uiURL;
   NS_NewURI(getter_AddRefs(uiURL), url);
   MOZ_ASSERT(uiURL);
   if (uiURL) {
     nsAutoCString spec;
     uiURL->GetSpec(spec);
     CopyUTF8toUTF16(spec, aInfo->mService.mUiUrl);
--- a/dom/flyweb/HttpServer.cpp
+++ b/dom/flyweb/HttpServer.cpp
@@ -919,17 +919,17 @@ HttpServer::Connection::QueueResponse(In
 
   for (auto header : entries) {
     head.Append(header.mName +
                 NS_LITERAL_CSTRING(": ") +
                 header.mValue +
                 NS_LITERAL_CSTRING("\r\n"));
   }
 
-  head.Append(NS_LITERAL_CSTRING("\r\n"));
+  head.AppendLiteral("\r\n");
 
   mOutputBuffers.AppendElement()->mString = head;
   if (body) {
     OutputBuffer* bodyBuffer = mOutputBuffers.AppendElement();
     bodyBuffer->mStream = body;
     bodyBuffer->mChunked = chunked;
   }
 
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -856,21 +856,21 @@ MediaDevice::SetRawId(const nsAString& a
 {
   mRawID.Assign(aID);
 }
 
 NS_IMETHODIMP
 MediaDevice::GetMediaSource(nsAString& aMediaSource)
 {
   if (mMediaSource == MediaSourceEnum::Microphone) {
-    aMediaSource.Assign(NS_LITERAL_STRING("microphone"));
+    aMediaSource.AssignLiteral(u"microphone");
   } else if (mMediaSource == MediaSourceEnum::AudioCapture) {
-    aMediaSource.Assign(NS_LITERAL_STRING("audioCapture"));
+    aMediaSource.AssignLiteral(u"audioCapture");
   } else if (mMediaSource == MediaSourceEnum::Window) { // this will go away
-    aMediaSource.Assign(NS_LITERAL_STRING("window"));
+    aMediaSource.AssignLiteral(u"window");
   } else { // all the rest are shared
     aMediaSource.Assign(NS_ConvertUTF8toUTF16(
       dom::MediaSourceEnumValues::strings[uint32_t(mMediaSource)].value));
   }
   return NS_OK;
 }
 
 VideoDevice::Source*
--- 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/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -493,17 +493,17 @@ public:
           DXVA2Manager::CreateD3D11DXVA(mKnowsCompositor, *failureReason);
         if (mDXVA2Manager) {
           return NS_OK;
         }
       }
       // Try again with d3d9, but record the failure reason
       // into a new var to avoid overwriting the d3d11 failure.
       failureReason = &secondFailureReason;
-      mFailureReason.Append(NS_LITERAL_CSTRING("; "));
+      mFailureReason.AppendLiteral("; ");
     }
 
     const nsCString& blacklistedDLL = FindD3D9BlacklistedDLL();
     if (!deblacklistingForTelemetry && !blacklistedDLL.IsEmpty()) {
       mFailureReason.AppendPrintf("D3D9 blacklisted with DLL %s",
                                   blacklistedDLL.get());
     } else {
       mDXVA2Manager =
@@ -631,19 +631,19 @@ WMFVideoMFTManager::Init()
     }
     result = InitInternal();
   }
 
   if (NS_SUCCEEDED(result) && mDXVA2Manager) {
     // If we had some failures but eventually made it work,
     // make sure we preserve the messages.
     if (mDXVA2Manager->IsD3D11()) {
-      mDXVAFailureReason.Append(NS_LITERAL_CSTRING("Using D3D11 API"));
+      mDXVAFailureReason.AppendLiteral("Using D3D11 API");
     } else {
-      mDXVAFailureReason.Append(NS_LITERAL_CSTRING("Using D3D9 API"));
+      mDXVAFailureReason.AppendLiteral("Using D3D9 API");
     }
   }
 
   return result;
 }
 
 MediaResult
 WMFVideoMFTManager::InitInternal()
--- a/dom/media/systemservices/MediaParent.cpp
+++ b/dom/media/systemservices/MediaParent.cpp
@@ -107,17 +107,17 @@ class OriginKeyStore : public nsISupport
 
   private:
     void
     PrincipalInfoToString(const ipc::PrincipalInfo& aPrincipalInfo,
                           nsACString& aString)
     {
       switch (aPrincipalInfo.type()) {
         case ipc::PrincipalInfo::TSystemPrincipalInfo:
-          aString.Assign("[System Principal]");
+          aString.AssignLiteral("[System Principal]");
           return;
 
         case ipc::PrincipalInfo::TNullPrincipalInfo: {
           const ipc::NullPrincipalInfo& info =
             aPrincipalInfo.get_NullPrincipalInfo();
           aString.Assign(info.spec());
           return;
         }
@@ -132,30 +132,30 @@ class OriginKeyStore : public nsISupport
           aString.Append(suffix);
           return;
         }
 
         case ipc::PrincipalInfo::TExpandedPrincipalInfo: {
           const ipc::ExpandedPrincipalInfo& info =
             aPrincipalInfo.get_ExpandedPrincipalInfo();
 
-          aString.Assign("[Expanded Principal [");
+          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/media/webspeech/synth/speechd/SpeechDispatcherService.cpp
+++ b/dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp
@@ -403,17 +403,17 @@ SpeechDispatcherService::Setup()
         // with another, non-standard suptag after it. We keep the first one
         // and convert it to uppercase.
         const char* v = list[i]->variant;
         const char* hyphen = strchr(v, '-');
         nsDependentCSubstring variant(v, hyphen ? hyphen - v : strlen(v));
         ToUpperCase(variant);
 
         // eSpeak uses UK which is not a valid region subtag in BCP47.
-        if (variant.Equals("UK")) {
+        if (variant.EqualsLiteral("UK")) {
           variant.AssignLiteral("GB");
         }
 
         lang.AppendLiteral("-");
         lang.Append(variant);
       }
 
       uri.Append(NS_ConvertUTF8toUTF16(lang));
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -757,17 +757,17 @@ NotificationTelemetryService::GetNotific
                                                         uint32_t* aCapability)
 {
   nsCOMPtr<nsIPermission> permission = do_QueryInterface(aSupports);
   if (!permission) {
     return false;
   }
   nsAutoCString type;
   permission->GetType(type);
-  if (!type.Equals("desktop-notification")) {
+  if (!type.EqualsLiteral("desktop-notification")) {
     return false;
   }
   permission->GetCapability(aCapability);
   return true;
 }
 
 void
 NotificationTelemetryService::RecordDNDSupported()
--- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp
+++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp
@@ -393,17 +393,17 @@ nsPluginStreamListenerPeer::SetupPluginC
       return NS_ERROR_FAILURE;
 
     nsAutoCString filename;
     url->GetFileName(filename);
     if (NS_FAILED(rv))
       return rv;
 
     // Create a file to save our stream into. Should we scramble the name?
-    filename.Insert(NS_LITERAL_CSTRING("plugin-"), 0);
+    filename.InsertLiteral("plugin-", 0);
     rv = pluginTmp->AppendNative(filename);
     if (NS_FAILED(rv))
       return rv;
 
     // Yes, make it unique.
     rv = pluginTmp->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0600);
     if (NS_FAILED(rv))
       return rv;
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -8232,17 +8232,17 @@ OriginParser::Parse(nsACString& aSpec, O
 
     HandleToken(token);
 
     if (mError) {
       break;
     }
 
     if (!mHandledTokens.IsEmpty()) {
-      mHandledTokens.Append(NS_LITERAL_CSTRING(", "));
+      mHandledTokens.AppendLiteral(", ");
     }
     mHandledTokens.Append('\'');
     mHandledTokens.Append(token);
     mHandledTokens.Append('\'');
   }
 
   if (!mError && mTokenizer.separatorAfterCurrentToken()) {
     HandleTrailingSeparator();
--- a/dom/security/nsCSPContext.cpp
+++ b/dom/security/nsCSPContext.cpp
@@ -78,29 +78,29 @@ CreateCacheKey_Internal(nsIURI* aContent
 
   bool isDataScheme = false;
   nsresult rv = aContentLocation->SchemeIs("data", &isDataScheme);
   NS_ENSURE_SUCCESS(rv, rv);
 
   outCacheKey.Truncate();
   if (aContentType != nsIContentPolicy::TYPE_SCRIPT && isDataScheme) {
     // For non-script data: URI, use ("data:", aContentType) as the cache key.
-    outCacheKey.Append(NS_LITERAL_CSTRING("data:"));
+    outCacheKey.AppendLiteral("data:");
     outCacheKey.AppendInt(aContentType);
     return NS_OK;
   }
 
   nsAutoCString spec;
   rv = aContentLocation->GetSpec(spec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Don't cache for a URI longer than the cutoff size.
   if (spec.Length() <= CSP_CACHE_URI_CUTOFF_SIZE) {
     outCacheKey.Append(spec);
-    outCacheKey.Append(NS_LITERAL_CSTRING("!"));
+    outCacheKey.AppendLiteral("!");
     outCacheKey.AppendInt(aContentType);
   }
 
   return NS_OK;
 }
 
 /* =====  nsIContentSecurityPolicy impl ====== */
 
--- a/dom/security/nsCSPUtils.cpp
+++ b/dom/security/nsCSPUtils.cpp
@@ -137,29 +137,29 @@ CSP_LogMessage(const nsAString& aMessage
   nsCOMPtr<nsIScriptError> error(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
 
   if (!console || !error) {
     return;
   }
 
   // Prepending CSP to the outgoing console message
   nsString cspMsg;
-  cspMsg.Append(NS_LITERAL_STRING("Content Security Policy: "));
+  cspMsg.AppendLiteral(u"Content Security Policy: ");
   cspMsg.Append(aMessage);
 
   // Currently 'aSourceLine' is not logged to the console, because similar
   // information is already included within the source link of the message.
   // For inline violations however, the line and column number are 0 and
   // information contained within 'aSourceLine' can be really useful for devs.
   // E.g. 'aSourceLine' might be: 'onclick attribute on DIV element'.
   // In such cases we append 'aSourceLine' directly to the error message.
   if (!aSourceLine.IsEmpty()) {
-    cspMsg.Append(NS_LITERAL_STRING(" Source: "));
+    cspMsg.AppendLiteral(" Source: ");
     cspMsg.Append(aSourceLine);
-    cspMsg.Append(NS_LITERAL_STRING("."));
+    cspMsg.AppendLiteral(u".");
   }
 
   nsresult rv;
   if (aInnerWindowID > 0) {
     nsCString catStr;
     catStr.AssignASCII(aCategory);
     rv = error->InitWithWindowID(cspMsg, aSourceName,
                                  aSourceLine, aLineNumber,
--- a/dom/security/nsContentSecurityManager.cpp
+++ b/dom/security/nsContentSecurityManager.cpp
@@ -803,19 +803,19 @@ nsContentSecurityManager::IsOriginPotent
   }
 
   nsAutoCString host;
   rv = uri->GetHost(host);
   if (NS_FAILED(rv)) {
     return NS_OK;
   }
 
-  if (host.Equals("127.0.0.1") ||
-      host.Equals("localhost") ||
-      host.Equals("::1")) {
+  if (host.EqualsLiteral("127.0.0.1") ||
+      host.EqualsLiteral("localhost") ||
+      host.EqualsLiteral("::1")) {
     *aIsTrustWorthy = true;
     return NS_OK;
   }
 
   // If a host is not considered secure according to the default algorithm, then
   // check to see if it has been whitelisted by the user.  We only apply this
   // whitelist for network resources, i.e., those with scheme "http" or "ws".
   // The pref should contain a comma-separated list of hostnames.
--- a/dom/security/nsMixedContentBlocker.cpp
+++ b/dom/security/nsMixedContentBlocker.cpp
@@ -459,17 +459,17 @@ bool
 nsMixedContentBlocker::IsPotentiallyTrustworthyLoopbackURL(nsIURI* aURL) {
   nsAutoCString host;
   nsresult rv = aURL->GetHost(host);
   NS_ENSURE_SUCCESS(rv, false);
 
   // We could also allow 'localhost' (if we can guarantee that it resolves
   // to a loopback address), but Chrome doesn't support it as of writing. For
   // web compat, lets only allow what Chrome allows.
-  return host.Equals("127.0.0.1") || host.Equals("::1");
+  return host.EqualsLiteral("127.0.0.1") || host.EqualsLiteral("::1");
 }
 
 /* Static version of ShouldLoad() that contains all the Mixed Content Blocker
  * logic.  Called from non-static ShouldLoad().
  */
 nsresult
 nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect,
                                   uint32_t aContentType,
--- a/dom/storage/StorageDBThread.cpp
+++ b/dom/storage/StorageDBThread.cpp
@@ -87,18 +87,19 @@ Scheme0Scope(LocalStorageCacheBridge* aC
   oa.mInIsolatedMozBrowser = false;
   oa.CreateSuffix(remaining);
   if (!remaining.IsEmpty()) {
     MOZ_ASSERT(!suffix.IsEmpty());
 
     if (result.IsEmpty()) {
       // Must contain the old prefix, otherwise we won't search for the whole
       // origin attributes suffix.
-      result.Append(NS_LITERAL_CSTRING("0:f:"));
+      result.AppendLiteral("0:f:");
     }
+
     // Append the whole origin attributes suffix despite we have already stored
     // appid and inbrowser.  We are only looking for it when the scope string
     // starts with "$appid:$inbrowser:" (with whatever valid values).
     //
     // The OriginAttributes suffix is a string in a form like:
     // "^addonId=101&userContextId=5" and it's ensured it always starts with '^'
     // and never contains ':'.  See OriginAttributes::CreateSuffix.
     result.Append(suffix);
--- a/dom/url/URLWorker.cpp
+++ b/dom/url/URLWorker.cpp
@@ -624,18 +624,17 @@ URLWorker::Init(const nsAString& aURL, c
     }
     rv = net_ExtractURLScheme(NS_ConvertUTF16toUTF8(aBase.Value()), scheme);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       aRv.ThrowTypeError<MSG_INVALID_URL>(aURL);
       return;
     }
   }
 
-  if (scheme.Equals(NS_LITERAL_CSTRING("http")) ||
-      scheme.Equals(NS_LITERAL_CSTRING("https"))) {
+  if (scheme.EqualsLiteral("http") || scheme.EqualsLiteral("https")) {
     RefPtr<nsStandardURL> baseURL;
     if (aBase.WasPassed()) {
       baseURL = new nsStandardURL();
 
       // XXXcatalinb: SetSpec only writes a warning to the console on urls
       // without a valid scheme. I can't fix that because we've come to rely
       // on that behaviour in a bunch of different places.
       nsresult rv = baseURL->SetSpec(NS_ConvertUTF16toUTF8(aBase.Value()));
@@ -702,18 +701,17 @@ URLWorker::SetHref(const nsAString& aHre
 {
   nsAutoCString scheme;
   nsresult rv = net_ExtractURLScheme(NS_ConvertUTF16toUTF8(aHref), scheme);
   if (NS_FAILED(rv)) {
     aRv.ThrowTypeError<MSG_INVALID_URL>(aHref);
     return;
   }
 
-  if (scheme.Equals(NS_LITERAL_CSTRING("http")) ||
-      scheme.Equals(NS_LITERAL_CSTRING("https"))) {
+  if (scheme.EqualsLiteral("http") || scheme.EqualsLiteral("https")) {
     mStdURL = new nsStandardURL();
     aRv = mStdURL->SetSpec(NS_ConvertUTF16toUTF8(aHref));
     if (mURLProxy) {
       mWorkerPrivate->AssertIsOnWorkerThread();
 
       RefPtr<TeardownURLRunnable> runnable =
         new TeardownURLRunnable(mURLProxy);
       mURLProxy = nullptr;
--- a/dom/webauthn/WebAuthnManager.cpp
+++ b/dom/webauthn/WebAuthnManager.cpp
@@ -83,17 +83,17 @@ AssembleClientData(const nsAString& aOri
   nsresult rv = aChallenge.ToJwkBase64(challengeBase64);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return NS_ERROR_FAILURE;
   }
 
   CollectedClientData clientDataObject;
   clientDataObject.mChallenge.Assign(challengeBase64);
   clientDataObject.mOrigin.Assign(aOrigin);
-  clientDataObject.mHashAlg.Assign(NS_LITERAL_STRING("SHA-256"));
+  clientDataObject.mHashAlg.AssignLiteral(u"SHA-256");
 
   nsAutoString temp;
   if (NS_WARN_IF(!clientDataObject.ToJSON(temp))) {
     return NS_ERROR_FAILURE;
   }
 
   aJsonOut.Assign(NS_ConvertUTF16toUTF8(temp));
   return NS_OK;
--- a/dom/workers/ServiceWorkerClients.cpp
+++ b/dom/workers/ServiceWorkerClients.cpp
@@ -521,17 +521,17 @@ public:
   }
 
   NS_IMETHOD
   Observe(nsISupports* aSubject, const char* aTopic, const char16_t* /* aData */) override
   {
     AssertIsOnMainThread();
 
     nsCString topic(aTopic);
-    if (!topic.Equals(NS_LITERAL_CSTRING("BrowserChrome:Ready"))) {
+    if (!topic.EqualsLiteral("BrowserChrome:Ready")) {
       MOZ_ASSERT(false, "Unexpected topic.");
       return NS_ERROR_FAILURE;
     }
 
     nsCOMPtr<nsIObserverService> os = services::GetObserverService();
     NS_ENSURE_STATE(os);
     os->RemoveObserver(this, "BrowserChrome:Ready");
 
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -2587,17 +2587,17 @@ WorkerPrivate::MemoryReporter::TryToMapA
 
   if (!addonManager ||
       NS_FAILED(addonManager->MapURIToAddonID(scriptURI, addonId, &ok)) ||
       !ok) {
     return;
   }
 
   static const size_t explicitLength = strlen("explicit/");
-  addonId.Insert(NS_LITERAL_CSTRING("add-ons/"), 0);
+  addonId.InsertLiteral("add-ons/", 0);
   addonId += "/";
   path.Insert(addonId, explicitLength);
 }
 
 WorkerPrivate::MemoryReporter::CollectReportsRunnable::CollectReportsRunnable(
   WorkerPrivate* aWorkerPrivate,
   nsIHandleReportCallback* aHandleReport,
   nsISupports* aHandlerData,
--- 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/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -1966,17 +1966,17 @@ XMLHttpRequestMainThread::OnStartRequest
 
   if (!mOverrideMimeType.IsEmpty()) {
     channel->SetContentType(NS_ConvertUTF16toUTF8(mOverrideMimeType));
   }
 
   // Fallback to 'application/octet-stream'
   nsAutoCString type;
   channel->GetContentType(type);
-  if (type.Equals(UNKNOWN_CONTENT_TYPE)) {
+  if (type.EqualsLiteral(UNKNOWN_CONTENT_TYPE)) {
     channel->SetContentType(NS_LITERAL_CSTRING(APPLICATION_OCTET_STREAM));
   }
 
   DetectCharset();
 
   // Set up arraybuffer
   if (mResponseType == XMLHttpRequestResponseType::Arraybuffer &&
       NS_SUCCEEDED(status)) {
@@ -2708,17 +2708,17 @@ XMLHttpRequestMainThread::InitiateFetch(
   // Since we expect XML data, set the type hint accordingly
   // if the channel doesn't know any content type.
   // This means that we always try to parse local files as XML
   // ignoring return value, as this is not critical. Use text/xml as fallback
   // MIME type.
   nsAutoCString contentType;
   if (NS_FAILED(mChannel->GetContentType(contentType)) ||
       contentType.IsEmpty() ||
-      contentType.Equals(UNKNOWN_CONTENT_TYPE)) {
+      contentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE)) {
     mChannel->SetContentType(NS_LITERAL_CSTRING("text/xml"));
   }
 
   // Set up the preflight if needed
   if (!IsSystemXHR()) {
     nsTArray<nsCString> CORSUnsafeHeaders;
     mAuthorRequestHeaders.GetCORSUnsafeHeaders(CORSUnsafeHeaders);
     nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
--- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
+++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
@@ -276,17 +276,17 @@ txStylesheetSink::OnStartRequest(nsIRequ
     channel->GetContentType(contentType);
 
     // Time to sniff! Note: this should go away once file channels do
     // sniffing themselves.
     nsCOMPtr<nsIURI> uri;
     channel->GetURI(getter_AddRefs(uri));
     bool sniff;
     if (NS_SUCCEEDED(uri->SchemeIs("file", &sniff)) && sniff &&
-        contentType.Equals(UNKNOWN_CONTENT_TYPE)) {
+        contentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE)) {
         nsresult rv;
         nsCOMPtr<nsIStreamConverterService> serv =
             do_GetService("@mozilla.org/streamConverters;1", &rv);
         if (NS_SUCCEEDED(rv)) {
             nsCOMPtr<nsIStreamListener> converter;
             rv = serv->AsyncConvertData(UNKNOWN_CONTENT_TYPE,
                                         "*/*",
                                         mListener,
--- a/extensions/auth/nsHttpNegotiateAuth.cpp
+++ b/extensions/auth/nsHttpNegotiateAuth.cpp
@@ -190,17 +190,17 @@ nsHttpNegotiateAuth::ChallengeReceived(n
     //
     // The correct service name for IIS servers is "HTTP/f.q.d.n", so
     // construct the proper service name for passing to "gss_import_name".
     //
     // TODO: Possibly make this a configurable service name for use
     // with non-standard servers that use stuff like "khttp/f.q.d.n"
     // instead.
     //
-    service.Insert("HTTP@", 0);
+    service.InsertLiteral("HTTP@", 0);
 
     const char *contractID;
     if (TestBoolPref(kNegotiateAuthSSPI)) {
 	   LOG(("  using negotiate-sspi\n"));
 	   contractID = NS_AUTH_MODULE_CONTRACTID_PREFIX "negotiate-sspi";
     }
     else {
 	   LOG(("  using negotiate-gss\n"));
@@ -378,18 +378,18 @@ 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.Assign(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
-            contractId.Append("negotiate");
+            contractId.AssignLiteral(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
+            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
@@ -656,29 +656,29 @@ UpgradeHostToOriginAndInsert(const nsACS
     }
 
     rv = histResultContainer->SetContainerOpen(false);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   // If we didn't find any origins for this host in the poermissions database,
   // we can insert the default http:// and https:// permissions into the database.
-  // This has a relatively high liklihood of applying the permission to the correct
+  // This has a relatively high likelihood of applying the permission to the correct
   // origin.
   if (!foundHistory) {
     nsAutoCString hostSegment;
     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.Assign("[");
+      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
@@ -34,17 +34,17 @@ static_assert(MOZ_ARRAY_LENGTH(sCrashGua
               "CrashGuardType updated without a name string");
 
 static inline void
 BuildCrashGuardPrefName(CrashGuardType aType, nsCString& aOutPrefName)
 {
   MOZ_ASSERT(aType < CrashGuardType::NUM_TYPES);
   MOZ_ASSERT(sCrashGuardNames[size_t(aType)]);
 
-  aOutPrefName.Assign("gfx.crash-guard.status.");
+  aOutPrefName.AssignLiteral("gfx.crash-guard.status.");
   aOutPrefName.Append(sCrashGuardNames[size_t(aType)]);
 }
 
 DriverCrashGuard::DriverCrashGuard(CrashGuardType aType, dom::ContentParent* aContentParent)
  : mType(aType)
  , mMode(aContentParent ? Mode::Proxy : Mode::Normal)
  , mInitialized(false)
  , mGuardActivated(false)
@@ -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/intl/locale/LocaleService.cpp
+++ b/intl/locale/LocaleService.cpp
@@ -779,26 +779,26 @@ LocaleService::Locale::Locale(const nsCS
         }
         break;
     }
     partNum++;
   }
 
   if (aRange) {
     if (mLanguage.IsEmpty()) {
-      mLanguage.Assign(NS_LITERAL_CSTRING("*"));
+      mLanguage.AssignLiteral("*");
     }
     if (mScript.IsEmpty()) {
-      mScript.Assign(NS_LITERAL_CSTRING("*"));
+      mScript.AssignLiteral("*");
     }
     if (mRegion.IsEmpty()) {
-      mRegion.Assign(NS_LITERAL_CSTRING("*"));
+      mRegion.AssignLiteral("*");
     }
     if (mVariant.IsEmpty()) {
-      mVariant.Assign(NS_LITERAL_CSTRING("*"));
+      mVariant.AssignLiteral("*");
     }
   }
 }
 
 static bool
 SubtagMatches(const nsCString& aSubtag1, const nsCString& aSubtag2)
 {
   return aSubtag1.EqualsLiteral("*") ||
--- a/intl/locale/tests/gtest/TestLocaleServiceNegotiate.cpp
+++ b/intl/locale/tests/gtest/TestLocaleServiceNegotiate.cpp
@@ -22,11 +22,11 @@ TEST(Intl_Locale_LocaleService, Negotiat
 
   availableLocales.AppendElement(NS_LITERAL_CSTRING("sr-Cyrl"));
   availableLocales.AppendElement(NS_LITERAL_CSTRING("sr-Latn"));
 
   LocaleService::GetInstance()->NegotiateLanguages(
       requestedLocales, availableLocales, defaultLocale, strategy, supportedLocales);
 
   ASSERT_TRUE(supportedLocales.Length() == 2);
-  ASSERT_TRUE(supportedLocales[0].Equals("sr-Cyrl"));
-  ASSERT_TRUE(supportedLocales[1].Equals("en-US"));
+  ASSERT_TRUE(supportedLocales[0].EqualsLiteral("sr-Cyrl"));
+  ASSERT_TRUE(supportedLocales[1].EqualsLiteral("en-US"));
 }
--- a/intl/locale/windows/OSPreferences_win.cpp
+++ b/intl/locale/windows/OSPreferences_win.cpp
@@ -59,17 +59,17 @@ OSPreferences::ReadRegionalPrefsLocales(
  * For DateTimePattern, we want to retrieve the User Locale.
  */
 static void
 ReadUserLocale(nsCString& aRetVal)
 {
   WCHAR locale[LOCALE_NAME_MAX_LENGTH];
   if (NS_WARN_IF(!LCIDToLocaleName(LOCALE_USER_DEFAULT, locale,
                                    LOCALE_NAME_MAX_LENGTH, 0))) {
-    aRetVal.Assign("en-US");
+    aRetVal.AssignLiteral("en-US");
     return;
   }
 
   LossyCopyUTF16toASCII(locale, aRetVal);
 }
 
 static LCTYPE
 ToDateLCType(OSPreferences::DateTimeFormatStyle aFormatStyle)
--- a/intl/unicharutil/util/ICUUtils.cpp
+++ b/intl/unicharutil/util/ICUUtils.cpp
@@ -1,14 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifdef MOZILLA_INTERNAL_API
-#ifdef ENABLE_INTL_API
 
 #include "ICUUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/intl/LocaleService.h"
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsStringGlue.h"
 #include "unicode/uloc.h"
@@ -269,11 +268,10 @@ ICUUtils::ToICUString(nsAString& aMozStr
   aICUString.setTo((UChar*)PromiseFlatString(aMozString).get(),
                    aMozString.Length());
 
   NS_ASSERTION(aMozString.Length() == (uint32_t)aICUString.length(),
                "Conversion failed");
 }
 #endif
 
-#endif /* ENABLE_INTL_API */
 #endif /* MOZILLA_INTERNAL_API */
 
--- a/intl/unicharutil/util/ICUUtils.h
+++ b/intl/unicharutil/util/ICUUtils.h
@@ -1,19 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_ICUUtils_h__
 #define mozilla_ICUUtils_h__
 
-// We only build the ICU utils if we're building ICU:
-#ifdef ENABLE_INTL_API
-
 // The ICU utils implementation needs internal things like XPCOM strings and
 // nsGkAtom, so we only build when included into internal libs:
 #ifdef MOZILLA_INTERNAL_API
 
 #include "mozilla/Scoped.h"
 #include "nsStringGlue.h"
 #include "unicode/unum.h" // for UNumberFormat
 
@@ -100,12 +97,11 @@ public:
    */
   static Locale BCP47CodeToLocale(const nsAString& aBCP47Code);
 
   static void ToMozString(UnicodeString& aICUString, nsAString& aMozString);
   static void ToICUString(nsAString& aMozString, UnicodeString& aICUString);
 #endif
 };
 
-#endif /* ENABLE_INTL_API */
 #endif /* MOZILLA_INTERNAL_API */
 
 #endif /* mozilla_ICUUtils_h__ */
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
@@ -12,21 +12,17 @@ EXPORTS += [
     'nsSpecialCasingData.h',
     'nsUnicharUtils.h',
     'nsUnicodeProperties.h',
     'nsUnicodeScriptCodes.h',
 ]
 
 UNIFIED_SOURCES += [
     'GreekCasing.cpp',
+    'ICUUtils.cpp',
     'IrishCasing.cpp',
     'nsBidiUtils.cpp',
     'nsSpecialCasingData.cpp',
     'nsUnicharUtils.cpp',
     'nsUnicodeProperties.cpp',
 ]
 
-if CONFIG['ENABLE_INTL_API']:
-    UNIFIED_SOURCES += [
-        'ICUUtils.cpp',
-    ]
-
 FINAL_LIBRARY = 'xul'
--- a/ipc/glue/CrashReporterHost.cpp
+++ b/ipc/glue/CrashReporterHost.cpp
@@ -254,17 +254,17 @@ CrashReporterHost::NotifyCrashService(Ge
       processType = nsICrashService::PROCESS_TYPE_CONTENT;
       telemetryKey.AssignLiteral("content");
       break;
     case GeckoProcessType_Plugin: {
       processType = nsICrashService::PROCESS_TYPE_PLUGIN;
       telemetryKey.AssignLiteral("plugin");
       nsAutoCString val;
       if (aNotes->Get(NS_LITERAL_CSTRING("PluginHang"), &val) &&
-        val.Equals(NS_LITERAL_CSTRING("1"))) {
+        val.EqualsLiteral("1")) {
         crashType = nsICrashService::CRASH_TYPE_HANG;
         telemetryKey.AssignLiteral("pluginhang");
       }
       break;
     }
     case GeckoProcessType_GMPlugin:
       processType = nsICrashService::PROCESS_TYPE_GMPLUGIN;
       telemetryKey.AssignLiteral("gmplugin");
--- 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
@@ -121,20 +121,20 @@ ReportError(JSContext* cx, const char* o
     if (!uri) {
         ReportError(cx, nsDependentCString(origMsg));
         return;
     }
 
     nsAutoCString spec;
     nsresult rv = uri->GetSpec(spec);
     if (NS_FAILED(rv))
-        spec.Assign("(unknown)");
+        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/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -1725,17 +1725,17 @@ ReportCompartmentStats(const JS::Compart
         nsAutoCString addonId;
         bool ok;
         if (NS_SUCCEEDED(addonManager->MapURIToAddonID(extras.location,
                                                         addonId, &ok))
             && ok) {
             // Insert the add-on id as "add-ons/@id@/" after "explicit/" to
             // aggregate add-on compartments.
             static const size_t explicitLength = strlen("explicit/");
-            addonId.Insert(NS_LITERAL_CSTRING("add-ons/"), 0);
+            addonId.InsertLiteral("add-ons/", 0);
             addonId += "/";
             cJSPathPrefix.Insert(addonId, explicitLength);
             cDOMPathPrefix.Insert(addonId, explicitLength);
         }
     }
 
     nsCString nonNotablePath = cJSPathPrefix;
     nonNotablePath += cStats.isTotals
--- a/js/xpconnect/src/XPCShellImpl.cpp
+++ b/js/xpconnect/src/XPCShellImpl.cpp
@@ -1426,20 +1426,21 @@ XRE_XPCShellMain(int argc, char** argv, 
     return result;
 }
 
 void
 XPCShellDirProvider::SetGREDirs(nsIFile* greDir)
 {
     mGREDir = greDir;
     mGREDir->Clone(getter_AddRefs(mGREBinDir));
+
 #ifdef XP_MACOSX
     nsAutoCString leafName;
     mGREDir->GetNativeLeafName(leafName);
-    if (leafName.Equals("Resources")) {
+    if (leafName.EqualsLiteral("Resources")) {
         mGREBinDir->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS"));
     }
 #endif
 }
 
 void
 XPCShellDirProvider::SetAppFile(nsIFile* appFile)
 {
--- 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/generic/nsFrameState.cpp
+++ b/layout/generic/nsFrameState.cpp
@@ -47,19 +47,19 @@ GetFrameState(nsIFrame* aFrame)
     class_* frame = do_QueryFrame(aFrame);                                    \
     if (frame && (groups.IsEmpty() || strcmp(groups.LastElement(), #name_))) {\
       groups.AppendElement(#name_);                                           \
     }                                                                         \
   }
 #define FRAME_STATE_BIT(group_, value_, name_)                                \
   if ((state & NS_FRAME_STATE_BIT(value_)) && groups.Contains(#group_)) {     \
     if (!result.IsEmpty()) {                                                  \
-      result.Insert(" | ", 0);                                                \
+      result.InsertLiteral(" | ", 0);                                         \
     }                                                                         \
-    result.Insert(#name_, 0);                                                 \
+    result.InsertLiteral(#name_, 0);                                          \
     state = state & ~NS_FRAME_STATE_BIT(value_);                              \
   }
 #include "nsFrameStateBits.h"
 #undef FRAME_STATE_GROUP
 #undef FRAME_STATE_BIT
 
   if (state) {
     result.AppendPrintf(" | 0x%0" PRIx64, static_cast<uint64_t>(state));
--- 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/CounterStyleManager.cpp
+++ b/layout/style/CounterStyleManager.cpp
@@ -487,17 +487,17 @@ EthiopicToText(CounterValue aOrdinal, ns
   uint8_t asciiStringLength = asciiNumberString.Length();
 
   // If number length is odd, add a leading "0"
   // the leading "0" preconditions the string to always have the
   // leading tens place populated, this avoids a check within the loop.
   // If we didn't add the leading "0", decrement asciiStringLength so
   // it will be equivalent to a zero-based index in both cases.
   if (asciiStringLength & 1) {
-    asciiNumberString.Insert(NS_LITERAL_STRING("0"), 0);
+    asciiNumberString.InsertLiteral(u"0", 0);
   } else {
     asciiStringLength--;
   }
 
   aResult.Truncate();
   // Iterate from the highest digits to lowest
   // indexFromLeft       indexes digits (0 = most significant)
   // groupIndexFromRight indexes pairs of digits (0 = least significant)
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -658,17 +658,17 @@ FontFaceSet::StartLoad(gfxUserFontEntry*
   nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
   if (httpChannel) {
     rv = httpChannel->SetReferrerWithPolicy(aFontFaceSrc->mReferrer,
                                             mDocument->GetReferrerPolicy());
     Unused << NS_WARN_IF(NS_FAILED(rv));
 
     nsAutoCString accept("application/font-woff;q=0.9,*/*;q=0.8");
     if (Preferences::GetBool(GFX_PREF_WOFF2_ENABLED)) {
-      accept.Insert(NS_LITERAL_CSTRING("application/font-woff2;q=1.0,"), 0);
+      accept.InsertLiteral("application/font-woff2;q=1.0,", 0);
     }
     rv = httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
                                        accept, false);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // For WOFF and WOFF2, we should tell servers/proxies/etc NOT to try
     // and apply additional compression at the content-encoding layer
     if (aFontFaceSrc->mFormatFlags & (gfxUserFontSet::FLAG_FORMAT_WOFF |
--- a/layout/style/StyleRule.cpp
+++ b/layout/style/StyleRule.cpp
@@ -868,17 +868,17 @@ nsCSSSelector::AppendToStringWithoutComb
 
         aString.Append(char16_t('='));
 
         // Append the value
         nsStyleUtil::AppendEscapedCSSString(list->mValue, aString);
 
         if (list->mValueCaseSensitivity ==
               nsAttrSelector::ValueCaseSensitivity::CaseInsensitive) {
-          aString.Append(NS_LITERAL_STRING(" i"));
+          aString.AppendLiteral(u" i");
         }
       }
 
       aString.Append(char16_t(']'));
 
       list = list->mNext;
     }
   }
@@ -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/modules/libjar/nsJAR.cpp
+++ b/modules/libjar/nsJAR.cpp
@@ -596,17 +596,17 @@ nsZipReaderCache::IsCached(nsIFile* zipF
   nsresult rv;
   MutexAutoLock lock(mLock);
 
   nsAutoCString uri;
   rv = zipFile->GetNativePath(uri);
   if (NS_FAILED(rv))
     return rv;
 
-  uri.Insert(NS_LITERAL_CSTRING("file:"), 0);
+  uri.InsertLiteral("file:", 0);
 
   *aResult = mZips.Contains(uri);
   return NS_OK;
 }
 
 nsresult
 nsZipReaderCache::GetZip(nsIFile* zipFile, nsIZipReader* *result,
                          bool failOnMiss)
@@ -618,17 +618,17 @@ nsZipReaderCache::GetZip(nsIFile* zipFil
 #ifdef ZIP_CACHE_HIT_RATE
   mZipCacheLookups++;
 #endif
 
   nsAutoCString uri;
   rv = zipFile->GetNativePath(uri);
   if (NS_FAILED(rv)) return rv;
 
-  uri.Insert(NS_LITERAL_CSTRING("file:"), 0);
+  uri.InsertLiteral("file:", 0);
 
   RefPtr<nsJAR> zip;
   mZips.Get(uri, getter_AddRefs(zip));
   if (zip) {
 #ifdef ZIP_CACHE_HIT_RATE
     mZipCacheHits++;
 #endif
     zip->ClearReleaseTime();
@@ -678,17 +678,17 @@ nsZipReaderCache::GetInnerZip(nsIFile* z
 #ifdef ZIP_CACHE_HIT_RATE
   mZipCacheLookups++;
 #endif
 
   nsAutoCString uri;
   rv = zipFile->GetNativePath(uri);
   if (NS_FAILED(rv)) return rv;
 
-  uri.Insert(NS_LITERAL_CSTRING("jar:"), 0);
+  uri.InsertLiteral("jar:", 0);
   uri.AppendLiteral("!/");
   uri.Append(entry);
 
   RefPtr<nsJAR> zip;
   mZips.Get(uri, getter_AddRefs(zip));
   if (zip) {
 #ifdef ZIP_CACHE_HIT_RATE
     mZipCacheHits++;
@@ -722,17 +722,17 @@ nsZipReaderCache::GetFd(nsIFile* zipFile
   }
 
   nsresult rv;
   nsAutoCString uri;
   rv = zipFile->GetNativePath(uri);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  uri.Insert(NS_LITERAL_CSTRING("file:"), 0);
+  uri.InsertLiteral("file:", 0);
 
   MutexAutoLock lock(mLock);
   RefPtr<nsJAR> zip;
   mZips.Get(uri, getter_AddRefs(zip));
   if (!zip) {
     return NS_ERROR_FAILURE;
   }
 
@@ -810,19 +810,19 @@ nsZipReaderCache::ReleaseZip(nsJAR* zip)
 
   // remove from hashtable
   nsAutoCString uri;
   rv = oldest->GetJarPath(uri);
   if (NS_FAILED(rv))
     return rv;
 
   if (oldest->mOuterZipEntry.IsEmpty()) {
-    uri.Insert(NS_LITERAL_CSTRING("file:"), 0);
+    uri.InsertLiteral("file:", 0);
   } else {
-    uri.Insert(NS_LITERAL_CSTRING("jar:"), 0);
+    uri.InsertLiteral("jar:", 0);
     uri.AppendLiteral("!/");
     uri.Append(oldest->mOuterZipEntry);
   }
 
   // Retrieving and removing the JAR must be done without an extra AddRef
   // and Release, or we'll trigger nsJAR::Release's magic refcount 1 case
   // an extra time and trigger a deadlock.
   RefPtr<nsJAR> removed;
@@ -869,17 +869,17 @@ nsZipReaderCache::Observe(nsISupports *a
 
     if (!file)
       return NS_OK;
 
     nsAutoCString uri;
     if (NS_FAILED(file->GetNativePath(uri)))
       return NS_OK;
 
-    uri.Insert(NS_LITERAL_CSTRING("file:"), 0);
+    uri.InsertLiteral("file:", 0);
 
     MutexAutoLock lock(mLock);
 
     RefPtr<nsJAR> zip;
     mZips.Get(uri, getter_AddRefs(zip));
     if (!zip)
       return NS_OK;
 
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -595,17 +595,17 @@ nsJARChannel::GetSecurityInfo(nsISupport
 }
 
 NS_IMETHODIMP
 nsJARChannel::GetContentType(nsACString &result)
 {
     // If the Jar file has not been open yet,
     // We return application/x-unknown-content-type
     if (!mOpened) {
-      result.Assign(UNKNOWN_CONTENT_TYPE);
+      result.AssignLiteral(UNKNOWN_CONTENT_TYPE);
       return NS_OK;
     }
 
     if (mContentType.IsEmpty()) {
 
         //
         // generate content type and set it
         //
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -1153,17 +1153,17 @@ Preferences::ReadUserOverridePrefs()
 nsresult
 Preferences::MakeBackupPrefFile(nsIFile *aFile)
 {
   // Example: this copies "prefs.js" to "Invalidprefs.js" in the same directory.
   // "Invalidprefs.js" is removed if it exists, prior to making the copy.
   nsAutoString newFilename;
   nsresult rv = aFile->GetLeafName(newFilename);
   NS_ENSURE_SUCCESS(rv, rv);
-  newFilename.Insert(NS_LITERAL_STRING("Invalid"), 0);
+  newFilename.InsertLiteral(u"Invalid", 0);
   nsCOMPtr<nsIFile> newFile;
   rv = aFile->GetParent(getter_AddRefs(newFile));
   NS_ENSURE_SUCCESS(rv, rv);
   rv = newFile->Append(newFilename);
   NS_ENSURE_SUCCESS(rv, rv);
   bool exists = false;
   newFile->Exists(&exists);
   if (exists) {
--- a/netwerk/base/Dashboard.cpp
+++ b/netwerk/base/Dashboard.cpp
@@ -883,18 +883,18 @@ HttpConnInfo::SetHTTP1ProtocolVersion(ui
     default:
         protocolVersion.AssignLiteral(u"unknown protocol version");
     }
 }
 
 void
 HttpConnInfo::SetHTTP2ProtocolVersion(uint8_t pv)
 {
-    MOZ_ASSERT (pv == HTTP_VERSION_2);
-    protocolVersion.Assign(u"h2");
+    MOZ_ASSERT(pv == HTTP_VERSION_2);
+    protocolVersion.AssignLiteral(u"h2");
 }
 
 NS_IMETHODIMP
 Dashboard::GetLogPath(nsACString &aLogPath)
 {
     aLogPath.SetCapacity(2048);
     uint32_t len = LogModule::GetLogFile(aLogPath.BeginWriting(), 2048);
     aLogPath.SetLength(len);
--- a/netwerk/base/nsIURI.idl
+++ b/netwerk/base/nsIURI.idl
@@ -97,17 +97,17 @@ interface nsIURI : nsISupports
     // string if GetSpec() fails. It is most useful for creating
     // logging/warning/error messages produced for human consumption, and when
     // matching a URI spec against a fixed spec such as about:blank.
     nsCString GetSpecOrDefault()
     {
         nsCString spec;
         nsresult rv = GetSpec(spec);
         if (NS_FAILED(rv)) {
-            spec.Assign("[nsIURI::GetSpec failed]");
+            spec.AssignLiteral("[nsIURI::GetSpec failed]");
         }
         return spec;
     }
 %}
 
     /**
      * The prePath (eg. scheme://user:password@host:port) returns the string
      * before the path.  This is useful for authentication or managing sessions.
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -1097,18 +1097,17 @@ nsSocketTransport::ResolveHost()
         if (!mProxyTransparent || mProxyTransparentResolvesHost) {
 #if defined(XP_UNIX)
             MOZ_ASSERT(!mNetAddrIsSet || mNetAddr.raw.family != AF_LOCAL,
                        "Unix domain sockets can't be used with proxies");
 #endif
             // When not resolving mHost locally, we still want to ensure that
             // it only contains valid characters.  See bug 304904 for details.
             // Sometimes the end host is not yet known and mHost is *
-            if (!net_IsValidHostName(mHost) &&
-                !mHost.Equals(NS_LITERAL_CSTRING("*"))) {
+            if (!net_IsValidHostName(mHost) && !mHost.EqualsLiteral("*")) {
                 SOCKET_LOG(("  invalid hostname %s\n", mHost.get()));
                 return NS_ERROR_UNKNOWN_HOST;
             }
         }
         if (mProxyTransparentResolvesHost) {
             // Name resolution is done on the server side.  Just pretend
             // client resolution is complete, this will get picked up later.
             // since we don't need to do DNS now, we bypass the resolving
--- a/netwerk/base/nsURLHelperOSX.cpp
+++ b/netwerk/base/nsURLHelperOSX.cpp
@@ -171,17 +171,17 @@ net_GetFileFromURLSpec(const nsACString 
     // Determine that here and normalize HFS paths to POSIX.
     nsAutoCString possibleVolName;
     if (pathBeginsWithVolName(directory, possibleVolName)) {
       // Though we know it begins with a volume name, it could still
       // be a valid POSIX path if the boot drive is named "Mac HD"
       // and there is a directory "Mac HD" at its root. If such a
       // directory doesn't exist, we'll assume this is an HFS path.
       FSRef testRef;
-      possibleVolName.Insert("/", 0);
+      possibleVolName.InsertLiteral("/", 0);
       if (::FSPathMakeRef((UInt8*)possibleVolName.get(), &testRef, nullptr) != noErr)
         bHFSPath = true;
     }
 
     if (bHFSPath) {
       // "%2F"s need to become slashes, while all other slashes need to
       // become colons. If we start out by changing "%2F"s to colons, we
       // can reply on SwapSlashColon() to do what we need
--- 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, "
@@ -2583,17 +2583,17 @@ nsCookieService::Remove(const nsACString
   }
 
   // check if we need to add the host to the permissions blacklist.
   if (aBlocked && mPermissionService) {
     // strip off the domain dot, if necessary
     if (!host.IsEmpty() && host.First() == '.')
       host.Cut(0, 1);
 
-    host.Insert(NS_LITERAL_CSTRING("http://"), 0);
+    host.InsertLiteral("http://", 0);
 
     nsCOMPtr<nsIURI> uri;
     NS_NewURI(getter_AddRefs(uri), host);
 
     if (uri)
       mPermissionService->SetAccess(uri, nsICookiePermission::ACCESS_DENY);
   }
 
@@ -4294,17 +4294,17 @@ nsCookieService::CheckDomain(nsCookieAtt
     if (aRequireHostMatch)
       return hostFromURI.Equals(aCookieAttributes.host);
 
     // ensure the proposed domain is derived from the base domain; and also
     // that the host domain is derived from the proposed domain (per RFC2109).
     if (IsSubdomainOf(aCookieAttributes.host, aBaseDomain) &&
         IsSubdomainOf(hostFromURI, aCookieAttributes.host)) {
       // prepend a dot to indicate a domain cookie
-      aCookieAttributes.host.Insert(NS_LITERAL_CSTRING("."), 0);
+      aCookieAttributes.host.InsertLiteral(".", 0);
       return true;
     }
 
     /*
      * note: RFC2109 section 4.3.2 requires that we check the following:
      * that the portion of host not in domain does not contain a dot.
      * this prevents hosts of the form x.y.co.nz from setting cookies in the
      * entire .co.nz domain. however, it's only a only a partial solution and
--- 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/about/nsAboutCache.cpp
+++ b/netwerk/protocol/about/nsAboutCache.cpp
@@ -495,19 +495,19 @@ nsAboutCache::Channel::OnCacheEntryInfo(
     } else {
         mBuffer.AppendLiteral("No expiration time");
     }
     mBuffer.AppendLiteral("</td>\n");
 
     // Pinning
     mBuffer.AppendLiteral("    <td>");
     if (aPinned) {
-      mBuffer.Append(NS_LITERAL_CSTRING("Pinned"));
+      mBuffer.AppendLiteral("Pinned");
     } else {
-      mBuffer.Append(NS_LITERAL_CSTRING("&nbsp;"));
+      mBuffer.AppendLiteral("&nbsp;");
     }
     mBuffer.AppendLiteral("</td>\n");
 
     // Entry is done...
     mBuffer.AppendLiteral("  </tr>\n");
 
     return FlushBuffer();
 }
--- a/netwerk/protocol/about/nsAboutProtocolHandler.cpp
+++ b/netwerk/protocol/about/nsAboutProtocolHandler.cpp
@@ -137,17 +137,17 @@ nsAboutProtocolHandler::NewURI(const nsA
         // We need to indicate that this baby is safe.  Use an inner URI that
         // no one but the security manager will see.  Make sure to preserve our
         // path, in case someone decides to hardcode checks for particular
         // about: URIs somewhere.
         nsAutoCString spec;
         rv = url->GetPathQueryRef(spec);
         NS_ENSURE_SUCCESS(rv, rv);
 
-        spec.Insert("moz-safe-about:", 0);
+        spec.InsertLiteral("moz-safe-about:", 0);
 
         nsCOMPtr<nsIURI> inner;
         rv = NS_NewURI(getter_AddRefs(inner), spec);
         NS_ENSURE_SUCCESS(rv, rv);
 
         nsSimpleNestedURI* outer = new nsNestedAboutURI(inner, aBaseURI);
         NS_ENSURE_TRUE(outer, NS_ERROR_OUT_OF_MEMORY);
 
--- a/netwerk/protocol/about/nsAboutProtocolUtils.h
+++ b/netwerk/protocol/about/nsAboutProtocolUtils.h
@@ -42,17 +42,17 @@ NS_GetAboutModule(nsIURI *aAboutURI, nsI
 {
   NS_PRECONDITION(aAboutURI, "Must have URI");
 
   nsAutoCString contractID;
   nsresult rv = NS_GetAboutModuleName(aAboutURI, contractID);
   if (NS_FAILED(rv)) return rv;
 
   // look up a handler to deal with "what"
-  contractID.Insert(NS_LITERAL_CSTRING(NS_ABOUT_MODULE_CONTRACTID_PREFIX), 0);
+  contractID.InsertLiteral(NS_ABOUT_MODULE_CONTRACTID_PREFIX, 0);
 
   return CallGetService(contractID.get(), aModule);
 }
 
 inline PRTime SecondsToPRTime(uint32_t t_sec)
 {
     PRTime t_usec, usec_per_sec;
     t_usec = t_sec;
@@ -62,10 +62,9 @@ inline PRTime SecondsToPRTime(uint32_t t
 inline void PrintTimeString(char *buf, uint32_t bufsize, uint32_t t_sec)
 {
     PRExplodedTime et;
     PRTime t_usec = SecondsToPRTime(t_sec);
     PR_ExplodeTime(t_usec, PR_LocalTimeParameters, &et);
     PR_FormatTime(buf, bufsize, "%Y-%m-%d %H:%M:%S", &et);
 }
 
-
 #endif
--- 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
@@ -1010,18 +1012,18 @@ 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.InsertLiteral("CWD ", 0);
+    cwdStr.AppendLiteral(CRLF);
 
     return SendFTPCommand(cwdStr);
 }
 
 FTP_STATE
 nsFtpState::R_cwd() {
     if (mResponseCode/100 == 2) {
         if (mAction == PUT)
@@ -1035,18 +1037,18 @@ 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.InsertLiteral("SIZE ", 0);
+    sizeBuf.AppendLiteral(CRLF);
 
     return SendFTPCommand(sizeBuf);
 }
 
 FTP_STATE
 nsFtpState::R_size() {
     if (mResponseCode/100 == 2) {
         PR_sscanf(mResponseMsg.get() + 4, "%llu", &mFileSize);
@@ -1059,18 +1061,18 @@ 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.InsertLiteral("MDTM ", 0);
+    mdtmBuf.AppendLiteral(CRLF);
 
     return SendFTPCommand(mdtmBuf);
 }
 
 FTP_STATE
 nsFtpState::R_mdtm() {
     if (mResponseCode == 213) {
         mResponseMsg.Cut(0,4);
@@ -1202,18 +1204,19 @@ 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.InsertLiteral("RETR ", 0);
+    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
@@ -1282,18 +1283,18 @@ nsFtpState::S_stor() {
     // kill the first slash since we want to be relative to CWD.
     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.InsertLiteral("STOR ", 0);
+    storStr.AppendLiteral(CRLF);
 
     return SendFTPCommand(storStr);
 }
 
 FTP_STATE
 nsFtpState::R_stor() {
     if (mResponseCode/100 == 2) {
         //(DONE)
@@ -2188,9 +2189,8 @@ nsFtpState::OnCallbackPending()
             mDeferredCallbackPending = true;
             return;
         }
         Connect();
     } else if (mDataStream) {
         mDataStream->AsyncWait(this, 0, 0, CallbackTarget());
     }
 }
-
--- a/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
+++ b/netwerk/protocol/gio/nsGIOProtocolHandler.cpp
@@ -956,17 +956,17 @@ nsGIOProtocolHandler::IsSupportedProtoco
     return false;
 
   return true;
 }
 
 NS_IMETHODIMP
 nsGIOProtocolHandler::GetScheme(nsACString &aScheme)
 {
-  aScheme.Assign(MOZ_GIO_SCHEME);
+  aScheme.AssignLiteral(MOZ_GIO_SCHEME);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsGIOProtocolHandler::GetDefaultPort(int32_t *aDefaultPort)
 {
   *aDefaultPort = -1;
   return NS_OK;
--- a/netwerk/protocol/http/AlternateServices.cpp
+++ b/netwerk/protocol/http/AlternateServices.cpp
@@ -32,19 +32,19 @@ namespace net {
 
 // function places true in outIsHTTPS if scheme is https, false if
 // http, and returns an error if neither. originScheme passed into
 // alternate service should already be normalized to those lower case
 // strings by the URI parser (and so there is an assert)- this is an extra check.
 static nsresult
 SchemeIsHTTPS(const nsACString &originScheme, bool &outIsHTTPS)
 {
-  outIsHTTPS = originScheme.Equals(NS_LITERAL_CSTRING("https"));
+  outIsHTTPS = originScheme.EqualsLiteral("https");
 
-  if (!outIsHTTPS && !originScheme.Equals(NS_LITERAL_CSTRING("http"))) {
+  if (!outIsHTTPS && !originScheme.EqualsLiteral("http")) {
       MOZ_ASSERT(false, "unexpected scheme");
       return NS_ERROR_UNEXPECTED;
   }
   return NS_OK;
 }
 
 void
 AltSvcMapping::ProcessHeader(const nsCString &buf, const nsCString &originScheme,
@@ -87,32 +87,32 @@ AltSvcMapping::ProcessHeader(const nsCSt
          pairIndex < parsedAltSvc.mValues[index].mValues.Length();
          ++pairIndex) {
       nsDependentCSubstring &currentName =
         parsedAltSvc.mValues[index].mValues[pairIndex].mName;
       nsDependentCSubstring &currentValue =
         parsedAltSvc.mValues[index].mValues[pairIndex].mValue;
 
       if (!pairIndex) {
-        if (currentName.Equals(NS_LITERAL_CSTRING("clear"))) {
+        if (currentName.EqualsLiteral("clear")) {
           clearEntry = true;
           break;
         }
 
         // h2=[hostname]:443
         npnToken = currentName;
         int32_t colonIndex = currentValue.FindChar(':');
         if (colonIndex >= 0) {
           portno =
             atoi(PromiseFlatCString(currentValue).get() + colonIndex + 1);
         } else {
           colonIndex = 0;
         }
         hostname.Assign(currentValue.BeginReading(), colonIndex);
-      } else if (currentName.Equals(NS_LITERAL_CSTRING("ma"))) {
+      } else if (currentName.EqualsLiteral("ma")) {
         maxage = atoi(PromiseFlatCString(currentValue).get());
         break;
       } else {
         LOG(("Alt Svc ignoring parameter %s", currentName.BeginReading()));
       }
     }
 
     if (clearEntry) {
@@ -223,17 +223,17 @@ AltSvcMapping::MakeHashKey(nsCString &ou
                            const nsACString &originHost,
                            int32_t originPort,
                            bool privateBrowsing,
                            const OriginAttributes &originAttributes)
 {
   outKey.Truncate();
 
   if (originPort == -1) {
-    bool isHttps = originScheme.Equals("https");
+    bool isHttps = originScheme.EqualsLiteral("https");
     originPort = isHttps ? NS_HTTPS_DEFAULT_PORT : NS_HTTP_DEFAULT_PORT;
   }
 
   outKey.Append(originScheme);
   outKey.Append(':');
   outKey.Append(originHost);
   outKey.Append(':');
   outKey.AppendInt(originPort);
@@ -383,39 +383,39 @@ AltSvcMapping::AltSvcMapping(DataStorage
   do {
 #ifdef _NS_NEXT_TOKEN
 COMPILER ERROR
 #endif
     #define _NS_NEXT_TOKEN start = idx + 1; idx = str.FindChar(':', start); if (idx < 0) break;
     int32_t start = 0;
     int32_t idx;
     idx = str.FindChar(':', start); if (idx < 0) break;
-    mHttps = Substring(str, start, idx - start).Equals(NS_LITERAL_CSTRING("https"));
+    mHttps = Substring(str, start, idx - start).EqualsLiteral("https");
     _NS_NEXT_TOKEN;
     mOriginHost = Substring(str, start, idx - start);
     _NS_NEXT_TOKEN;
     mOriginPort = nsCString(Substring(str, start, idx - start)).ToInteger(&code);
     _NS_NEXT_TOKEN;
     mAlternateHost = Substring(str, start, idx - start);
     _NS_NEXT_TOKEN;
     mAlternatePort = nsCString(Substring(str, start, idx - start)).ToInteger(&code);
     _NS_NEXT_TOKEN;
     mUsername = Substring(str, start, idx - start);
     _NS_NEXT_TOKEN;
-    mPrivate = Substring(str, start, idx - start).Equals(NS_LITERAL_CSTRING("y"));
+    mPrivate = Substring(str, start, idx - start).EqualsLiteral("y");
     _NS_NEXT_TOKEN;
     mExpiresAt = nsCString(Substring(str, start, idx - start)).ToInteger(&code);
     _NS_NEXT_TOKEN;
     mNPNToken = Substring(str, start, idx - start);
     _NS_NEXT_TOKEN;
-    mValidated = Substring(str, start, idx - start).Equals(NS_LITERAL_CSTRING("y"));
+    mValidated = Substring(str, start, idx - start).EqualsLiteral("y");
     _NS_NEXT_TOKEN;
     mStorageEpoch = nsCString(Substring(str, start, idx - start)).ToInteger(&code);
     _NS_NEXT_TOKEN;
-    mMixedScheme = Substring(str, start, idx - start).Equals(NS_LITERAL_CSTRING("y"));
+    mMixedScheme = Substring(str, start, idx - start).EqualsLiteral("y");
     _NS_NEXT_TOKEN;
     Unused << mOriginAttributes.PopulateFromSuffix(Substring(str, start, idx - start));
     #undef _NS_NEXT_TOKEN
 
     MakeHashKey(mHashKey, mHttps ? NS_LITERAL_CSTRING("https") : NS_LITERAL_CSTRING("http"),
                 mOriginHost, mOriginPort, mPrivate, mOriginAttributes);
   } while (false);
 }
@@ -601,17 +601,17 @@ public:
         LOG(("WellKnownChecker::Done %p alternate was not at least h2\n", this));
       } else if (!mTransactionAlternate->mWKResponse.Equals(mTransactionOrigin->mWKResponse)) {
         LOG(("WellKnownChecker::Done %p alternate and origin "
              ".wk representations don't match\norigin: %s\alternate:%s\n", this,
              mTransactionOrigin->mWKResponse.get(),
              mTransactionAlternate->mWKResponse.get()));
       } else if (!mAlternateCT.Equals(mOriginCT)) {
         LOG(("WellKnownChecker::Done %p alternate and origin content types dont match\n", this));
-      } else if (!mAlternateCT.Equals(NS_LITERAL_CSTRING("application/json"))) {
+      } else if (!mAlternateCT.EqualsLiteral("application/json")) {
         LOG(("WellKnownChecker::Done %p .wk content type is %s\n", this, mAlternateCT.get()));
       } else if (!uu) {
         LOG(("WellKnownChecker::Done %p json parser service unavailable\n", this));
       } else {
         accepted = true;
       }
 
       if (accepted) {
@@ -915,17 +915,17 @@ AltSvcCache::UpdateAltServiceMapping(Alt
     nsAutoCString origin (NS_LITERAL_CSTRING("http://") + map->OriginHost());
     if (map->OriginPort() != NS_HTTP_DEFAULT_PORT) {
       origin.Append(':');
       origin.AppendInt(map->OriginPort());
     }
 
     nsCOMPtr<nsIURI> wellKnown;
     nsAutoCString uri(origin);
-    uri.Append(NS_LITERAL_CSTRING("/.well-known/http-opportunistic"));
+    uri.AppendLiteral("/.well-known/http-opportunistic");
     NS_NewURI(getter_AddRefs(wellKnown), uri);
 
     auto *checker = new WellKnownChecker(wellKnown, origin, caps, ci, map);
     if (NS_FAILED(checker->Start())) {
       LOG(("AltSvcCache::UpdateAltServiceMapping %p .wk checker failed to start\n", this));
       map->SetExpired();
       delete checker;
       checker = nullptr;
--- 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/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -1229,21 +1229,21 @@ HttpBaseChannel::DoApplyContentConversio
       if (NS_FAILED(rv)) {
         LOG(("Unexpected failure of AsyncConvertData %s\n", val));
         return rv;
       }
 
       LOG(("converter removed '%s' content-encoding\n", val));
       if (gHttpHandler->IsTelemetryEnabled()) {
         int mode = 0;
-        if (from.Equals("gzip") || from.Equals("x-gzip")) {
+        if (from.EqualsLiteral("gzip") || from.EqualsLiteral("x-gzip")) {
           mode = 1;
-        } else if (from.Equals("deflate") || from.Equals("x-deflate")) {
+        } else if (from.EqualsLiteral("deflate") || from.EqualsLiteral("x-deflate")) {
           mode = 2;
-        } else if (from.Equals("br")) {
+        } else if (from.EqualsLiteral("br")) {
           mode = 3;
         }
         Telemetry::Accumulate(Telemetry::HTTP_CONTENT_ENCODING, mode);
       }
       nextListener = converter;
     }
     else {
       if (val)
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -2237,18 +2237,18 @@ nsHttpChannel::ProcessAltService()
     }
 
     if (!gHttpHandler->AllowAltSvc() || (mCaps & NS_HTTP_DISALLOW_SPDY)) {
         return;
     }
 
     nsAutoCString scheme;
     mURI->GetScheme(scheme);
-    bool isHttp = scheme.Equals(NS_LITERAL_CSTRING("http"));
-    if (!isHttp && !scheme.Equals(NS_LITERAL_CSTRING("https"))) {
+    bool isHttp = scheme.EqualsLiteral("http");
+    if (!isHttp && !scheme.EqualsLiteral("https")) {
         return;
     }
 
     nsAutoCString altSvc;
     Unused << mResponseHead->GetHeader(nsHttp::Alternate_Service, altSvc);
     if (altSvc.IsEmpty()) {
         return;
     }
@@ -6396,18 +6396,18 @@ nsHttpChannel::BeginConnect()
     SetDoNotTrack();
 
     OriginAttributes originAttributes;
     NS_GetOriginAttributes(this, originAttributes);
 
     RefPtr<AltSvcMapping> mapping;
     if (!mConnectionInfo && mAllowAltSvc && // per channel
         !(mLoadFlags & LOAD_FRESH_CONNECTION) &&
-        (scheme.Equals(NS_LITERAL_CSTRING("http")) ||
-         scheme.Equals(NS_LITERAL_CSTRING("https"))) &&
+        (scheme.EqualsLiteral("http") ||
+         scheme.EqualsLiteral("https")) &&
         (!proxyInfo || proxyInfo->IsDirect()) &&
         (mapping = gHttpHandler->GetAltServiceMapping(scheme,
                                                       host, port,
                                                       mPrivateBrowsing,
                                                       originAttributes))) {
         LOG(("nsHttpChannel %p Alt Service Mapping Found %s://%s:%d [%s]\n",
              this, scheme.get(), mapping->AlternateHost().get(),
              mapping->AlternatePort(), mapping->HashKey().get()));
@@ -6424,25 +6424,25 @@ nsHttpChannel::BeginConnect()
             MOZ_ASSERT(NS_SUCCEEDED(rv));
         }
 
         nsCOMPtr<nsIConsoleService> consoleService =
             do_GetService(NS_CONSOLESERVICE_CONTRACTID);
         if (consoleService) {
             nsAutoString message(NS_LITERAL_STRING("Alternate Service Mapping found: "));
             AppendASCIItoUTF16(scheme.get(), message);
-            message.Append(NS_LITERAL_STRING("://"));
+            message.AppendLiteral(u"://");
             AppendASCIItoUTF16(host.get(), message);
-            message.Append(NS_LITERAL_STRING(":"));
+            message.AppendLiteral(u":");
             message.AppendInt(port);
-            message.Append(NS_LITERAL_STRING(" to "));
+            message.AppendLiteral(u" to ");
             AppendASCIItoUTF16(scheme.get(), message);
-            message.Append(NS_LITERAL_STRING("://"));
+            message.AppendLiteral(u"://");
             AppendASCIItoUTF16(mapping->AlternateHost().get(), message);
-            message.Append(NS_LITERAL_STRING(":"));
+            message.AppendLiteral(u":");
             message.AppendInt(mapping->AlternatePort());
             consoleService->LogStringMessage(message.get());
         }
 
         LOG(("nsHttpChannel %p Using connection info from altsvc mapping", this));
         mapping->GetConnectionInfo(getter_AddRefs(mConnectionInfo), proxyInfo, originAttributes);
         Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_USE_ALTSVC, true);
         Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_USE_ALTSVC_OE, !isHttps);
--- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
+++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
@@ -526,17 +526,17 @@ nsHttpChannelAuthProvider::PrepareForAut
 
     if (!UsingHttpProxy() || mProxyAuthType.IsEmpty())
         return NS_OK;
 
     // We need to remove any Proxy_Authorization header left over from a
     // non-request based authentication handshake (e.g., for NTLM auth).
 
     nsAutoCString contractId;
-    contractId.Assign(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
+    contractId.AssignLiteral(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
     contractId.Append(mProxyAuthType);
 
     nsresult rv;
     nsCOMPtr<nsIHttpAuthenticator> precedingAuth =
         do_GetService(contractId.get(), &rv);
     if (NS_FAILED(rv))
         return rv;
 
@@ -1079,17 +1079,17 @@ nsHttpChannelAuthProvider::GetAuthentica
         this, mAuthChannel));
 
     GetAuthType(challenge, authType);
 
     // normalize to lowercase
     ToLowerCase(authType);
 
     nsAutoCString contractid;
-    contractid.Assign(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
+    contractid.AssignLiteral(NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX);
     contractid.Append(authType);
 
     return CallGetService(contractid.get(), auth);
 }
 
 void
 nsHttpChannelAuthProvider::GetIdentityFromURI(uint32_t            authFlags,
                                               nsHttpAuthIdentity &ident)
--- a/netwerk/protocol/http/nsHttpRequestHead.cpp
+++ b/netwerk/protocol/http/nsHttpRequestHead.cpp
@@ -324,20 +324,20 @@ nsHttpRequestHead::SetMethod(const nsACS
 }
 
 void
 nsHttpRequestHead::SetOrigin(const nsACString &scheme, const nsACString &host,
                              int32_t port)
 {
     RecursiveMutexAutoLock mon(mRecursiveMutex);
     mOrigin.Assign(scheme);
-    mOrigin.Append(NS_LITERAL_CSTRING("://"));
+    mOrigin.AppendLiteral("://");
     mOrigin.Append(host);
     if (port >= 0) {
-        mOrigin.Append(NS_LITERAL_CSTRING(":"));
+        mOrigin.AppendLiteral(":");
         mOrigin.AppendInt(port);
     }
 }
 
 bool
 nsHttpRequestHead::IsSafeMethod()
 {
     RecursiveMutexAutoLock mon(mRecursiveMutex);
--- 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/netwerk/protocol/res/SubstitutingProtocolHandler.cpp
+++ b/netwerk/protocol/res/SubstitutingProtocolHandler.cpp
@@ -420,18 +420,17 @@ SubstitutingProtocolHandler::ResolveURI(
 
   // Some code relies on an empty path resolving to a file rather than a
   // directory.
   NS_ASSERTION(path.CharAt(0) == '/', "Path must begin with '/'");
   if (path.Length() == 1) {
     rv = baseURI->GetSpec(result);
   } else {
     // Make sure we always resolve the path as file-relative to our target URI.
-    path.InsertLiteral(".", 0);
-
+    path.Insert('.', 0);
     rv = baseURI->Resolve(path, result);
   }
 
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (MOZ_LOG_TEST(gResLog, LogLevel::Debug)) {
--- a/netwerk/protocol/res/nsResProtocolHandler.cpp
+++ b/netwerk/protocol/res/nsResProtocolHandler.cpp
@@ -94,38 +94,38 @@ nsResProtocolHandler::GetSubstitutionInt
 }
 
 bool
 nsResProtocolHandler::ResolveSpecialCases(const nsACString& aHost,
                                           const nsACString& aPath,
                                           const nsACString& aPathname,
                                           nsACString& aResult)
 {
-    if (aHost.Equals("") || aHost.Equals(kAPP)) {
+    if (aHost.EqualsLiteral("") || aHost.EqualsLiteral(kAPP)) {
         aResult.Assign(mAppURI);
     } else if (aHost.Equals(kGRE)) {
         aResult.Assign(mGREURI);
     } else {
         return false;
     }
     aResult.Append(aPath);
     return true;
 }
 
 nsresult
 nsResProtocolHandler::SetSubstitution(const nsACString& aRoot, nsIURI* aBaseURI)
 {
-    MOZ_ASSERT(!aRoot.Equals(""));
-    MOZ_ASSERT(!aRoot.Equals(kAPP));
-    MOZ_ASSERT(!aRoot.Equals(kGRE));
+    MOZ_ASSERT(!aRoot.EqualsLiteral(""));
+    MOZ_ASSERT(!aRoot.EqualsLiteral(kAPP));
+    MOZ_ASSERT(!aRoot.EqualsLiteral(kGRE));
     return SubstitutingProtocolHandler::SetSubstitution(aRoot, aBaseURI);
 }
 
 nsresult
 nsResProtocolHandler::SetSubstitutionWithFlags(const nsACString& aRoot,
                                                nsIURI* aBaseURI,
                                                uint32_t aFlags)
 {
-    MOZ_ASSERT(!aRoot.Equals(""));
-    MOZ_ASSERT(!aRoot.Equals(kAPP));
-    MOZ_ASSERT(!aRoot.Equals(kGRE));
+    MOZ_ASSERT(!aRoot.EqualsLiteral(""));
+    MOZ_ASSERT(!aRoot.EqualsLiteral(kAPP));
+    MOZ_ASSERT(!aRoot.EqualsLiteral(kGRE));
     return SubstitutingProtocolHandler::SetSubstitutionWithFlags(aRoot, aBaseURI, aFlags);
 }
--- a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp
+++ b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp
@@ -415,17 +415,17 @@ nsViewSourceChannel::GetContentType(nsAC
         nsAutoCString contentType;
         rv = mChannel->GetContentType(contentType);
         if (NS_FAILED(rv)) return rv;
 
         // If we don't know our type, just say so.  The unknown
         // content decoder will then kick in automatically, and it
         // will call our SetOriginalContentType method instead of our
         // SetContentType method to set the type it determines.
-        if (!contentType.Equals(UNKNOWN_CONTENT_TYPE)) {
+        if (!contentType.EqualsLiteral(UNKNOWN_CONTENT_TYPE)) {
           contentType = VIEWSOURCE_CONTENT_TYPE;
         }
 
         mContentType = contentType;
     }
 
     aContentType = mContentType;
     return NS_OK;
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -2558,17 +2558,17 @@ ParseWebSocketExtension(const nsACString
                         bool& aClientNoContextTakeover,
                         bool& aServerNoContextTakeover,
                         int32_t& aClientMaxWindowBits,
                         int32_t& aServerMaxWindowBits)
 {
   nsCCharSeparatedTokenizer tokens(aExtension, ';');
 
   if (!tokens.hasMoreTokens() ||
-      !tokens.nextToken().Equals(NS_LITERAL_CSTRING("permessage-deflate"))) {
+      !tokens.nextToken().EqualsLiteral("permessage-deflate")) {
     LOG(("WebSocketChannel::ParseWebSocketExtension: "
          "HTTP Sec-WebSocket-Extensions negotiated unknown value %s\n",
          PromiseFlatCString(aExtension).get()));
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   aClientNoContextTakeover = aServerNoContextTakeover = false;
   aClientMaxWindowBits = aServerMaxWindowBits = -1;
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -72,34 +72,34 @@ mozTXTToHTMLConv::EscapeStr(nsString& aI
   //aInString.ReplaceSubstring("<", "&lt;");
   //aInString.ReplaceSubstring(">", "&gt;");
   for (uint32_t i = 0; i < aInString.Length();)
   {
     switch (aInString[i])
     {
     case '<':
       aInString.Cut(i, 1);
-      aInString.Insert(NS_LITERAL_STRING("&lt;"), i);
+      aInString.InsertLiteral(u"&lt;", i);
       i += 4; // skip past the integers we just added
       break;
     case '>':
       aInString.Cut(i, 1);
-      aInString.Insert(NS_LITERAL_STRING("&gt;"), i);
+      aInString.InsertLiteral(u"&gt;", i);
       i += 4; // skip past the integers we just added
       break;
     case '&':
       aInString.Cut(i, 1);
-      aInString.Insert(NS_LITERAL_STRING("&amp;"), i);
+      aInString.InsertLiteral(u"&amp;", i);
       i += 5; // skip past the integers we just added
       break;
     case '"':
       if (inAttribute)
       {
         aInString.Cut(i, 1);
-        aInString.Insert(NS_LITERAL_STRING("&quot;"), i);
+        aInString.InsertLiteral(u"&quot;", i);
         i += 6;
         break;
       }
       // else fall through
       MOZ_FALLTHROUGH;
     default:
       i++;
     }
--- a/netwerk/streamconv/converters/nsBinHexDecoder.cpp
+++ b/netwerk/streamconv/converters/nsBinHexDecoder.cpp
@@ -488,26 +488,26 @@ nsresult nsBinHexDecoder::DetectContentT
   const char * fileExt = strrchr(aFilename.get(), '.');
   if (!fileExt) {
     return NS_OK;
   }
 
   mimeService->GetTypeFromExtension(nsDependentCString(fileExt), contentType);
 
   // Only set the type if it's not empty and, to prevent recursive loops, not the binhex type
-  if (!contentType.IsEmpty() && !contentType.Equals(APPLICATION_BINHEX)) {
+  if (!contentType.IsEmpty() &&
+      !contentType.EqualsLiteral(APPLICATION_BINHEX)) {
     channel->SetContentType(contentType);
   } else {
     channel->SetContentType(NS_LITERAL_CSTRING(UNKNOWN_CONTENT_TYPE));
   }
 
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 nsBinHexDecoder::OnStopRequest(nsIRequest* request, nsISupports *aCtxt,
                                 nsresult aStatus)
 {
   nsresult rv = NS_OK;
 
   if (!mNextListener) return NS_ERROR_FAILURE;
   // don't do anything here...we'll fire our own on stop request when we are done
--- a/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/nsTXTToHTMLConv.cpp
@@ -280,35 +280,35 @@ nsTXTToHTMLConv::CatHTML(int32_t front, 
         mBuffer.Cut(front, back - front);
         mBuffer.Insert(mToken->modText, front);
         cursor = front+modLen;
     } else {
         nsString linkText;
         // href is implied
         mBuffer.Mid(linkText, front, back-front);
 
-        mBuffer.Insert(NS_LITERAL_STRING("<a href=\""), front);
+        mBuffer.InsertLiteral(u"<a href=\"", front);
         cursor += front+9;
         if (modLen) {
             mBuffer.Insert(mToken->modText, cursor);
             cursor += modLen;
         }
 
         NS_ConvertUTF16toUTF8 linkTextUTF8(linkText);
         nsCString escaped;
         if (NS_EscapeURL(linkTextUTF8.Data(), linkTextUTF8.Length(), esc_Minimal, escaped)) {
             mBuffer.Cut(cursor, back - front);
             CopyUTF8toUTF16(escaped, linkText);
             mBuffer.Insert(linkText, cursor);
             back = front + linkText.Length();
         }
 
         cursor += back-front;
-        mBuffer.Insert(NS_LITERAL_STRING("\">"), cursor);
+        mBuffer.InsertLiteral(u"\">", cursor);
         cursor += 2;
         mBuffer.Insert(linkText, cursor);
         cursor += linkText.Length();
-        mBuffer.Insert(NS_LITERAL_STRING("</a>"), cursor);
+        mBuffer.InsertLiteral(u"</a>", cursor);
         cursor += 4;
     }
     mToken = nullptr; // indicates completeness
     return cursor;
 }
--- a/netwerk/streamconv/converters/nsUnknownDecoder.cpp
+++ b/netwerk/streamconv/converters/nsUnknownDecoder.cpp
@@ -929,17 +929,17 @@ nsBinaryDetector::DetermineContentType(n
   Unused << httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Encoding"),
                                            contentEncoding);
   if (!contentEncoding.IsEmpty()) {
     return;
   }
 
   LastDitchSniff(aRequest);
   MutexAutoLock lock(mMutex);
-  if (mContentType.Equals(APPLICATION_OCTET_STREAM)) {
+  if (mContentType.EqualsLiteral(APPLICATION_OCTET_STREAM)) {
     // We want to guess at it instead
     mContentType = APPLICATION_GUESS_FROM_EXT;
   } else {
     // Let the text/plain type we already have be, so that other content
     // sniffers can also get a shot at this data.
     mContentType.Truncate();
   }
 }
--- a/netwerk/test/gtest/TestStandardURL.cpp
+++ b/netwerk/test/gtest/TestStandardURL.cpp
@@ -157,17 +157,17 @@ TEST(TestStandardURL, From_test_standard
                                 "000177.0.00000.0x0001", "127.0.0.1.",
 
                                 "0X7F.0X00.0X00.0X01", "0X7F.0X01",
                                 "0X7F000001", "0X007F.0X0000.0X0000.0X0001",
                                 "000177.0.00000.0X0001"};
     for (uint32_t i = 0; i < sizeof(localIPv4s)/sizeof(localIPv4s[0]); i ++) {
         nsCString encHost(localIPv4s[i]);
         ASSERT_EQ(NS_OK, Test_NormalizeIPv4(encHost, result));
-        ASSERT_TRUE(result.Equals("127.0.0.1"));
+        ASSERT_TRUE(result.EqualsLiteral("127.0.0.1"));
     }
 
     const char* nonIPv4s[] = {"0xfffffffff", "0x100000000", "4294967296", "1.2.0x10000",
                               "1.0x1000000", "256.0.0.1", "1.256.1", "-1.0.0.0",
                               "1.2.3.4.5", "010000000000000000", "2+3", "0.0.0.-1",
                               "1.2.3.4..", "1..2", ".1.2.3.4"};
     for (uint32_t i = 0; i < sizeof(nonIPv4s)/sizeof(nonIPv4s[0]); i ++) {
         nsCString encHost(nonIPv4s[i]);
--- a/parser/html/nsHtml5ViewSourceUtils.cpp
+++ b/parser/html/nsHtml5ViewSourceUtils.cpp
@@ -13,20 +13,20 @@ nsHtml5HtmlAttributes*
 nsHtml5ViewSourceUtils::NewBodyAttributes()
 {
   nsHtml5HtmlAttributes* bodyAttrs = new nsHtml5HtmlAttributes(0);
   nsHtml5String id = nsHtml5Portability::newStringFromLiteral("viewsource");
   bodyAttrs->addAttribute(nsHtml5AttributeName::ATTR_ID, id, -1);
 
   nsString klass;
   if (mozilla::Preferences::GetBool("view_source.wrap_long_lines", true)) {
-    klass.Append(NS_LITERAL_STRING("wrap "));
+    klass.AppendLiteral(u"wrap ");
   }
   if (mozilla::Preferences::GetBool("view_source.syntax_highlight", true)) {
-    klass.Append(NS_LITERAL_STRING("highlight"));
+    klass.AppendLiteral(u"highlight");
   }
   if (!klass.IsEmpty()) {
     bodyAttrs->addAttribute(
       nsHtml5AttributeName::ATTR_CLASS, nsHtml5String::FromString(klass), -1);
   }
 
   int32_t tabSize = mozilla::Preferences::GetInt("view_source.tab_size", 4);
   if (tabSize > 0) {
--- a/rdf/datasource/nsFileSystemDataSource.cpp
+++ b/rdf/datasource/nsFileSystemDataSource.cpp
@@ -1014,17 +1014,17 @@ FileSystemDataSource::GetFolderList(nsIR
             continue;
         }
 
         // using nsEscape() [above] doesn't escape slashes, so do that by hand
         int32_t         aOffset;
         while ((aOffset = leaf.FindChar('/')) >= 0)
         {
             leaf.Cut((uint32_t)aOffset, 1);
-            leaf.Insert("%2F", (uint32_t)aOffset);
+            leaf.InsertLiteral("%2F", (uint32_t)aOffset);
         }
 
         // append the encoded name
         fullURI.Append(leaf);
 
         bool            dirFlag = false;
         rv = aFile->IsDirectory(&dirFlag);
         if (NS_SUCCEEDED(rv) && dirFlag)
--- a/security/apps/AppSignatureVerification.cpp
+++ b/security/apps/AppSignatureVerification.cpp
@@ -1216,17 +1216,17 @@ CheckDirForUnsignedFiles(nsIFile* aDir,
     bool isDir;
     rv = file->IsDirectory(&isDir);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     // if it's a directory we need to recurse
     if (isDir) {
-      curName.Append(NS_LITERAL_STRING("/"));
+      curName.AppendLiteral(u"/");
       rv = CheckDirForUnsignedFiles(file, curName, aItems,
                                     sigFilename, sfFilename, mfFilename);
     } else {
       // The files that comprise the signature mechanism are not covered by the
       // signature.
       //
       // XXX: This is OK for a single signature, but doesn't work for
       // multiple signatures because the metadata for the other signatures
--- a/security/certverifier/OCSPRequestor.cpp
+++ b/security/certverifier/OCSPRequestor.cpp
@@ -150,24 +150,24 @@ DoOCSPRequest(const UniquePLArenaPool& a
     return rv;
   }
   UniqueHTTPServerSession serverSession(serverSessionPtr);
 
   nsAutoCString path;
   if (pathLen > 0) {
     path.Assign(url + pathPos, static_cast<nsAutoCString::size_type>(pathLen));
   } else {
-    path.Assign("/");
+    path.AssignLiteral("/");
   }
   MOZ_LOG(gCertVerifierLog, LogLevel::Debug,
          ("Setting up OCSP request: pre all path =%s  pathlen=%d\n", path.get(),
           pathLen));
   nsAutoCString method("POST");
   if (useGET) {
-    method.Assign("GET");
+    method.AssignLiteral("GET");
     if (!StringEndsWith(path, NS_LITERAL_CSTRING("/"))) {
       path.Append("/");
     }
     nsrv = AppendEscapedBase64Item(encodedRequest, path);
     if (NS_WARN_IF(NS_FAILED(nsrv))) {
       return Result::FATAL_ERROR_LIBRARY_FAILURE;
     }
   }
--- a/security/manager/ssl/nsCertOverrideService.cpp
+++ b/security/manager/ssl/nsCertOverrideService.cpp
@@ -101,17 +101,17 @@ nsCertOverrideService::Init()
     MOZ_ASSERT_UNREACHABLE("nsCertOverrideService initialized off main thread");
     return NS_ERROR_NOT_SAME_THREAD;
   }
 
   // Note that the names of these variables would seem to indicate that at one
   // point another hash algorithm was used and is still supported for backwards
   // compatibility. This is not the case. It has always been SHA256.
   mOidTagForStoringNewHashes = SEC_OID_SHA256;
-  mDottedOidForStoringNewHashes.Assign("OID.2.16.840.1.101.3.4.2.1");
+  mDottedOidForStoringNewHashes.AssignLiteral("OID.2.16.840.1.101.3.4.2.1");
 
   nsCOMPtr<nsIObserverService> observerService =
       mozilla::services::GetObserverService();
 
   // If we cannot add ourselves as a profile change observer, then we will not
   // attempt to read/write any settings file. Otherwise, we would end up
   // reading/writing the wrong settings file after a profile change.
   if (observerService) {
--- a/security/manager/ssl/nsNSSComponent.cpp
+++ b/security/manager/ssl/nsNSSComponent.cpp
@@ -2331,17 +2331,17 @@ nsNSSComponent::Observe(nsISupports* aSu
     } else if (prefName.EqualsLiteral("security.ssl.enable_alpn")) {
       SSL_OptionSetDefault(SSL_ENABLE_ALPN,
                            Preferences::GetBool("security.ssl.enable_alpn",
                                                 ALPN_ENABLED_DEFAULT));
     } else if (prefName.EqualsLiteral("security.tls.enable_0rtt_data")) {
       SSL_OptionSetDefault(SSL_ENABLE_0RTT_DATA,
                            Preferences::GetBool("security.tls.enable_0rtt_data",
                                                 ENABLED_0RTT_DATA_DEFAULT));
-    } else if (prefName.Equals("security.ssl.disable_session_identifiers")) {
+    } else if (prefName.EqualsLiteral("security.ssl.disable_session_identifiers")) {
       ConfigureTLSSessionIdentifiers();
     } else if (prefName.EqualsLiteral("security.OCSP.enabled") ||
                prefName.EqualsLiteral("security.OCSP.require") ||
                prefName.EqualsLiteral("security.OCSP.GET.enabled") ||
                prefName.EqualsLiteral("security.pki.cert_short_lifetime_in_days") ||
                prefName.EqualsLiteral("security.ssl.enable_ocsp_stapling") ||
                prefName.EqualsLiteral("security.ssl.enable_ocsp_must_staple") ||
                prefName.EqualsLiteral("security.pki.certificate_transparency.mode") ||
--- 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/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
@@ -1480,18 +1480,18 @@ Connection::initializeClone(Connection* 
     nsCOMPtr<mozIStorageStatement> stmt;
     rv = CreateStatement(NS_LITERAL_CSTRING("PRAGMA database_list"),
                          getter_AddRefs(stmt));
     MOZ_ASSERT(NS_SUCCEEDED(rv));
     bool hasResult = false;
     while (stmt && NS_SUCCEEDED(stmt->ExecuteStep(&hasResult)) && hasResult) {
       nsAutoCString name;
       rv = stmt->GetUTF8String(1, name);
-      if (NS_SUCCEEDED(rv) && !name.Equals(NS_LITERAL_CSTRING("main")) &&
-                              !name.Equals(NS_LITERAL_CSTRING("temp"))) {
+      if (NS_SUCCEEDED(rv) && !name.EqualsLiteral("main") &&
+                              !name.EqualsLiteral("temp")) {
         nsCString path;
         rv = stmt->GetUTF8String(2, path);
         if (NS_SUCCEEDED(rv) && !path.IsEmpty()) {
           nsCOMPtr<mozIStorageStatement> attachStmt;
           rv = aClone->CreateStatement(
             NS_LITERAL_CSTRING("ATTACH DATABASE :path AS ") + name,
             getter_AddRefs(attachStmt));
           MOZ_ASSERT(NS_SUCCEEDED(rv));
--- 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/places/SQLFunctions.cpp
+++ b/toolkit/components/places/SQLFunctions.cpp
@@ -1028,21 +1028,21 @@ namespace places {
         // The second half of the url is more likely to be unique, so we add it.
         uint32_t srcHash = HashString(str);
         uint64_t hash = (prefixHash << 32) + srcHash;
         result->SetAsInt64(hash);
       } else {
         uint32_t hash = HashString(str);
         result->SetAsInt64(hash);
       }
-    } else if (mode.Equals(NS_LITERAL_CSTRING("prefix_lo"))) {
+    } else if (mode.EqualsLiteral("prefix_lo")) {
       // Keep only 16 bits.
       uint64_t hash = static_cast<uint64_t>(HashString(str) & 0x0000FFFF) << 32;
       result->SetAsInt64(hash);
-    } else if (mode.Equals(NS_LITERAL_CSTRING("prefix_hi"))) {
+    } else if (mode.EqualsLiteral("prefix_hi")) {
       // Keep only 16 bits.
       uint64_t hash = static_cast<uint64_t>(HashString(str) & 0x0000FFFF) << 32;
       // Make this a prefix upper bound by filling the lowest 32 bits.
       hash +=  0xFFFFFFFF;
       result->SetAsInt64(hash);
     } else {
       return NS_ERROR_FAILURE;
     }
--- a/toolkit/components/places/nsFaviconService.cpp
+++ b/toolkit/components/places/nsFaviconService.cpp
@@ -397,17 +397,17 @@ nsFaviconService::SetAndFetchFaviconForP
     }
   }
 
   // If the page url points to an image, the icon's url will be the same.
   // TODO (Bug 403651): store a resample of the image.  For now avoid that
   // for database size and UX concerns.
   // Don't store favicons for error pages too.
   if (icon.spec.Equals(page.spec) ||
-      icon.spec.Equals(FAVICON_ERRORPAGE_URL)) {
+      icon.spec.EqualsLiteral(FAVICON_ERRORPAGE_URL)) {
     return NS_OK;
   }
 
   RefPtr<AsyncFetchAndSetIconForPage> event =
     new AsyncFetchAndSetIconForPage(icon, page, loadPrivate,
                                     aCallback, aLoadingPrincipal,
                                     aRequestContextID);
 
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -615,19 +615,19 @@ nsNavHistory::DispatchFrecencyChangedNot
 }
 
 Atomic<int64_t> nsNavHistory::sLastInsertedPlaceId(0);
 Atomic<int64_t> nsNavHistory::sLastInsertedVisitId(0);
 
 void // static
 nsNavHistory::StoreLastInsertedId(const nsACString& aTable,
                                   const int64_t aLastInsertedId) {
-  if (aTable.Equals(NS_LITERAL_CSTRING("moz_places"))) {
+  if (aTable.EqualsLiteral("moz_places")) {
     nsNavHistory::sLastInsertedPlaceId = aLastInsertedId;
-  } else if (aTable.Equals(NS_LITERAL_CSTRING("moz_historyvisits"))) {
+  } else if (aTable.EqualsLiteral("moz_historyvisits")) {
     nsNavHistory::sLastInsertedVisitId = aLastInsertedId;
   } else {
     MOZ_ASSERT(false, "Trying to store the insert id for an unknown table?");
   }
 }
 
 int32_t
 nsNavHistory::GetDaysOfHistory() {
@@ -1756,24 +1756,22 @@ PlacesSQLQueryBuilder::SelectAsDay()
         else {
           nsNavHistory::GetMonthName(tm, dateName);
         }
 
         // From start of MonthIndex + 1 months ago
         sqlFragmentContainerBeginTime = NS_LITERAL_CSTRING(
           "(strftime('%s','now','localtime','start of month','-");
         sqlFragmentContainerBeginTime.AppendInt(MonthIndex);
-        sqlFragmentContainerBeginTime.Append(NS_LITERAL_CSTRING(
-            " months','utc')*1000000)"));
+        sqlFragmentContainerBeginTime.AppendLiteral(" months','utc')*1000000)");
         // To start of MonthIndex months ago
         sqlFragmentContainerEndTime = NS_LITERAL_CSTRING(
           "(strftime('%s','now','localtime','start of month','-");
         sqlFragmentContainerEndTime.AppendInt(MonthIndex - 1);
-        sqlFragmentContainerEndTime.Append(NS_LITERAL_CSTRING(
-            " months','utc')*1000000)"));
+        sqlFragmentContainerEndTime.AppendLiteral(" months','utc')*1000000)");
         // Search for the same timeframe.
         sqlFragmentSearchBeginTime = sqlFragmentContainerBeginTime;
         sqlFragmentSearchEndTime = sqlFragmentContainerEndTime;
         break;
     }
 
     nsPrintfCString dateParam("dayTitle%d", i);
     mAddParams.Put(dateParam, dateName);
--- a/toolkit/components/resistfingerprinting/nsRFPService.cpp
+++ b/toolkit/components/resistfingerprinting/nsRFPService.cpp
@@ -200,17 +200,17 @@ nsRFPService::GetSpoofedUserAgent(nsACSt
 
   nsAutoCString updateChannel;
   rv = runtime->GetDefaultUpdateChannel(updateChannel);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // If we are running in Firefox ESR, determine whether the formula of ESR
   // version has changed.  Once changed, we must update the formula in this
   // function.
-  if (updateChannel.Equals("esr")) {
+  if (updateChannel.EqualsLiteral("esr")) {
     MOZ_ASSERT(((firefoxVersion % 7) == 3),
       "Please udpate ESR version formula in nsRFPService.cpp");
   }
 
   uint32_t spoofedVersion = firefoxVersion - ((firefoxVersion - 3) % 7);
   userAgent.Assign(nsPrintfCString(
     "Mozilla/5.0 (%s; rv:%d.0) Gecko/%s Firefox/%d.0",
     SPOOFED_OSCPU, spoofedVersion, LEGACY_BUILD_ID, spoofedVersion));
--- a/toolkit/components/telemetry/TelemetryScalar.cpp
+++ b/toolkit/components/telemetry/TelemetryScalar.cpp
@@ -800,56 +800,56 @@ namespace {
 void
 internal_LogScalarError(const nsACString& aScalarName, ScalarResult aSr)
 {
   nsAutoString errorMessage;
   AppendUTF8toUTF16(aScalarName, errorMessage);
 
   switch (aSr) {
     case ScalarResult::NotInitialized:
-      errorMessage.Append(NS_LITERAL_STRING(" - Telemetry was not yet initialized."));
+      errorMessage.AppendLiteral(u" - Telemetry was not yet initialized.");
       break;
     case ScalarResult::CannotUnpackVariant:
-      errorMessage.Append(NS_LITERAL_STRING(" - Cannot convert the provided JS value to nsIVariant."));
+      errorMessage.AppendLiteral(u" - Cannot convert the provided JS value to nsIVariant.");
       break;
     case ScalarResult::CannotRecordInProcess:
-      errorMessage.Append(NS_LITERAL_STRING(" - Cannot record the scalar in the current process."));
+      errorMessage.AppendLiteral(u" - Cannot record the scalar in the current process.");
       break;
     case ScalarResult::KeyedTypeMismatch:
-      errorMessage.Append(NS_LITERAL_STRING(" - Attempting to manage a keyed scalar as a scalar (or vice-versa)."));
+      errorMessage.AppendLiteral(u" - Attempting to manage a keyed scalar as a scalar (or vice-versa).");
       break;
     case ScalarResult::UnknownScalar:
-      errorMessage.Append(NS_LITERAL_STRING(" - Unknown scalar."));
+      errorMessage.AppendLiteral(u" - Unknown scalar.");
       break;
     case ScalarResult::OperationNotSupported:
-      errorMessage.Append(NS_LITERAL_STRING(" - The requested operation is not supported on this scalar."));
+      errorMessage.AppendLiteral(u" - The requested operation is not supported on this scalar.");
       break;
     case ScalarResult::InvalidType:
-      errorMessage.Append(NS_LITERAL_STRING(" - Attempted to set the scalar to an invalid data type."));
+      errorMessage.AppendLiteral(u" - Attempted to set the scalar to an invalid data type.");
       break;
     case ScalarResult::InvalidValue:
-      errorMessage.Append(NS_LITERAL_STRING(" - Attempted to set the scalar to an incompatible value."));
+      errorMessage.AppendLiteral(u" - Attempted to set the scalar to an incompatible value.");
       break;
     case ScalarResult::StringTooLong:
-      errorMessage.Append(NS_LITERAL_STRING(" - Truncating scalar value to 50 characters."));
+      errorMessage.AppendLiteral(u" - Truncating scalar value to 50 characters.");
       break;
     case ScalarResult::KeyIsEmpty:
-      errorMessage.Append(NS_LITERAL_STRING(" - The key must not be empty."));
+      errorMessage.AppendLiteral(u" - The key must not be empty.");
       break;
     case ScalarResult::KeyTooLong:
-      errorMessage.Append(NS_LITERAL_STRING(" - The key length must be limited to 70 characters."));
+      errorMessage.AppendLiteral(u" - The key length must be limited to 70 characters.");
       break;
     case ScalarResult::TooManyKeys:
-      errorMessage.Append(NS_LITERAL_STRING(" - Keyed scalars cannot have more than 100 keys."));
+      errorMessage.AppendLiteral(u" - Keyed scalars cannot have more than 100 keys.");
       break;
     case ScalarResult::UnsignedNegativeValue:
-      errorMessage.Append(NS_LITERAL_STRING(" - Trying to set an unsigned scalar to a negative number."));
+      errorMessage.AppendLiteral(u" - Trying to set an unsigned scalar to a negative number.");
       break;
     case ScalarResult::UnsignedTruncatedValue:
-      errorMessage.Append(NS_LITERAL_STRING(" - Truncating float/double number."));
+      errorMessage.AppendLiteral(u" - Truncating float/double number.");
       break;
     default:
       // Nothing.
       return;
   }
 
   LogToBrowserConsole(nsIScriptError::warningFlag, errorMessage);
 }
--- 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/components/url-classifier/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ -655,17 +655,17 @@ nsUrlClassifierDBServiceWorker::NotifyUp
 
   nsresult updateStatus = mUpdateStatus;
   if (NS_FAILED(mUpdateStatus)) {
    updateStatus = NS_ERROR_GET_MODULE(mUpdateStatus) == NS_ERROR_MODULE_URL_CLASSIFIER ?
      mUpdateStatus : NS_ERROR_UC_UPDATE_UNKNOWN;
   }
 
   // Do not record telemetry for testing tables.
-  if (!provider.Equals(TESTING_TABLE_PROVIDER_NAME)) {
+  if (!provider.EqualsLiteral(TESTING_TABLE_PROVIDER_NAME)) {
     Telemetry::Accumulate(Telemetry::URLCLASSIFIER_UPDATE_ERROR, provider,
                           NS_ERROR_GET_CODE(updateStatus));
   }
 
   if (!mUpdateObserver) {
     // In the normal shutdown process, CancelUpdate() would NOT be
     // called prior to NotifyUpdateObserver(). However, CancelUpdate()
     // is a public API which can be called in the test case at any point.
--- a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
@@ -320,17 +320,17 @@ nsUrlClassifierUtils::GetTelemetryProvid
   // An empty provider is treated as "other"
   if (!NS_LITERAL_CSTRING("mozilla").Equals(aProvider) &&
       !NS_LITERAL_CSTRING("google").Equals(aProvider) &&
       !NS_LITERAL_CSTRING("google4").Equals(aProvider) &&
       !NS_LITERAL_CSTRING("baidu").Equals(aProvider) &&
       !NS_LITERAL_CSTRING("mozcn").Equals(aProvider) &&
       !NS_LITERAL_CSTRING("yandex").Equals(aProvider) &&
       !NS_LITERAL_CSTRING(TESTING_TABLE_PROVIDER_NAME).Equals(aProvider)) {
-    aProvider.Assign(NS_LITERAL_CSTRING("other"));
+    aProvider.AssignLiteral("other");
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsUrlClassifierUtils::GetProtocolVersion(const nsACString& aProvider,
                                          nsACString& aVersion)
--- 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/mozapps/extensions/AddonManagerWebAPI.cpp
+++ b/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
@@ -37,19 +37,19 @@ IsValidHost(const nsACString& host) {
       bool isLocked;
       prefs->PrefIsLocked("xpinstall.enabled", &isLocked);
       if (isLocked) {
         return false;
       }
     }
   }
 
-  if (host.Equals("addons.mozilla.org") ||
-      host.Equals("discovery.addons.mozilla.org") ||
-      host.Equals("testpilot.firefox.com")) {
+  if (host.EqualsLiteral("addons.mozilla.org") ||
+      host.EqualsLiteral("discovery.addons.mozilla.org") ||
+      host.EqualsLiteral("testpilot.firefox.com")) {
     return true;
   }
 
   // When testing allow access to the developer sites.
   if (Preferences::GetBool("extensions.webapi.testing", false)) {
     if (host.LowerCaseEqualsLiteral("addons.allizom.org") ||
         host.LowerCaseEqualsLiteral("discovery.addons.allizom.org") ||
         host.LowerCaseEqualsLiteral("addons-dev.allizom.org") ||
--- 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/toolkit/xre/ProfileReset.cpp
+++ b/toolkit/xre/ProfileReset.cpp
@@ -40,17 +40,17 @@ CreateResetProfile(nsIToolkitProfileServ
 
   nsCOMPtr<nsIToolkitProfile> newProfile;
   // Make the new profile the old profile (or "default-") + the time in seconds since epoch for uniqueness.
   nsAutoCString newProfileName;
   if (!aOldProfileName.IsEmpty()) {
     newProfileName.Assign(aOldProfileName);
     newProfileName.Append("-");
   } else {
-    newProfileName.Assign("default-");
+    newProfileName.AssignLiteral("default-");
   }
   newProfileName.Append(nsPrintfCString("%" PRId64, PR_Now() / 1000));
   nsresult rv = aProfileSvc->CreateProfile(nullptr, // choose a default dir for us
                                            newProfileName,
                                            getter_AddRefs(newProfile));
   if (NS_FAILED(rv)) return rv;
 
   rv = aProfileSvc->Flush();
--- a/toolkit/xre/nsNativeAppSupportWin.cpp
+++ b/toolkit/xre/nsNativeAppSupportWin.cpp
@@ -920,20 +920,20 @@ nsNativeAppSupportWin::HandleDDENotifica
                     ParseDDEArg(hsz2, 0, url);
 
                     // Read the 3rd argument in the command to determine if a
                     // new window is to be used.
                     nsAutoString windowID;
                     ParseDDEArg(hsz2, 2, windowID);
                     // "" means to open the URL in a new window.
                     if ( windowID.IsEmpty() ) {
-                        url.Insert(NS_LITERAL_STRING("mozilla -new-window "), 0);
+                        url.InsertLiteral(u"mozilla -new-window ", 0);
                     }
                     else {
-                        url.Insert(NS_LITERAL_STRING("mozilla -url "), 0);
+                        url.InsertLiteral(u"mozilla -url ", 0);
                     }
 
 #if MOZ_DEBUG_DDE
                     printf( "Handling dde XTYP_REQUEST request: [%s]...\n", NS_ConvertUTF16toUTF8(url).get() );
 #endif
                     // Now handle it.
                     HandleCommandLine(NS_ConvertUTF16toUTF8(url).get(), nullptr, nsICommandLine::STATE_REMOTE_EXPLICIT);
 
@@ -1085,20 +1085,20 @@ nsNativeAppSupportWin::HandleDDENotifica
 
             // Read the 3rd argument in the command to determine if a
             // new window is to be used.
             nsAutoString windowID;
             ParseDDEArg((const WCHAR*) request, 2, windowID);
 
             // "" means to open the URL in a new window.
             if ( windowID.IsEmpty() ) {
-                url.Insert(NS_LITERAL_STRING("mozilla -new-window "), 0);
+                url.InsertLiteral(u"mozilla -new-window ", 0);
             }
             else {
-                url.Insert(NS_LITERAL_STRING("mozilla -url "), 0);
+                url.InsertLiteral(u"mozilla -url ", 0);
             }
 #if MOZ_DEBUG_DDE
             printf( "Handling dde XTYP_REQUEST request: [%s]...\n", NS_ConvertUTF16toUTF8(url).get() );
 #endif
             // Now handle it.
             HandleCommandLine(NS_ConvertUTF16toUTF8(url).get(), nullptr, nsICommandLine::STATE_REMOTE_EXPLICIT);
 
             // Release the data.
@@ -1481,9 +1481,8 @@ nsNativeAppSupportWin::OpenBrowserWindow
         (do_CreateInstance("@mozilla.org/toolkit/command-line;1"));
     NS_ENSURE_TRUE(cmdLine, NS_ERROR_FAILURE);
 
     rv = cmdLine->Init(0, argv, nullptr, nsICommandLine::STATE_REMOTE_EXPLICIT);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return cmdLine->Run();
 }
-
--- a/tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h
+++ b/tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h
@@ -169,17 +169,17 @@ class ScopedXPCOM : public nsIDirectoryS
       if (!greD) {
         return greD.forget();
       }
       greD->Clone(getter_AddRefs(mGREBinD));
 
 #ifdef XP_MACOSX
       nsAutoCString leafName;
       mGREBinD->GetNativeLeafName(leafName);
-      if (leafName.Equals("Resources")) {
+      if (leafName.EqualsLiteral("Resources")) {
         mGREBinD->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS"));
       }
 #endif
 
       nsCOMPtr<nsIFile> copy = mGREBinD;
       return copy.forget();
     }
 
--- a/widget/ContentCache.cpp
+++ b/widget/ContentCache.cpp
@@ -37,43 +37,43 @@ GetNotificationName(const IMENotificatio
   return ToChar(aNotification->mMessage);
 }
 
 class GetRectText : public nsAutoCString
 {
 public:
   explicit GetRectText(const LayoutDeviceIntRect& aRect)
   {
-    Assign("{ x=");
+    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)
   {
     if (!aWritingMode.IsVertical()) {
-      Assign("Horizontal");
+      AssignLiteral("Horizontal");
       return;
     }
     if (aWritingMode.IsVerticalLR()) {
-      Assign("Vertical (LTR)");
+      AssignLiteral("Vertical (LTR)");
       return;
     }
-    Assign("Vertical (RTL)");
+    AssignLiteral("Vertical (RTL)");
   }
   virtual ~GetWritingModeName() {}
 };
 
 class GetEscapedUTF8String final : public NS_ConvertUTF16toUTF8
 {
 public:
   explicit GetEscapedUTF8String(const nsAString& aString)
--- 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/cocoa/nsMenuItemX.mm
+++ b/widget/cocoa/nsMenuItemX.mm
@@ -245,17 +245,17 @@ void nsMenuItemX::SetKeyEquiv()
         nsAutoString keyCodeName;
         keyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::keycode, keyCodeName);
         uint32_t charCode =
           nsCocoaUtils::ConvertGeckoNameToMacCharCode(keyCodeName);
         if (charCode) {
           keyChar.Assign(charCode);
         }
         else {
-          keyChar.Assign(NS_LITERAL_STRING(" "));
+          keyChar.AssignLiteral(u" ");
         }
       }
 
       nsAutoString modifiersStr;
       keyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::modifiers, modifiersStr);
       uint8_t modifiers = nsMenuUtilsX::GeckoModifiersForNodeAttribute(modifiersStr);
 
       unsigned int macModifiers = nsMenuUtilsX::MacModifiersForGeckoModifiers(modifiers);
--- 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/widget/windows/IMMHandler.cpp
+++ b/widget/windows/IMMHandler.cpp
@@ -112,24 +112,24 @@ public:
 };
 
 class GetWritingModeName : public nsAutoCString
 {
 public:
   explicit GetWritingModeName(const WritingMode& aWritingMode)
   {
     if (!aWritingMode.IsVertical()) {
-      Assign("Horizontal");
+      AssignLiteral("Horizontal");
       return;
     }
     if (aWritingMode.IsVerticalLR()) {
-      Assign("Vertical (LR)");
+      AssignLiteral("Vertical (LR)");
       return;
     }
-    Assign("Vertical (RL)");
+    AssignLiteral("Vertical (RL)");
   }
   virtual ~GetWritingModeName() {}
 };
 
 class GetReconvertStringLog : public nsAutoCString
 {
 public:
   explicit GetReconvertStringLog(RECONVERTSTRING* aReconv)
--- 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];
--- a/xpcom/build/FileLocation.cpp
+++ b/xpcom/build/FileLocation.cpp
@@ -116,17 +116,17 @@ FileLocation::GetURIString(nsACString& a
 {
   if (mBaseFile) {
     net_GetURLSpecFromActualFile(mBaseFile, aResult);
   } else if (mBaseZip) {
     RefPtr<nsZipHandle> handler = mBaseZip->GetFD();
     handler->mFile.GetURIString(aResult);
   }
   if (IsZip()) {
-    aResult.Insert("jar:", 0);
+    aResult.InsertLiteral("jar:", 0);
     aResult += "!/";
     aResult += mPath;
   }
 }
 
 already_AddRefed<nsIFile>
 FileLocation::GetBaseFile()
 {
--- a/xpcom/tests/TestHarness.h
+++ b/xpcom/tests/TestHarness.h
@@ -188,17 +188,17 @@ class ScopedXPCOM : public nsIDirectoryS
       if (!greD) {
         return greD.forget();
       }
       greD->Clone(getter_AddRefs(mGREBinD));
 
 #ifdef XP_MACOSX
       nsAutoCString leafName;
       mGREBinD->GetNativeLeafName(leafName);
-      if (leafName.Equals("Resources")) {
+      if (leafName.EqualsLiteral("Resources")) {
         mGREBinD->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS"));
       }
 #endif
 
       nsCOMPtr<nsIFile> copy = mGREBinD;
       return copy.forget();
     }
 
--- a/xpcom/tests/gtest/TestMultiplexInputStream.cpp
+++ b/xpcom/tests/gtest/TestMultiplexInputStream.cpp
@@ -12,19 +12,19 @@
 #include "nsISeekableStream.h"
 #include "nsStringStream.h"
 
 TEST(MultiplexInputStream, Seek_SET)
 {
   nsCString buf1;
   nsCString buf2;
   nsCString buf3;
-  buf1.Assign("Hello world");
-  buf2.Assign("The quick brown fox jumped over the lazy dog");
-  buf3.Assign("Foo bar");
+  buf1.AssignLiteral("Hello world");
+  buf2.AssignLiteral("The quick brown fox jumped over the lazy dog");
+  buf3.AssignLiteral("Foo bar");
 
   nsCOMPtr<nsIInputStream> inputStream1;
   nsCOMPtr<nsIInputStream> inputStream2;
   nsCOMPtr<nsIInputStream> inputStream3;
   nsresult rv = NS_NewCStringInputStream(getter_AddRefs(inputStream1), buf1);
   ASSERT_TRUE(NS_SUCCEEDED(rv));
   rv = NS_NewCStringInputStream(getter_AddRefs(inputStream2), buf2);
   ASSERT_TRUE(NS_SUCCEEDED(rv));
--- a/xpcom/tests/gtest/TestSlicedInputStream.cpp
+++ b/xpcom/tests/gtest/TestSlicedInputStream.cpp
@@ -327,17 +327,17 @@ TEST(TestSlicedInputStream, Length0) {
   uint32_t count;
   ASSERT_EQ(NS_OK, sis->Read(buf2, sizeof(buf2), &count));
   ASSERT_EQ((uint64_t)0, count);
 }
 
 // Seek test NS_SEEK_SET
 TEST(TestSlicedInputStream, Seek_SET) {
   nsCString buf;
-  buf.Assign("Hello world");
+  buf.AssignLiteral("Hello world");
 
   nsCOMPtr<nsIInputStream> stream;
   NS_NewCStringInputStream(getter_AddRefs(stream), buf);
 
   RefPtr<SlicedInputStream> sis = new SlicedInputStream(stream, 1, buf.Length());
 
   ASSERT_EQ(NS_OK, sis->Seek(nsISeekableStream::NS_SEEK_SET, 1));
 
@@ -350,17 +350,17 @@ TEST(TestSlicedInputStream, Seek_SET) {
   ASSERT_EQ(NS_OK, sis->Read(buf2, sizeof(buf2), &count));
   ASSERT_EQ((uint64_t)buf.Length() - 2, count);
   ASSERT_EQ(0, strncmp(buf2, "llo world", count));
 }
 
 // Seek test NS_SEEK_CUR
 TEST(TestSlicedInputStream, Seek_CUR) {
   nsCString buf;
-  buf.Assign("Hello world");
+  buf.AssignLiteral("Hello world");
 
   nsCOMPtr<nsIInputStream> stream;
   NS_NewCStringInputStream(getter_AddRefs(stream), buf);
 
   RefPtr<SlicedInputStream> sis = new SlicedInputStream(stream, 1, buf.Length());
 
   ASSERT_EQ(NS_OK, sis->Seek(nsISeekableStream::NS_SEEK_CUR, 1));
 
@@ -379,17 +379,17 @@ TEST(TestSlicedInputStream, Seek_CUR) {
   ASSERT_EQ(NS_OK, sis->Read(buf2, sizeof(buf2), &count));
   ASSERT_EQ((uint64_t)3, count);
   ASSERT_EQ(0, strncmp(buf2, "wor", count));
 }
 
 // Seek test NS_SEEK_END - length > real one
 TEST(TestSlicedInputStream, Seek_END_Bigger) {
   nsCString buf;
-  buf.Assign("Hello world");
+  buf.AssignLiteral("Hello world");
 
   nsCOMPtr<nsIInputStream> stream;
   NS_NewCStringInputStream(getter_AddRefs(stream), buf);
 
   RefPtr<SlicedInputStream> sis = new SlicedInputStream(stream, 2, buf.Length());
 
   ASSERT_EQ(NS_OK, sis->Seek(nsISeekableStream::NS_SEEK_END, -5));
 
@@ -413,17 +413,17 @@ TEST(TestSlicedInputStream, Seek_END_Big
   ASSERT_EQ(NS_OK, stream->Read(buf2, sizeof(buf2), &count));
   ASSERT_EQ((uint64_t)5, count);
   ASSERT_EQ(0, strncmp(buf2, "world", count));
 }
 
 // Seek test NS_SEEK_END - length < real one
 TEST(TestSlicedInputStream, Seek_END_Lower) {
   nsCString buf;
-  buf.Assign("Hello world");
+  buf.AssignLiteral("Hello world");
 
   nsCOMPtr<nsIInputStream> stream;
   NS_NewCStringInputStream(getter_AddRefs(stream), buf);
 
   RefPtr<SlicedInputStream> sis = new SlicedInputStream(stream, 2, 6);
 
   ASSERT_EQ(NS_OK, sis->Seek(nsISeekableStream::NS_SEEK_END, -3));
 
--- a/xpcom/tests/gtest/TestStrings.cpp
+++ b/xpcom/tests/gtest/TestStrings.cpp
@@ -994,69 +994,69 @@ TEST(Strings, Split)
              empty(""),
              delimStart("-two"),
              delimEnd("one-");
 
   nsString wide(u"hello world");
 
   size_t counter = 0;
   for (const nsACString& token : one.Split(',')) {
-    EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("one")));
+    EXPECT_TRUE(token.EqualsLiteral("one"));
     counter++;
   }
   EXPECT_EQ(counter, (size_t)1);
 
   counter = 0;
   for (const nsACString& token : two.Split(';')) {
     if (counter == 0) {
-      EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("one")));
+      EXPECT_TRUE(token.EqualsLiteral("one"));
     } else if (counter == 1) {
-      EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("two")));
+      EXPECT_TRUE(token.EqualsLiteral("two"));
     }
     counter++;
   }
   EXPECT_EQ(counter, (size_t)2);
 
   counter = 0;
   for (const nsACString& token : three.Split('-')) {
     if (counter == 0) {
-      EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("one")));
+      EXPECT_TRUE(token.EqualsLiteral("one"));
     } else if (counter == 1) {
-      EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("")));
+      EXPECT_TRUE(token.EqualsLiteral(""));
     } else if (counter == 2) {
-      EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("three")));
+      EXPECT_TRUE(token.EqualsLiteral("three"));
     }
     counter++;
   }
   EXPECT_EQ(counter, (size_t)3);
 
   counter = 0;
   for (const nsACString& token : empty.Split(',')) {
     mozilla::Unused << token;
     counter++;
   }
   EXPECT_EQ(counter, (size_t)0);
 
   counter = 0;
   for (const nsACString& token : delimStart.Split('-')) {
     if (counter == 0) {
-      EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("")));
+      EXPECT_TRUE(token.EqualsLiteral(""));
     } else if (counter == 1) {
-      EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("two")));
+      EXPECT_TRUE(token.EqualsLiteral("two"));
     }
     counter++;
   }
   EXPECT_EQ(counter, (size_t)2);
 
   counter = 0;
   for (const nsACString& token : delimEnd.Split('-')) {
     if (counter == 0) {
-      EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("one")));
+      EXPECT_TRUE(token.EqualsLiteral("one"));
     } else if (counter == 1) {
-      EXPECT_TRUE(token.Equals(NS_LITERAL_CSTRING("")));
+      EXPECT_TRUE(token.EqualsLiteral(""));
     }
     counter++;
   }
   EXPECT_EQ(counter, (size_t)2);
 
   counter = 0;
   for (const nsAString& token : wide.Split(' ')) {
     if (counter == 0) {