Bug 1648802 - Replace Thunderbird uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals.. r=sg
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Wed, 01 Jul 2020 16:15:43 +0300
changeset 89817 1aa86015cd87b30709412551835bf902025cd7d1
parent 89816 732ab4ae2b4e30db9f43178763f60ecf43574f72
child 89818 b100d6a8e613b15749ca37e0e1fa6a602cc9f8ac
child 89820 9e21e4f7e980493fb6bf1478c3ae4f8ca1182bbd
push id11340
push usermkmelin@iki.fi
push dateWed, 01 Jul 2020 13:18:03 +0000
treeherdertry-comm-central@b100d6a8e613 [default view] [failures only]
reviewerssg
bugs1648802
Bug 1648802 - Replace Thunderbird uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals.. r=sg compare https://phabricator.services.mozilla.com/D80861#change-Yu2oZ2Beo1MA # NS_LITERAL_CSTRING("foo") -> "foo"_ns find . -type f -not -path "*.hg/*" -not -path "third_party/*" -regex ".*\.\(c\|h\|cpp\|mm\)$" -exec sed -i -E 's/NS_LITERAL_CSTRING\("([^\)]+)"\)/"\1"_ns/g' {} \; # NS_LITERAL_STRING("foo") -> u"foo"_ns find . -type f -not -path "*.hg/*" -not -path "third_party/*" -regex ".*\.\(c\|h\|cpp\|mm\)$" -exec sed -i -E 's/NS_LITERAL_STRING\("([^\)]+)"\)/u"\1"_ns/g' {} \; + manual replacements at least in mailnews/imap/src/nsImapService.cpp mailnews/local/src/nsPop3Sink.cpp mailnews/extensions/fts3/src/nsFts3Tokenizer.cpp mailnews/base/test/TestMsgStripRE.cpp mailnews/base/util/nsMsgIncomingServer.cpp mailnews/base/util/nsMsgDBFolder.cpp mailnews/mime/src/mimemult.cpp mailnews/mime/src/mimethtm.cpp mailnews/compose/src/nsMsgCompose.cpp mailnews/import/text/src/nsTextImport.cpp mailnews/import/outlook/src/nsOutlookMail.cpp mailnews/import/winlivemail/nsWMUtils.cpp mailnews/import/becky/src/nsBeckyUtils.cpp mailnews/extensions/smime/src/nsCertPicker.cpp calendar/base/backend/libical/calUtils.cpp suite/components/shell/nsWindowsShellService.cpp mail/components/search/nsMailWinSearchHelper.cpp + clang-format
calendar/base/backend/libical/calUtils.cpp
common/saxparser/nsSAXXMLReader.cpp
mail/components/migration/src/nsMailProfileMigratorUtils.cpp
mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
mail/components/search/nsMailWinSearchHelper.cpp
mail/components/shell/DirectoryProvider.cpp
mail/components/shell/nsWindowsShellService.cpp
mailnews/addrbook/src/nsAbCardProperty.cpp
mailnews/addrbook/src/nsAbContentHandler.cpp
mailnews/addrbook/src/nsAbLDAPDirectory.cpp
mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
mailnews/base/search/src/nsMsgBodyHandler.cpp
mailnews/base/search/src/nsMsgFilter.cpp
mailnews/base/search/src/nsMsgFilterList.cpp
mailnews/base/search/src/nsMsgFilterService.cpp
mailnews/base/search/src/nsMsgSearchAdapter.cpp
mailnews/base/search/src/nsMsgSearchTerm.cpp
mailnews/base/src/nsMailDirProvider.cpp
mailnews/base/src/nsMessenger.cpp
mailnews/base/src/nsMessengerOSXIntegration.mm
mailnews/base/src/nsMessengerUnixIntegration.cpp
mailnews/base/src/nsMessengerWinIntegration.cpp
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgContentPolicy.cpp
mailnews/base/src/nsMsgDBView.cpp
mailnews/base/src/nsMsgFolderCompactor.cpp
mailnews/base/src/nsMsgMailSession.cpp
mailnews/base/src/nsMsgPrintEngine.cpp
mailnews/base/src/nsMsgProgress.cpp
mailnews/base/src/nsMsgWindow.cpp
mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp
mailnews/base/src/nsSpamSettings.cpp
mailnews/base/src/nsSubscribableServer.cpp
mailnews/base/test/TestMsgStripRE.cpp
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/base/util/nsMsgIncomingServer.cpp
mailnews/base/util/nsMsgMailNewsUrl.cpp
mailnews/base/util/nsMsgTxn.cpp
mailnews/base/util/nsMsgUtils.cpp
mailnews/compose/src/nsMsgAttachmentHandler.cpp
mailnews/compose/src/nsMsgCompFields.cpp
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgComposeService.cpp
mailnews/compose/src/nsMsgQuote.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/compose/src/nsMsgSendLater.cpp
mailnews/compose/src/nsSmtpProtocol.cpp
mailnews/compose/src/nsSmtpServer.cpp
mailnews/compose/src/nsSmtpService.cpp
mailnews/db/msgdb/src/nsMsgDatabase.cpp
mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
mailnews/extensions/fts3/src/nsFts3Tokenizer.cpp
mailnews/extensions/smime/src/nsCertPicker.cpp
mailnews/imap/src/nsImapIncomingServer.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/imap/src/nsImapServerResponseParser.cpp
mailnews/imap/src/nsImapService.cpp
mailnews/imap/src/nsImapUtils.cpp
mailnews/import/applemail/src/nsAppleMailImport.cpp
mailnews/import/applemail/src/nsEmlxHelperUtils.mm
mailnews/import/becky/src/nsBeckyAddressBooks.cpp
mailnews/import/becky/src/nsBeckyFilters.cpp
mailnews/import/becky/src/nsBeckyMail.cpp
mailnews/import/becky/src/nsBeckySettings.cpp
mailnews/import/becky/src/nsBeckyUtils.cpp
mailnews/import/outlook/src/nsOutlookCompose.cpp
mailnews/import/outlook/src/nsOutlookMail.cpp
mailnews/import/outlook/src/nsOutlookSettings.cpp
mailnews/import/src/nsImportStringBundle.cpp
mailnews/import/text/src/nsTextImport.cpp
mailnews/import/winlivemail/nsWMSettings.cpp
mailnews/import/winlivemail/nsWMUtils.cpp
mailnews/intl/nsCharsetConverterManager.cpp
mailnews/jsaccount/src/JaUrl.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/local/src/nsLocalUtils.cpp
mailnews/local/src/nsMailboxService.cpp
mailnews/local/src/nsMailboxUrl.cpp
mailnews/local/src/nsMovemailIncomingServer.cpp
mailnews/local/src/nsMovemailService.cpp
mailnews/local/src/nsMsgLocalStoreUtils.cpp
mailnews/local/src/nsMsgMaildirStore.cpp
mailnews/local/src/nsNoIncomingServer.cpp
mailnews/local/src/nsParseMailbox.cpp
mailnews/local/src/nsPop3IncomingServer.cpp
mailnews/local/src/nsPop3Protocol.cpp
mailnews/local/src/nsPop3Sink.cpp
mailnews/local/src/nsRssIncomingServer.cpp
mailnews/mapi/mapihook/src/msgMapiHook.cpp
mailnews/mime/emitters/nsMimeBaseEmitter.cpp
mailnews/mime/src/mimeTextHTMLParsed.cpp
mailnews/mime/src/mimedrft.cpp
mailnews/mime/src/mimeebod.cpp
mailnews/mime/src/mimemoz2.cpp
mailnews/mime/src/mimemult.cpp
mailnews/mime/src/mimethtm.cpp
mailnews/news/src/nsNNTPNewsgroupList.cpp
mailnews/news/src/nsNNTPProtocol.cpp
mailnews/news/src/nsNntpIncomingServer.cpp
mailnews/news/src/nsNntpService.cpp
mailnews/news/src/nsNntpUrl.cpp
suite/components/feeds/nsFeedSniffer.cpp
suite/components/migration/src/nsSuiteProfileMigratorBase.cpp
suite/components/migration/src/nsThunderbirdProfileMigrator.cpp
suite/components/profile/nsSuiteDirectoryProvider.cpp
suite/components/shell/nsWindowsShellService.cpp
--- a/calendar/base/backend/libical/calUtils.cpp
+++ b/calendar/base/backend/libical/calUtils.cpp
@@ -59,19 +59,19 @@ nsCOMPtr<calITimezone> detectTimezone(ic
       logMissingTimezone(tzid);
     }
   }
   return floating();
 }
 
 void logMissingTimezone(char const* tzid) {
   // xxx todo: needs l10n
-  nsString msg(NS_LITERAL_STRING("Timezone \""));
+  nsString msg(u"Timezone \""_ns);
   msg += NS_ConvertUTF8toUTF16(tzid);
-  msg += NS_LITERAL_STRING("\" not found, falling back to floating!");
+  msg += u"\" not found, falling back to floating!"_ns;
   logError(msg);
 }
 
 icaltimezone* getIcalTimezone(calITimezone* tz) {
   icaltimezone* icaltz = nullptr;
   if (!tz) {
     NS_ASSERTION(false, "No Timezone passed to getIcalTimezone");
     return nullptr;
--- a/common/saxparser/nsSAXXMLReader.cpp
+++ b/common/saxparser/nsSAXXMLReader.cpp
@@ -331,15 +331,14 @@ nsresult nsSAXXMLReader::SplitExpatName(
   } else {
     aURI = StringHead(expatStr, break1);
     break2 = expatStr.FindChar(char16_t(0xFFFF), break1 + 1);
     if (break2 == kNotFound) {  // namespace, but no prefix
       aLocalName = Substring(expatStr, break1 + 1);
       aQName = aLocalName;
     } else {  // namespace with prefix
       aLocalName = Substring(expatStr, break1 + 1, break2 - break1 - 1);
-      aQName =
-          Substring(expatStr, break2 + 1) + NS_LITERAL_STRING(":") + aLocalName;
+      aQName = Substring(expatStr, break2 + 1) + u":"_ns + aLocalName;
     }
   }
 
   return NS_OK;
 }
--- a/mail/components/migration/src/nsMailProfileMigratorUtils.cpp
+++ b/mail/components/migration/src/nsMailProfileMigratorUtils.cpp
@@ -36,20 +36,20 @@ void ParseOverrideServers(const char* aS
   // must be translated to "localhost,127.0.0.1"
   nsAutoCString override(aServers);
   int32_t left = 0, right = 0;
   for (;;) {
     right = override.FindChar(';', right);
     const nsACString& host = Substring(
         override, left, (right < 0 ? override.Length() : right) - left);
     if (host.Equals("<local>"))
-      override.Replace(left, 7, NS_LITERAL_CSTRING("localhost,127.0.0.1"));
+      override.Replace(left, 7, "localhost,127.0.0.1"_ns);
     if (right < 0) break;
     left = right + 1;
-    override.Replace(right, 1, NS_LITERAL_CSTRING(","));
+    override.Replace(right, 1, ","_ns);
   }
   aBranch->SetCharPref("network.proxy.no_proxies_on", override);
 }
 
 void GetMigrateDataFromArray(MigrationData* aDataArray,
                              int32_t aDataArrayLength, bool aReplace,
                              nsIFile* aSourceProfile, uint16_t* aResult) {
   nsCOMPtr<nsIFile> sourceFile;
--- a/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -21,17 +21,17 @@
 #include "nsINIParser.h"
 #include "nsMailProfileMigratorUtils.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsServiceManagerUtils.h"
 
 #define MIGRATION_BUNDLE \
   "chrome://messenger/locale/migration/migration.properties"
 
-#define FILE_NAME_PREFS_5X NS_LITERAL_STRING("prefs.js")
+#define FILE_NAME_PREFS_5X u"prefs.js"_ns
 
 ///////////////////////////////////////////////////////////////////////////////
 // nsNetscapeProfileMigratorBase
 nsNetscapeProfileMigratorBase::nsNetscapeProfileMigratorBase() {
   mObserverService = do_GetService("@mozilla.org/observer-service;1");
   mMaxProgress = 0;
   mCurrentProgress = 0;
   mFileCopyTransactionIndex = 0;
@@ -42,17 +42,17 @@ NS_IMPL_ISUPPORTS(nsNetscapeProfileMigra
 
 nsresult nsNetscapeProfileMigratorBase::GetProfileDataFromProfilesIni(
     nsIFile* aDataDir, nsIMutableArray* aProfileNames,
     nsIMutableArray* aProfileLocations) {
   nsCOMPtr<nsIFile> profileIni;
   nsresult rv = aDataDir->Clone(getter_AddRefs(profileIni));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  profileIni->Append(NS_LITERAL_STRING("profiles.ini"));
+  profileIni->Append(u"profiles.ini"_ns);
 
   // Does it exist?
   bool profileFileExists = false;
   rv = profileIni->Exists(&profileFileExists);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!profileFileExists) return NS_ERROR_FILE_NOT_FOUND;
 
--- a/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
+++ b/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp
@@ -19,31 +19,31 @@
 #include "nsNetUtil.h"
 #include "nsSeamonkeyProfileMigrator.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsComponentManagerUtils.h"  // for do_CreateInstance
 #include "mozilla/ArrayUtils.h"
 #include "nsIFile.h"
 
 // Mail specific folder paths
-#define MAIL_DIR_50_NAME NS_LITERAL_STRING("Mail")
-#define IMAP_MAIL_DIR_50_NAME NS_LITERAL_STRING("ImapMail")
-#define NEWS_DIR_50_NAME NS_LITERAL_STRING("News")
+#define MAIL_DIR_50_NAME u"Mail"_ns
+#define IMAP_MAIL_DIR_50_NAME u"ImapMail"_ns
+#define NEWS_DIR_50_NAME u"News"_ns
 
 ///////////////////////////////////////////////////////////////////////////////
 // nsSeamonkeyProfileMigrator
-#define FILE_NAME_JUNKTRAINING NS_LITERAL_STRING("training.dat")
-#define FILE_NAME_PERSONALDICTIONARY NS_LITERAL_STRING("persdict.dat")
-#define FILE_NAME_PERSONAL_ADDRESSBOOK NS_LITERAL_STRING("abook.mab")
-#define FILE_NAME_MAILVIEWS NS_LITERAL_STRING("mailviews.dat")
-#define FILE_NAME_CERT9DB NS_LITERAL_STRING("cert9.db")
-#define FILE_NAME_KEY4DB NS_LITERAL_STRING("key4.db")
-#define FILE_NAME_SECMODDB NS_LITERAL_STRING("secmod.db")
-#define FILE_NAME_PREFS NS_LITERAL_STRING("prefs.js")
-#define FILE_NAME_USER_PREFS NS_LITERAL_STRING("user.js")
+#define FILE_NAME_JUNKTRAINING u"training.dat"_ns
+#define FILE_NAME_PERSONALDICTIONARY u"persdict.dat"_ns
+#define FILE_NAME_PERSONAL_ADDRESSBOOK u"abook.mab"_ns
+#define FILE_NAME_MAILVIEWS u"mailviews.dat"_ns
+#define FILE_NAME_CERT9DB u"cert9.db"_ns
+#define FILE_NAME_KEY4DB u"key4.db"_ns
+#define FILE_NAME_SECMODDB u"secmod.db"_ns
+#define FILE_NAME_PREFS u"prefs.js"_ns
+#define FILE_NAME_USER_PREFS u"user.js"_ns
 
 struct PrefBranchStruct {
   char* prefName;
   int32_t type;
   union {
     char* stringValue;
     int32_t intValue;
     bool boolValue;
@@ -446,17 +446,17 @@ nsresult nsSeamonkeyProfileMigrator::Cop
   //     destination directory pref
 
   nsresult rv;
   uint32_t count = aMailServers.Length();
   for (uint32_t i = 0; i < count; i++) {
     PrefBranchStruct* pref = aMailServers.ElementAt(i);
     nsDependentCString prefName(pref->prefName);
 
-    if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".directory-rel"))) {
+    if (StringEndsWith(prefName, ".directory-rel"_ns)) {
       // When the directories are modified below, we may change the .directory
       // pref. As we don't have a pref branch to modify at this stage and set
       // up the relative folders properly, we'll just remove all the
       // *.directory-rel prefs. Mailnews will cope with this, creating them
       // when it first needs them.
       if (pref->type == nsIPrefBranch::PREF_STRING) free(pref->stringValue);
 
       aMailServers.RemoveElementAt(i);
@@ -616,17 +616,17 @@ nsresult nsSeamonkeyProfileMigrator::Imp
   nsCOMPtr<nsIPrefService> psvc(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Because all operations on nsIPrefService or nsIPrefBranch will update
   // prefs.js directly, we need to backup the current pref file to be used as a
   // base later.
   nsCOMPtr<nsIFile> targetPrefsFile;
   mTargetProfile->Clone(getter_AddRefs(targetPrefsFile));
-  targetPrefsFile->Append(aTargetPrefFileName + NS_LITERAL_STRING(".orig"));
+  targetPrefsFile->Append(aTargetPrefFileName + u".orig"_ns);
   rv = psvc->SavePrefFile(targetPrefsFile);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Load the source pref file.
   rv = psvc->ResetPrefs();
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIFile> sourcePrefsFile;
   mSourceProfile->Clone(getter_AddRefs(sourcePrefsFile));
--- a/mail/components/search/nsMailWinSearchHelper.cpp
+++ b/mail/components/search/nsMailWinSearchHelper.cpp
@@ -81,17 +81,17 @@ NS_IMETHODIMP nsMailWinSearchHelper::Get
     rv = subdir->AppendNative(relativeStr);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsString subdirPath;
     rv = subdir->GetPath(subdirPath);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Form a URL as required by the crawl scope manager
-    nsString subdirURL(NS_LITERAL_STRING("file:///"));
+    nsString subdirURL(u"file:///"_ns);
     subdirURL.Append(subdirPath);
     subdirURL.Append('\\');
 
     BOOL included;
     if (FAILED(crawlScopeManager->IncludedInCrawlScope(subdirURL.get(),
                                                        &included)))
       return NS_ERROR_FAILURE;
 
@@ -201,33 +201,32 @@ NS_IMETHODIMP nsMailWinSearchHelper::Set
   return SUCCEEDED(hr) ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP nsMailWinSearchHelper::RunSetup(bool aEnable) {
   nsresult rv;
   if (!mCurProcD) {
     rv = NS_GetSpecialDirectory("CurProcD", getter_AddRefs(mCurProcD));
     NS_ENSURE_SUCCESS(rv, rv);
-    rv = mCurProcD->Append(NS_LITERAL_STRING("WSEnable.exe"));
+    rv = mCurProcD->Append(u"WSEnable.exe"_ns);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   nsAutoString filePath;
   rv = mCurProcD->GetPath(filePath);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // The parameters are of the format "1 <path>" for enabling and "0 <path>" for
   // disabling
-  nsAutoString params(aEnable ? NS_LITERAL_STRING("1 \"")
-                              : NS_LITERAL_STRING("0 \""));
+  nsAutoString params(aEnable ? u"1 \""_ns : u"0 \""_ns);
   nsAutoString profDPath;
   rv = mProfD->GetPath(profDPath);
   NS_ENSURE_SUCCESS(rv, rv);
   params.Append(profDPath);
-  params.Append(NS_LITERAL_STRING("\""));
+  params.Append(u"\""_ns);
 
   // We need an hWnd to cause UAC to pop up immediately
   // If GetForegroundWindow returns NULL, then the UAC prompt will still appear,
   // but minimized.
   HWND hWnd = GetForegroundWindow();
 
   SHELLEXECUTEINFOW executeInfo = {0};
 
--- a/mail/components/shell/DirectoryProvider.cpp
+++ b/mail/components/shell/DirectoryProvider.cpp
@@ -53,39 +53,39 @@ DirectoryProvider::GetFile(const char* a
 // which specifies a default locale to use.
 
 static void AppendDistroSearchDirs(nsIProperties* aDirSvc,
                                    nsCOMArray<nsIFile>& array) {
   nsCOMPtr<nsIFile> searchPlugins;
   nsresult rv = aDirSvc->Get(XRE_APP_DISTRIBUTION_DIR, NS_GET_IID(nsIFile),
                              getter_AddRefs(searchPlugins));
   if (NS_FAILED(rv)) return;
-  searchPlugins->AppendNative(NS_LITERAL_CSTRING("searchplugins"));
+  searchPlugins->AppendNative("searchplugins"_ns);
 
   bool exists;
   rv = searchPlugins->Exists(&exists);
   if (NS_FAILED(rv) || !exists) return;
 
   nsCOMPtr<nsIFile> commonPlugins;
   rv = searchPlugins->Clone(getter_AddRefs(commonPlugins));
   if (NS_SUCCEEDED(rv)) {
-    commonPlugins->AppendNative(NS_LITERAL_CSTRING("common"));
+    commonPlugins->AppendNative("common"_ns);
     rv = commonPlugins->Exists(&exists);
     if (NS_SUCCEEDED(rv) && exists) {
       array.AppendObject(commonPlugins);
     }
   }
 
   nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
   if (prefs) {
     nsCOMPtr<nsIFile> localePlugins;
     rv = searchPlugins->Clone(getter_AddRefs(localePlugins));
     if (NS_FAILED(rv)) return;
 
-    localePlugins->AppendNative(NS_LITERAL_CSTRING("locale"));
+    localePlugins->AppendNative("locale"_ns);
 
     AutoTArray<nsCString, 10> requestedLocales;
     mozilla::intl::LocaleService::GetInstance()->GetRequestedLocales(
         requestedLocales);
     nsAutoCString locale(requestedLocales[0]);
 
     nsCOMPtr<nsIFile> curLocalePlugins;
     rv = localePlugins->Clone(getter_AddRefs(curLocalePlugins));
--- a/mail/components/shell/nsWindowsShellService.cpp
+++ b/mail/components/shell/nsWindowsShellService.cpp
@@ -109,20 +109,20 @@ nsresult GetHelperPath(nsAutoString& aPa
       do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIFile> appHelper;
   rv = directoryService->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile),
                              getter_AddRefs(appHelper));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = appHelper->Append(NS_LITERAL_STRING("uninstall"));
+  rv = appHelper->Append(u"uninstall"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = appHelper->Append(NS_LITERAL_STRING("helper.exe"));
+  rv = appHelper->Append(u"helper.exe"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return appHelper->GetPath(aPath);
 }
 
 nsresult LaunchHelper(nsAutoString& aPath, nsAutoString& aParams) {
   SHELLEXECUTEINFOW executeInfo = {0};
 
--- a/mailnews/addrbook/src/nsAbCardProperty.cpp
+++ b/mailnews/addrbook/src/nsAbCardProperty.cpp
@@ -620,29 +620,29 @@ nsresult nsAbCardProperty::ConvertToXMLP
   rv = AppendSection(NAME_ATTRS_ARRAY,
                      sizeof(NAME_ATTRS_ARRAY) / sizeof(AppendItem),
                      EmptyString(), bundle, conv, xmlStr);
 
   xmlStr.AppendLiteral("</td></tr><tr><td>");
 
   rv = AppendSection(PHONE_ATTRS_ARRAY,
                      sizeof(PHONE_ATTRS_ARRAY) / sizeof(AppendItem),
-                     NS_LITERAL_STRING("headingPhone"), bundle, conv, xmlStr);
+                     u"headingPhone"_ns, bundle, conv, xmlStr);
 
   if (!m_IsMailList) {
     rv = AppendSection(CUSTOM_ATTRS_ARRAY,
                        sizeof(CUSTOM_ATTRS_ARRAY) / sizeof(AppendItem),
-                       NS_LITERAL_STRING("headingOther"), bundle, conv, xmlStr);
+                       u"headingOther"_ns, bundle, conv, xmlStr);
     rv = AppendSection(CHAT_ATTRS_ARRAY,
                        sizeof(CHAT_ATTRS_ARRAY) / sizeof(AppendItem),
-                       NS_LITERAL_STRING("headingChat"), bundle, conv, xmlStr);
+                       u"headingChat"_ns, bundle, conv, xmlStr);
   } else {
-    rv = AppendSection(
-        CUSTOM_ATTRS_ARRAY, sizeof(CUSTOM_ATTRS_ARRAY) / sizeof(AppendItem),
-        NS_LITERAL_STRING("headingDescription"), bundle, conv, xmlStr);
+    rv = AppendSection(CUSTOM_ATTRS_ARRAY,
+                       sizeof(CUSTOM_ATTRS_ARRAY) / sizeof(AppendItem),
+                       u"headingDescription"_ns, bundle, conv, xmlStr);
 
     xmlStr.AppendLiteral("<section><sectiontitle>");
 
     nsString headingAddresses;
     rv = bundle->GetStringFromName("headingAddresses", headingAddresses);
     NS_ENSURE_SUCCESS(rv, rv);
 
     xmlStr.Append(headingAddresses);
@@ -696,20 +696,20 @@ nsresult nsAbCardProperty::ConvertToXMLP
     }
     xmlStr.AppendLiteral("</section>");
   }
 
   xmlStr.AppendLiteral("</td><td>");
 
   rv = AppendSection(HOME_ATTRS_ARRAY,
                      sizeof(HOME_ATTRS_ARRAY) / sizeof(AppendItem),
-                     NS_LITERAL_STRING("headingHome"), bundle, conv, xmlStr);
+                     u"headingHome"_ns, bundle, conv, xmlStr);
   rv = AppendSection(WORK_ATTRS_ARRAY,
                      sizeof(WORK_ATTRS_ARRAY) / sizeof(AppendItem),
-                     NS_LITERAL_STRING("headingWork"), bundle, conv, xmlStr);
+                     u"headingWork"_ns, bundle, conv, xmlStr);
 
   xmlStr.AppendLiteral("</td></tr></table>");
 
   aXMLSubstr = xmlStr;
 
   return NS_OK;
 }
 
--- a/mailnews/addrbook/src/nsAbContentHandler.cpp
+++ b/mailnews/addrbook/src/nsAbContentHandler.cpp
@@ -157,12 +157,11 @@ nsAbContentHandler::OnStreamComplete(nsI
   NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
   nsCOMPtr<nsPIDOMWindowOuter> parentWindow =
       nsPIDOMWindowOuter::From(domWindow);
 
   RefPtr<mozilla::dom::BrowsingContext> dialogWindow;
   return parentWindow->OpenDialog(
       NS_LITERAL_STRING(
           "chrome://messenger/content/addressbook/abNewCardDialog.xhtml"),
-      EmptyString(),
-      NS_LITERAL_STRING("chrome,resizable=no,titlebar,modal,centerscreen"),
+      EmptyString(), u"chrome,resizable=no,titlebar,modal,centerscreen"_ns,
       cardFromVCard, getter_AddRefs(dialogWindow));
 }
--- a/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
@@ -183,17 +183,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::GetLDAP
      * or more importantly needing to be able to change the
      * preferences entries. Thus to set the URI Spec now, it is
      * only necessary to read the uri pref entry, while in the
      * case where it is not a preference, we need to replace the
      * "moz-abldapdirectory".
      */
     URI = mURINoQuery;
     if (StringBeginsWith(URI, NS_LITERAL_CSTRING(kLDAPDirectoryRoot)))
-      URI.Replace(0, kLDAPDirectoryRootLen, NS_LITERAL_CSTRING("ldap://"));
+      URI.Replace(0, kLDAPDirectoryRootLen, "ldap://"_ns);
   }
 
   nsCOMPtr<nsIIOService> ioService = mozilla::services::GetIOService();
   NS_ENSURE_TRUE(ioService, NS_ERROR_UNEXPECTED);
 
   nsCOMPtr<nsIURI> result;
   rv = ioService->NewURI(URI, nullptr, nullptr, getter_AddRefs(result));
   NS_ENSURE_SUCCESS(rv, rv);
@@ -216,21 +216,20 @@ NS_IMETHODIMP nsAbLDAPDirectory::SetLDAP
 
   rv = SetStringValue("uri", tempLDAPURL);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Now we need to send an update which will ensure our indicators and
   // listeners get updated correctly.
 
   // See if they both start with ldaps: or ldap:
-  bool newIsNotSecure =
-      StringBeginsWith(tempLDAPURL, NS_LITERAL_CSTRING("ldap:"));
+  bool newIsNotSecure = StringBeginsWith(tempLDAPURL, "ldap:"_ns);
 
   if (oldUrl.IsEmpty() ||
-      StringBeginsWith(oldUrl, NS_LITERAL_CSTRING("ldap:")) != newIsNotSecure) {
+      StringBeginsWith(oldUrl, "ldap:"_ns) != newIsNotSecure) {
     // They don't so its time to send round an update.
     nsCOMPtr<nsIAbManager> abManager =
         do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // We inherit from nsIAbDirectory, so this static cast should be safe.
     constexpr auto trueString = u"true"_ns;
     constexpr auto falseString = u"false"_ns;
@@ -483,34 +482,32 @@ NS_IMETHODIMP nsAbLDAPDirectory::UseForA
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::GetProtocolVersion(
     uint32_t* aProtocolVersion) {
   nsAutoCString versionString;
 
-  nsresult rv =
-      GetStringValue("protocolVersion", NS_LITERAL_CSTRING("3"), versionString);
+  nsresult rv = GetStringValue("protocolVersion", "3"_ns, versionString);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *aProtocolVersion = versionString.EqualsLiteral("3")
                           ? (uint32_t)nsILDAPConnection::VERSION3
                           : (uint32_t)nsILDAPConnection::VERSION2;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::SetProtocolVersion(uint32_t aProtocolVersion) {
   // XXX We should cancel any existing LDAP connections here and
   // be ready to re-initialise them with the new auth details.
-  return SetStringValue("protocolVersion",
-                        aProtocolVersion == nsILDAPConnection::VERSION3
-                            ? NS_LITERAL_CSTRING("3")
-                            : NS_LITERAL_CSTRING("2"));
+  return SetStringValue(
+      "protocolVersion",
+      aProtocolVersion == nsILDAPConnection::VERSION3 ? "3"_ns : "2"_ns);
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::GetMaxHits(int32_t* aMaxHits) {
   return GetIntValue("maxHits", kDefaultMaxHits, aMaxHits);
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::SetMaxHits(int32_t aMaxHits) {
   return SetIntValue("maxHits", aMaxHits);
@@ -608,18 +605,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::DeleteC
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::ModifyCard(nsIAbCard* aUpdatedCard) {
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::GetRdnAttributes(nsACString& aRdnAttributes) {
-  return GetStringValue("rdnAttributes", NS_LITERAL_CSTRING("cn"),
-                        aRdnAttributes);
+  return GetStringValue("rdnAttributes", "cn"_ns, aRdnAttributes);
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::SetRdnAttributes(
     const nsACString& aRdnAttributes) {
   return SetStringValue("rdnAttributes", aRdnAttributes);
 }
 
 NS_IMETHODIMP nsAbLDAPDirectory::GetObjectClasses(nsACString& aObjectClasses) {
--- a/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
@@ -359,17 +359,17 @@ NS_IMETHODIMP nsAbLDAPDirectoryQuery::Do
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = url->SetAttributes(returnAttributes);
   // Now do the error check
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Also require the objectClass attribute, it is used by
   // nsAbLDAPCard::SetMetaProperties
-  rv = url->AddAttribute(NS_LITERAL_CSTRING("objectClass"));
+  rv = url->AddAttribute("objectClass"_ns);
 
   nsAutoCString filter;
 
   // Get filter from arguments if set:
   rv = aArguments->GetFilter(filter);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (filter.IsEmpty()) {
--- a/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
+++ b/mailnews/addrbook/src/nsAddbookProtocolHandler.cpp
@@ -80,29 +80,29 @@ nsresult nsAddbookProtocolHandler::Gener
 
   NS_ConvertUTF16toUTF8 utf8String(aOutput.get());
 
   rv = inStr->SetData(utf8String.get(), utf8String.Length());
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aLoadInfo) {
     return NS_NewInputStreamChannelInternal(_retval, aURI, inStr.forget(),
-                                            NS_LITERAL_CSTRING("text/xml"),
-                                            EmptyCString(), aLoadInfo);
+                                            "text/xml"_ns, EmptyCString(),
+                                            aLoadInfo);
   }
 
   nsCOMPtr<nsIPrincipal> nullPrincipal =
       do_CreateInstance("@mozilla.org/nullprincipal;1", &rv);
   NS_ASSERTION(NS_SUCCEEDED(rv), "CreateInstance of nullprincipalfailed.");
   if (NS_FAILED(rv)) return rv;
 
   return NS_NewInputStreamChannel(
       _retval, aURI, inStr.forget(), nullPrincipal,
       nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
-      nsIContentPolicy::TYPE_OTHER, NS_LITERAL_CSTRING("text/xml"));
+      nsIContentPolicy::TYPE_OTHER, "text/xml"_ns);
 }
 
 NS_IMETHODIMP
 nsAddbookProtocolHandler::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
                                      nsIChannel** _retval) {
   nsresult rv;
   nsCOMPtr<nsIAddbookUrl> addbookUrl = do_QueryInterface(aURI, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -134,32 +134,30 @@ nsAddbookProtocolHandler::NewChannel(nsI
     NS_ENSURE_SUCCESS(rv, rv);
 
     // These always succeed because the pipe is initialized above.
     MOZ_ALWAYS_SUCCEEDS(pipe->GetInputStream(getter_AddRefs(pipeIn)));
     MOZ_ALWAYS_SUCCEEDS(pipe->GetOutputStream(getter_AddRefs(pipeOut)));
 
     pipeOut->Close();
     if (aLoadInfo) {
-      return NS_NewInputStreamChannelInternal(
-          _retval, aURI, pipeIn.forget(),
-          NS_LITERAL_CSTRING("application/x-addvcard"), EmptyCString(),
-          aLoadInfo);
+      return NS_NewInputStreamChannelInternal(_retval, aURI, pipeIn.forget(),
+                                              "application/x-addvcard"_ns,
+                                              EmptyCString(), aLoadInfo);
     }
 
     nsCOMPtr<nsIPrincipal> nullPrincipal =
         do_CreateInstance("@mozilla.org/nullprincipal;1", &rv);
     NS_ASSERTION(NS_SUCCEEDED(rv), "CreateInstance of nullprincipal failed.");
     if (NS_FAILED(rv)) return rv;
 
     return NS_NewInputStreamChannel(
         _retval, aURI, pipeIn.forget(), nullPrincipal,
         nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
-        nsIContentPolicy::TYPE_OTHER,
-        NS_LITERAL_CSTRING("application/x-addvcard"));
+        nsIContentPolicy::TYPE_OTHER, "application/x-addvcard"_ns);
   }
 
   nsString output;
   rv = GeneratePrintOutput(addbookUrl, output);
   if (NS_FAILED(rv)) {
     output.AssignLiteral("failed to print. url=");
     nsAutoCString spec;
     rv = aURI->GetSpec(spec);
@@ -345,17 +343,17 @@ nsresult nsAddbookProtocolHandler::Build
   for (CardEnclosure enclosure : cards) {
     bool isMailList;
     if (NS_FAILED(enclosure.card->GetIsMailList(&isMailList)) || isMailList) {
       continue;
     }
 
     nsCString xmlSubstr;
 
-    rv = enclosure.card->TranslateTo(NS_LITERAL_CSTRING("xml"), xmlSubstr);
+    rv = enclosure.card->TranslateTo("xml"_ns, xmlSubstr);
     NS_ENSURE_SUCCESS(rv, rv);
 
     aOutput.AppendLiteral("<separator/>");
     aOutput.Append(NS_ConvertUTF8toUTF16(xmlSubstr));
     aOutput.AppendLiteral("<separator/>");
   }
 
   aOutput.AppendLiteral("</directory>\n");
--- a/mailnews/base/search/src/nsMsgBodyHandler.cpp
+++ b/mailnews/base/search/src/nsMsgBodyHandler.cpp
@@ -310,18 +310,17 @@ int32_t nsMsgBodyHandler::ApplyTransform
     eatThisLine = true;
     return 0;
   }
 
   // Accumulate base64 parts and HTML parts for later decoding or tag stripping.
   if (m_base64part || m_partIsHtml) {
     if (m_partIsHtml && !m_base64part) {
       size_t bufLength = buf.Length();
-      if (!m_partIsQP || bufLength == 0 ||
-          !StringEndsWith(buf, NS_LITERAL_CSTRING("="))) {
+      if (!m_partIsQP || bufLength == 0 || !StringEndsWith(buf, "="_ns)) {
         // Replace newline in HTML with a space.
         buf.Append(' ');
       } else {
         // Strip the soft line break.
         buf.SetLength(bufLength - 1);
       }
     }
     buf.Append(line);
@@ -369,22 +368,21 @@ void nsMsgBodyHandler::StripHtml(nsCStri
 void nsMsgBodyHandler::SniffPossibleMIMEHeader(const nsCString& line) {
   // Some parts of MIME are case-sensitive and other parts are case-insensitive;
   // specifically, the headers are all case-insensitive and the values we care
   // about are also case-insensitive, with the sole exception of the boundary
   // string, so we can't just take the input line and make it lower case.
   nsCString lowerCaseLine(line);
   ToLowerCase(lowerCaseLine);
 
-  if (StringBeginsWith(lowerCaseLine,
-                       NS_LITERAL_CSTRING("content-transfer-encoding:")))
+  if (StringBeginsWith(lowerCaseLine, "content-transfer-encoding:"_ns))
     m_partIsQP =
         lowerCaseLine.Find("quoted-printable", /* ignoreCase = */ true) != -1;
 
-  if (StringBeginsWith(lowerCaseLine, NS_LITERAL_CSTRING("content-type:"))) {
+  if (StringBeginsWith(lowerCaseLine, "content-type:"_ns)) {
     if (lowerCaseLine.Find("text/html", /* ignoreCase = */ true) != -1) {
       m_partIsText = true;
       m_partIsHtml = true;
     } else if (lowerCaseLine.Find("multipart/", /* ignoreCase = */ true) !=
                -1) {
       if (m_isMultipart) {
         // Nested multipart, get ready for new headers.
         m_base64part = false;
@@ -436,18 +434,17 @@ void nsMsgBodyHandler::SniffPossibleMIME
       foundQuote = true;
     }
     int32_t end = line.FindChar(foundQuote ? '\"' : ';', start);
     if (end == -1) end = line.Length();
 
     m_partCharset.Assign(Substring(line, start, end - start));
   }
 
-  if (StringBeginsWith(lowerCaseLine,
-                       NS_LITERAL_CSTRING("content-transfer-encoding:")) &&
+  if (StringBeginsWith(lowerCaseLine, "content-transfer-encoding:"_ns) &&
       lowerCaseLine.Find(ENCODING_BASE64, /* ignoreCase = */ true) != kNotFound)
     m_base64part = true;
 }
 
 /**
  * Decodes the given base64 string.
  *
  * It returns its decoded string in its input.
--- a/mailnews/base/search/src/nsMsgFilter.cpp
+++ b/mailnews/base/search/src/nsMsgFilter.cpp
@@ -545,17 +545,17 @@ nsresult nsMsgFilter::LogRuleHitGeneric(
     if (NS_SUCCEEDED(rv) && customAction)
       customAction->GetName(filterActionName);
     if (filterActionName.IsEmpty())
       bundle->GetStringFromName("filterMissingCustomAction", filterActionName);
     buffer += filterActionName;
   } else {
     nsString actionValue;
     nsAutoCString filterActionID;
-    filterActionID = NS_LITERAL_CSTRING("filterAction");
+    filterActionID = "filterAction"_ns;
     filterActionID.AppendInt(actionType);
     rv = bundle->GetStringFromName(filterActionID.get(), actionValue);
     NS_ENSURE_SUCCESS(rv, rv);
 
     buffer += actionValue;
   }
   buffer.AppendLiteral("\n");
 
@@ -644,17 +644,17 @@ nsresult nsMsgFilter::ConvertMoveOrCopyT
     } else {
       // start off leaving the value the same.
       filterAction->SetTargetFolderUri(moveValue);
       nsresult rv = NS_OK;
       nsCOMPtr<nsIMsgFolder> localMailRoot;
       rootFolder->GetURI(folderUri);
       // if the root folder is not imap, than the local mail root is the server
       // root. otherwise, it's the migrated local folders.
-      if (!StringBeginsWith(folderUri, NS_LITERAL_CSTRING("imap:")))
+      if (!StringBeginsWith(folderUri, "imap:"_ns))
         localMailRoot = rootFolder;
       else {
         nsCOMPtr<nsIMsgAccountManager> accountManager =
             do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
         NS_ENSURE_SUCCESS(rv, rv);
         nsCOMPtr<nsIMsgIncomingServer> server;
         rv = accountManager->GetLocalFoldersServer(getter_AddRefs(server));
         if (NS_SUCCEEDED(rv) && server)
--- a/mailnews/base/search/src/nsMsgFilterList.cpp
+++ b/mailnews/base/search/src/nsMsgFilterList.cpp
@@ -206,17 +206,17 @@ nsresult nsMsgFilterList::GetLogFile(nsI
     rv = filterLogFile->SetLeafName(filterLogName);
     NS_ENSURE_SUCCESS(rv, rv);
 
     filterLogFile.forget(aFile);
   } else {
     rv = server->GetLocalPath(aFile);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = (*aFile)->AppendNative(NS_LITERAL_CSTRING("filterlog.html"));
+    rv = (*aFile)->AppendNative("filterlog.html"_ns);
     NS_ENSURE_SUCCESS(rv, rv);
   }
   return EnsureLogFile(*aFile);
 }
 
 NS_IMETHODIMP
 nsMsgFilterList::GetLogURL(nsACString& aLogURL) {
   nsCOMPtr<nsIFile> file;
@@ -349,34 +349,32 @@ nsMsgFilterList::ApplyFiltersToHdr(nsMsg
           MOZ_LOG(FILTERLOGMODULE, LogLevel::Debug,
                   ("(Auto) Matched message ID: %s", msgId.get()));
 
           bool applyMore = true;
           rv = listener->ApplyFilterHit(filter, msgWindow, &applyMore);
           if (NS_FAILED(rv)) {
             MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
                     ("(Auto) Applying filter actions failed"));
-            LogFilterMessage(
-                NS_LITERAL_STRING("Applying filter actions failed"), filter);
+            LogFilterMessage(u"Applying filter actions failed"_ns, filter);
           } else {
             MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
                     ("(Auto) Applying filter actions succeeded"));
           }
           if (NS_FAILED(rv) || !applyMore) {
             MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
                     ("(Auto) Stopping further filter execution"
                      " on this message"));
             break;
           }
         } else {
           if (NS_FAILED(matchTermStatus)) {
             MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
                     ("(Auto) Filter evaluation failed"));
-            LogFilterMessage(NS_LITERAL_STRING("Filter evaluation failed"),
-                             filter);
+            LogFilterMessage(u"Filter evaluation failed"_ns, filter);
           }
           if (!result)
             MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
                     ("(Auto) Filter didn't match"));
         }
       } else {
         MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
                 ("(Auto) Skipping filter of non-matching type"
@@ -385,17 +383,17 @@ nsMsgFilterList::ApplyFiltersToHdr(nsMsg
       }
     }
   }
   if (NS_FAILED(rv)) {
     // clang-format off
     MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
             ("(Auto) Filter run failed (%" PRIx32 ")", static_cast<uint32_t>(rv)));
     // clang-format on
-    LogFilterMessage(NS_LITERAL_STRING("Filter run failed"), nullptr);
+    LogFilterMessage(u"Filter run failed"_ns, nullptr);
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgFilterList::SetDefaultFile(nsIFile* aFile) {
   m_defaultFile = aFile;
   return NS_OK;
--- a/mailnews/base/search/src/nsMsgFilterService.cpp
+++ b/mailnews/base/search/src/nsMsgFilterService.cpp
@@ -248,23 +248,22 @@ nsresult nsMsgFilterService::BackUpFilte
   nsCOMPtr<nsIFile> localParentDir;
   nsresult rv = aFilterFile->GetParent(getter_AddRefs(localParentDir));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // if back-up file exists delete the back up file otherwise copy fails.
   nsCOMPtr<nsIFile> backupFile;
   rv = localParentDir->Clone(getter_AddRefs(backupFile));
   NS_ENSURE_SUCCESS(rv, rv);
-  backupFile->AppendNative(NS_LITERAL_CSTRING("rulesbackup.dat"));
+  backupFile->AppendNative("rulesbackup.dat"_ns);
   bool exists;
   backupFile->Exists(&exists);
   if (exists) backupFile->Remove(false);
 
-  return aFilterFile->CopyToNative(localParentDir,
-                                   NS_LITERAL_CSTRING("rulesbackup.dat"));
+  return aFilterFile->CopyToNative(localParentDir, "rulesbackup.dat"_ns);
 }
 
 nsresult nsMsgFilterService::AlertBackingUpFilterFile(
     nsIMsgWindow* aMsgWindow) {
   return ThrowAlertMsg("filterListBackUpMsg", aMsgWindow);
 }
 
 // Do not use this routine if you have to call it very often because it creates
@@ -483,18 +482,17 @@ nsresult nsMsgFilterAfterTheFact::RunNex
     rv = m_searchSession->Search(m_msgWindow);
     CONTINUE_IF_FAILURE(rv, "Search failed");
     return NS_OK;  // OnSearchDone will continue
   }
 
   if (NS_FAILED(rv)) {
     MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
             ("(Post) Filter evaluation failed"));
-    m_filters->LogFilterMessage(NS_LITERAL_STRING("Filter evaluation failed"),
-                                m_curFilter);
+    m_filters->LogFilterMessage(u"Filter evaluation failed"_ns, m_curFilter);
   }
 
   m_curFilter = nullptr;
   NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Search failed");
   return AdvanceToNextFolder();
 }
 
 nsresult nsMsgFilterAfterTheFact::AdvanceToNextFolder() {
@@ -894,21 +892,21 @@ nsresult nsMsgFilterAfterTheFact::ApplyF
           BREAK_ACTION_IF_FAILURE(rv, "Could not get compose service");
           for (auto msgHdr : hitHdrs) {
             rv = compService->ReplyWithTemplate(msgHdr, replyTemplateUri.get(),
                                                 m_msgWindow, server);
             if (NS_FAILED(rv)) {
               if (rv == NS_ERROR_ABORT) {
                 (void)m_curFilter->LogRuleHitFail(
                     filterAction, msgHdr, rv,
-                    NS_LITERAL_CSTRING("filterFailureSendingReplyAborted"));
+                    "filterFailureSendingReplyAborted"_ns);
               } else {
                 (void)m_curFilter->LogRuleHitFail(
                     filterAction, msgHdr, rv,
-                    NS_LITERAL_CSTRING("filterFailureSendingReplyError"));
+                    "filterFailureSendingReplyError"_ns);
               }
             }
             BREAK_ACTION_IF_FAILURE(rv, "ReplyWithTemplate failed");
           }
         } break;
         case nsMsgFilterAction::DeleteFromPop3Server: {
           nsCOMPtr<nsIMsgLocalMailFolder> localFolder =
               do_QueryInterface(curFolder, &rv);
@@ -1002,19 +1000,18 @@ nsresult nsMsgFilterAfterTheFact::ApplyF
       }
       if (NS_FAILED(finalResult)) {
         mFinalResult = finalResult;
         MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
                 ("(Post) Action execution failed with error: %" PRIx32,
                  static_cast<uint32_t>(mFinalResult)));
         if (loggingEnabled) {
           nsCOMPtr<nsIMsgDBHdr> msgHdr = do_QueryElementAt(m_searchHitHdrs, 0);
-          (void)m_curFilter->LogRuleHitFail(
-              filterAction, msgHdr, mFinalResult,
-              NS_LITERAL_CSTRING("filterActionFailed"));
+          (void)m_curFilter->LogRuleHitFail(filterAction, msgHdr, mFinalResult,
+                                            "filterActionFailed"_ns);
         }
       } else {
         MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
                 ("(Post) Action execution succeeded"));
       }
     }
   } while (false);  // end error management block
   MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
@@ -1261,18 +1258,17 @@ nsresult nsMsgApplyFiltersToMessages::Ru
   }
 
   if (NS_FAILED(rv)) {
     // clang-format off
     MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
             ("(Post) Filter run failed (%" PRIx32 ")",
              static_cast<uint32_t>(rv)));
     // clang-format on
-    m_filters->LogFilterMessage(NS_LITERAL_STRING("Filter run failed"),
-                                m_curFilter);
+    m_filters->LogFilterMessage(u"Filter run failed"_ns, m_curFilter);
     NS_WARNING_ASSERTION(false, "Failed to run filters");
   } else {
     MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
             ("(Post) Filter run finished on the current folder"));
   }
 
   m_curFilter = nullptr;
 
--- a/mailnews/base/search/src/nsMsgSearchAdapter.cpp
+++ b/mailnews/base/search/src/nsMsgSearchAdapter.cpp
@@ -204,20 +204,19 @@ nsresult nsMsgSearchAdapter::GetSearchCh
       rv = prefs->GetComplexValue("mailnews.view_default_charset",
                                   NS_GET_IID(nsIPrefLocalizedString),
                                   getter_AddRefs(localizedstr));
       if (NS_SUCCEEDED(rv)) localizedstr->GetData(m_defaultCharset);
 
       prefs->GetBoolPref("mailnews.force_ascii_search", &forceAsciiSearch);
     }
   }
-  srcCharset =
-      m_defaultCharset.IsEmpty()
-          ? static_cast<const nsAString&>(NS_LITERAL_STRING("ISO-8859-1"))
-          : m_defaultCharset;
+  srcCharset = m_defaultCharset.IsEmpty()
+                   ? static_cast<const nsAString&>(u"ISO-8859-1"_ns)
+                   : m_defaultCharset;
 
   if (m_scope) {
     // ### DMB is there a way to get the charset for the "window"?
 
     nsCOMPtr<nsIMsgFolder> folder;
     rv = m_scope->GetFolder(getter_AddRefs(folder));
 
     // Ask the newsgroup/folder for its csid.
--- a/mailnews/base/search/src/nsMsgSearchTerm.cpp
+++ b/mailnews/base/search/src/nsMsgSearchTerm.cpp
@@ -845,17 +845,17 @@ nsresult nsMsgSearchTerm::MatchBody(nsIM
 
   nsCString compare;
   nsCString charset;
   while (!endOfFile && result == boolContinueLoop) {
     if (bodyHan->GetNextLine(buf, charset) >= 0) {
       bool softLineBreak = false;
       // Do in-place decoding of quoted printable
       if (bodyHan->IsQP()) {
-        softLineBreak = StringEndsWith(buf, NS_LITERAL_CSTRING("="));
+        softLineBreak = StringEndsWith(buf, "="_ns);
         MsgStripQuotedPrintable(buf);
         // If soft line break, chop off the last char as well.
         size_t bufLength = buf.Length();
         if ((bufLength > 0) && softLineBreak) buf.SetLength(bufLength - 1);
       }
       compare.Append(buf);
       // If this line ends with a soft line break, loop around
       // and get the next line before looking for the search string.
--- a/mailnews/base/src/nsMailDirProvider.cpp
+++ b/mailnews/base/src/nsMailDirProvider.cpp
@@ -134,17 +134,17 @@ nsMailDirProvider::AppendingEnumerator::
     mBase->GetNext(getter_AddRefs(nextbasesupp));
 
     nsCOMPtr<nsIFile> nextbase(do_QueryInterface(nextbasesupp));
     if (!nextbase) continue;
 
     nextbase->Clone(getter_AddRefs(mNext));
     if (!mNext) continue;
 
-    mNext->AppendNative(NS_LITERAL_CSTRING("isp"));
+    mNext->AppendNative("isp"_ns);
     bool exists;
     nsresult rv = mNext->Exists(&exists);
     if (NS_SUCCEEDED(rv) && exists) {
       break;
     }
 
     mNext = nullptr;
   }
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -234,18 +234,18 @@ NS_IMETHODIMP nsMessenger::SetWindow(moz
     mWindow = aWin;
 
     rv = mailSession->AddFolderListener(this, nsIFolderListener::removed);
     NS_ENSURE_SUCCESS(rv, rv);
 
     NS_ENSURE_TRUE(aWin, NS_ERROR_FAILURE);
     nsCOMPtr<nsPIDOMWindowOuter> win = nsPIDOMWindowOuter::From(aWin);
     nsIDocShell* rootShell = win->GetDocShell();
-    RefPtr<mozilla::dom::Element> el = rootShell->GetDocument()->GetElementById(
-        NS_LITERAL_STRING("messagepane"));
+    RefPtr<mozilla::dom::Element> el =
+        rootShell->GetDocument()->GetElementById(u"messagepane"_ns);
     RefPtr<mozilla::dom::XULFrameElement> frame =
         mozilla::dom::XULFrameElement::FromNodeOrNull(el);
     mDocShell = nullptr;
     RefPtr<mozilla::dom::Document> doc;
     if (frame) doc = frame->GetContentDocument();
     if (doc) mDocShell = doc->GetDocShell();
     if (mDocShell) {
       // Important! Clear out mCurrentDisplayCharset so we reset a default
@@ -356,17 +356,17 @@ nsresult nsMessenger::PromptIfFileExists
   currentFile->GetLeafName(leafName);
   if (!leafName.IsEmpty())
     path.Assign(leafName);  // path should be a copy of leafName
 
   nsCOMPtr<nsIFilePicker> filePicker =
       do_CreateInstance("@mozilla.org/filepicker;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   nsString saveAttachmentStr;
-  GetString(NS_LITERAL_STRING("SaveAttachment"), saveAttachmentStr);
+  GetString(u"SaveAttachment"_ns, saveAttachmentStr);
   filePicker->Init(mWindow, saveAttachmentStr, nsIFilePicker::modeSave);
   filePicker->SetDefaultString(path);
   filePicker->AppendFilters(nsIFilePicker::filterAll);
 
   nsCOMPtr<nsIFile> lastSaveDir;
   rv = GetLastSaveDirectory(getter_AddRefs(lastSaveDir));
   if (NS_SUCCEEDED(rv) && lastSaveDir) {
     filePicker->SetDisplayDirectory(lastSaveDir);
@@ -418,17 +418,17 @@ nsMessenger::AddMsgUrlToNavigateHistory(
     // more interesting to prune the back and forward menu.
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMessenger::OpenURL(const nsACString& aURL) {
   // This is to setup the display DocShell as UTF-8 capable...
-  SetDisplayCharset(NS_LITERAL_CSTRING("UTF-8"));
+  SetDisplayCharset("UTF-8"_ns);
 
   nsCOMPtr<nsIMsgMessageService> messageService;
   nsresult rv = GetMessageServiceFromURI(aURL, getter_AddRefs(messageService));
 
   if (NS_SUCCEEDED(rv) && messageService) {
     nsCOMPtr<nsIURI> dummyNull;
     messageService->DisplayMessage(PromiseFlatCString(aURL).get(), mDocShell,
                                    mMsgWindow, nullptr, nullptr,
@@ -459,59 +459,58 @@ NS_IMETHODIMP nsMessenger::LaunchExterna
   NS_ENSURE_SUCCESS(rv, rv);
   return extProtService->LoadURI(uri, nullptr, nullptr);
 }
 
 NS_IMETHODIMP
 nsMessenger::LoadURL(mozIDOMWindowProxy* aWin, const nsACString& aURL) {
   nsresult rv;
 
-  SetDisplayCharset(NS_LITERAL_CSTRING("UTF-8"));
+  SetDisplayCharset("UTF-8"_ns);
 
   NS_ConvertASCIItoUTF16 uriString(aURL);
   // Cleanup the empty spaces that might be on each end.
   uriString.Trim(" ");
   // Eliminate embedded newlines, which single-line text fields now allow:
   uriString.StripChars("\r\n");
   NS_ENSURE_TRUE(!uriString.IsEmpty(), NS_ERROR_FAILURE);
 
   bool loadingFromFile = false;
   bool getDummyMsgHdr = false;
   int64_t fileSize;
 
-  if (StringBeginsWith(uriString, NS_LITERAL_STRING("file:"))) {
+  if (StringBeginsWith(uriString, u"file:"_ns)) {
     nsCOMPtr<nsIURI> fileUri;
     rv = NS_NewURI(getter_AddRefs(fileUri), uriString);
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIFileURL> fileUrl = do_QueryInterface(fileUri, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIFile> file;
     rv = fileUrl->GetFile(getter_AddRefs(file));
     NS_ENSURE_SUCCESS(rv, rv);
     file->GetFileSize(&fileSize);
-    uriString.Replace(0, 5, NS_LITERAL_STRING("mailbox:"));
+    uriString.Replace(0, 5, u"mailbox:"_ns);
     uriString.AppendLiteral(u"&number=0");
     loadingFromFile = true;
     getDummyMsgHdr = true;
-  } else if (StringBeginsWith(uriString, NS_LITERAL_STRING("mailbox:")) &&
-             (CaseInsensitiveFindInReadable(NS_LITERAL_STRING(".eml?"),
-                                            uriString))) {
+  } else if (StringBeginsWith(uriString, u"mailbox:"_ns) &&
+             (CaseInsensitiveFindInReadable(u".eml?"_ns, uriString))) {
     // if we have a mailbox:// url that points to an .eml file, we have to read
     // the file size as well
-    uriString.Replace(0, 8, NS_LITERAL_STRING("file:"));
+    uriString.Replace(0, 8, u"file:"_ns);
     nsCOMPtr<nsIURI> fileUri;
     rv = NS_NewURI(getter_AddRefs(fileUri), uriString);
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIFileURL> fileUrl = do_QueryInterface(fileUri, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIFile> file;
     rv = fileUrl->GetFile(getter_AddRefs(file));
     NS_ENSURE_SUCCESS(rv, rv);
     file->GetFileSize(&fileSize);
-    uriString.Replace(0, 5, NS_LITERAL_STRING("mailbox:"));
+    uriString.Replace(0, 5, u"mailbox:"_ns);
     loadingFromFile = true;
     getDummyMsgHdr = true;
   } else if (uriString.Find("type=application/x-message-display") >= 0)
     getDummyMsgHdr = true;
 
   nsCOMPtr<nsIURI> uri;
   rv = NS_NewURI(getter_AddRefs(uri), uriString);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -756,19 +755,19 @@ nsresult nsMessenger::SaveOneAttachment(
   nsCOMPtr<nsIFile> localFile;
   nsCOMPtr<nsIFile> lastSaveDir;
   nsCString filePath;
   nsString saveAttachmentStr;
   nsString defaultDisplayString;
   ConvertAndSanitizeFileName(aDisplayName, defaultDisplayString);
 
   if (detaching) {
-    GetString(NS_LITERAL_STRING("DetachAttachment"), saveAttachmentStr);
+    GetString(u"DetachAttachment"_ns, saveAttachmentStr);
   } else {
-    GetString(NS_LITERAL_STRING("SaveAttachment"), saveAttachmentStr);
+    GetString(u"SaveAttachment"_ns, saveAttachmentStr);
   }
   filePicker->Init(mWindow, saveAttachmentStr, nsIFilePicker::modeSave);
   filePicker->SetDefaultString(defaultDisplayString);
 
   // Check if the attachment file name has an extension (which must not
   // contain spaces) and set it as the default extension for the attachment.
   int32_t extensionIndex = defaultDisplayString.RFindChar('.');
   if (extensionIndex > 0 &&
@@ -844,19 +843,19 @@ nsresult nsMessenger::SaveAllAttachments
       do_CreateInstance("@mozilla.org/filepicker;1", &rv);
   nsCOMPtr<nsIFile> localFile;
   nsCOMPtr<nsIFile> lastSaveDir;
   int16_t dialogResult;
   nsString saveAttachmentStr;
 
   NS_ENSURE_SUCCESS(rv, rv);
   if (detaching) {
-    GetString(NS_LITERAL_STRING("DetachAllAttachments"), saveAttachmentStr);
+    GetString(u"DetachAllAttachments"_ns, saveAttachmentStr);
   } else {
-    GetString(NS_LITERAL_STRING("SaveAllAttachments"), saveAttachmentStr);
+    GetString(u"SaveAllAttachments"_ns, saveAttachmentStr);
   }
   filePicker->Init(mWindow, saveAttachmentStr, nsIFilePicker::modeGetFolder);
 
   rv = GetLastSaveDirectory(getter_AddRefs(lastSaveDir));
   if (NS_SUCCEEDED(rv) && lastSaveDir)
     filePicker->SetDisplayDirectory(lastSaveDir);
 
   rv = ShowPicker(filePicker, &dialogResult);
@@ -1064,20 +1063,20 @@ nsMessenger::SaveAs(const nsACString& aU
     // The saveListener is owned by whoever we ultimately register the
     // listener with, generally a URL.
     saveListener = new nsSaveMsgListener(tmpFile, this, nullptr);
 
     if (aIdentity)
       rv = aIdentity->GetStationeryFolder(saveListener->m_templateUri);
     if (NS_FAILED(rv)) goto done;
 
-    bool needDummyHeader = StringBeginsWith(saveListener->m_templateUri,
-                                            NS_LITERAL_CSTRING("mailbox://"));
-    bool canonicalLineEnding = StringBeginsWith(saveListener->m_templateUri,
-                                                NS_LITERAL_CSTRING("imap://"));
+    bool needDummyHeader =
+        StringBeginsWith(saveListener->m_templateUri, "mailbox://"_ns);
+    bool canonicalLineEnding =
+        StringBeginsWith(saveListener->m_templateUri, "imap://"_ns);
 
     rv = saveListener->QueryInterface(NS_GET_IID(nsIUrlListener),
                                       getter_AddRefs(urlListener));
     if (NS_FAILED(rv)) goto done;
 
     nsCOMPtr<nsIURI> dummyNull;
     rv = messageService->SaveMessageToDisk(
         PromiseFlatCString(aURI).get(), tmpFile, needDummyHeader, urlListener,
@@ -1094,48 +1093,48 @@ done:
 nsresult nsMessenger::GetSaveAsFile(const nsAString& aMsgFilename,
                                     int32_t* aSaveAsFileType,
                                     nsIFile** aSaveAsFile) {
   nsresult rv;
   nsCOMPtr<nsIFilePicker> filePicker =
       do_CreateInstance("@mozilla.org/filepicker;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   nsString saveMailAsStr;
-  GetString(NS_LITERAL_STRING("SaveMailAs"), saveMailAsStr);
+  GetString(u"SaveMailAs"_ns, saveMailAsStr);
   filePicker->Init(mWindow, saveMailAsStr, nsIFilePicker::modeSave);
 
   // if we have a non-null filename use it, otherwise use default save message
   // one
   if (aMsgFilename.IsEmpty()) {
     nsString saveMsgStr;
-    GetString(NS_LITERAL_STRING("defaultSaveMessageAsFileName"), saveMsgStr);
+    GetString(u"defaultSaveMessageAsFileName"_ns, saveMsgStr);
     filePicker->SetDefaultString(saveMsgStr);
   } else {
     filePicker->SetDefaultString(aMsgFilename);
   }
 
   // because we will be using GetFilterIndex()
   // we must call AppendFilters() one at a time,
   // in MESSENGER_SAVEAS_FILE_TYPE order
   nsString emlFilesStr;
-  GetString(NS_LITERAL_STRING("EMLFiles"), emlFilesStr);
-  filePicker->AppendFilter(emlFilesStr, NS_LITERAL_STRING("*.eml"));
+  GetString(u"EMLFiles"_ns, emlFilesStr);
+  filePicker->AppendFilter(emlFilesStr, u"*.eml"_ns);
   filePicker->AppendFilters(nsIFilePicker::filterHTML);
   filePicker->AppendFilters(nsIFilePicker::filterText);
   filePicker->AppendFilters(nsIFilePicker::filterAll);
 
   // Save as the "All Files" file type by default. We want to save as .eml by
   // default, but the filepickers on some platforms don't switch extensions
   // based on the file type selected (bug 508597).
   filePicker->SetFilterIndex(ANY_FILE_TYPE);
   // Yes, this is fine even if we ultimately save as HTML or text. On Windows,
   // this actually is a boolean telling the file picker to automatically add
   // the correct extension depending on the filter. On Mac or Linux this is a
   // no-op.
-  filePicker->SetDefaultExtension(NS_LITERAL_STRING("eml"));
+  filePicker->SetDefaultExtension(u"eml"_ns);
 
   int16_t dialogResult;
 
   nsCOMPtr<nsIFile> lastSaveDir;
   rv = GetLastSaveDirectory(getter_AddRefs(lastSaveDir));
   if (NS_SUCCEEDED(rv) && lastSaveDir)
     filePicker->SetDisplayDirectory(lastSaveDir);
 
@@ -1204,17 +1203,17 @@ nsresult nsMessenger::GetSaveAsFile(cons
  */
 nsresult nsMessenger::GetSaveToDir(nsIFile** aSaveDir) {
   nsresult rv;
   nsCOMPtr<nsIFilePicker> filePicker =
       do_CreateInstance("@mozilla.org/filepicker;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsString chooseFolderStr;
-  GetString(NS_LITERAL_STRING("ChooseFolder"), chooseFolderStr);
+  GetString(u"ChooseFolder"_ns, chooseFolderStr);
   filePicker->Init(mWindow, chooseFolderStr, nsIFilePicker::modeGetFolder);
 
   nsCOMPtr<nsIFile> lastSaveDir;
   rv = GetLastSaveDirectory(getter_AddRefs(lastSaveDir));
   if (NS_SUCCEEDED(rv) && lastSaveDir)
     filePicker->SetDisplayDirectory(lastSaveDir);
 
   int16_t dialogResult;
@@ -1322,17 +1321,17 @@ nsMessenger::MessageServiceFromURI(const
 }
 
 NS_IMETHODIMP
 nsMessenger::MsgHdrFromURI(const nsACString& aUri, nsIMsgDBHdr** aMsgHdr) {
   NS_ENSURE_ARG_POINTER(aMsgHdr);
   nsCOMPtr<nsIMsgMessageService> msgService;
   nsresult rv;
 
-  if (mMsgWindow && (StringBeginsWith(aUri, NS_LITERAL_CSTRING("file:")) ||
+  if (mMsgWindow && (StringBeginsWith(aUri, "file:"_ns) ||
                      PromiseFlatCString(aUri).Find(
                          "type=application/x-message-display") >= 0)) {
     nsCOMPtr<nsIMsgHeaderSink> headerSink;
     mMsgWindow->GetMsgHeaderSink(getter_AddRefs(headerSink));
     if (headerSink) {
       rv = headerSink->GetDummyMsgHeader(aMsgHdr);
       // Is there a way to check if they're asking for the hdr currently
       // displayed in a stand-alone msg window from a .eml file?
@@ -1352,17 +1351,17 @@ NS_IMETHODIMP nsMessenger::GetUndoTransa
 
   nsresult rv;
   *txnType = nsMessenger::eUnknown;
   nsCOMPtr<nsITransaction> txn;
   rv = mTxnMgr->PeekUndoStack(getter_AddRefs(txn));
   if (NS_SUCCEEDED(rv) && txn) {
     nsCOMPtr<nsIPropertyBag2> propertyBag = do_QueryInterface(txn, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
-    return propertyBag->GetPropertyAsUint32(NS_LITERAL_STRING("type"), txnType);
+    return propertyBag->GetPropertyAsUint32(u"type"_ns, txnType);
   }
   return rv;
 }
 
 NS_IMETHODIMP nsMessenger::CanUndo(bool* bValue) {
   NS_ENSURE_TRUE(bValue && mTxnMgr, NS_ERROR_NULL_POINTER);
 
   nsresult rv;
@@ -1378,17 +1377,17 @@ NS_IMETHODIMP nsMessenger::GetRedoTransa
 
   nsresult rv;
   *txnType = nsMessenger::eUnknown;
   nsCOMPtr<nsITransaction> txn;
   rv = mTxnMgr->PeekRedoStack(getter_AddRefs(txn));
   if (NS_SUCCEEDED(rv) && txn) {
     nsCOMPtr<nsIPropertyBag2> propertyBag = do_QueryInterface(txn, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
-    return propertyBag->GetPropertyAsUint32(NS_LITERAL_STRING("type"), txnType);
+    return propertyBag->GetPropertyAsUint32(u"type"_ns, txnType);
   }
   return rv;
 }
 
 NS_IMETHODIMP nsMessenger::CanRedo(bool* bValue) {
   NS_ENSURE_TRUE(bValue && mTxnMgr, NS_ERROR_NULL_POINTER);
 
   nsresult rv;
@@ -1445,17 +1444,17 @@ nsMessenger::GetTransactionManager(nsITr
   NS_ADDREF(*aTxnMgr = mTxnMgr);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMessenger::SetDocumentCharset(const nsACString& aCharacterSet) {
   // We want to redisplay the currently selected message (if any) but forcing
   // the redisplay to use characterSet
   if (!mLastDisplayURI.IsEmpty()) {
-    SetDisplayCharset(NS_LITERAL_CSTRING("UTF-8"));
+    SetDisplayCharset("UTF-8"_ns);
 
     nsCOMPtr<nsIMsgMessageService> messageService;
     nsresult rv = GetMessageServiceFromURI(mLastDisplayURI,
                                            getter_AddRefs(messageService));
 
     if (NS_SUCCEEDED(rv) && messageService) {
       nsCOMPtr<nsIURI> dummyNull;
       messageService->DisplayMessage(
--- a/mailnews/base/src/nsMessengerOSXIntegration.mm
+++ b/mailnews/base/src/nsMessengerOSXIntegration.mm
@@ -324,20 +324,19 @@ void nsMessengerOSXIntegration::FillTool
 
 nsresult nsMessengerOSXIntegration::ShowAlertMessage(const nsAString& aAlertTitle,
                                                      const nsAString& aAlertText,
                                                      const nsACString& aFolderURI) {
   nsCOMPtr<nsIAlertsService> alertsService = mozilla::components::Alerts::Service();
   nsresult rv = alertsService ? NS_OK : NS_ERROR_UNEXPECTED;
   // If we have an nsIAlertsService implementation, use it:
   if (NS_SUCCEEDED(rv)) {
-    alertsService->ShowAlertNotification(EmptyString(), aAlertTitle, aAlertText, true,
-                                         NS_ConvertASCIItoUTF16(aFolderURI), this, EmptyString(),
-                                         NS_LITERAL_STRING("auto"), EmptyString(), EmptyString(),
-                                         nullptr, false, false);
+    alertsService->ShowAlertNotification(
+        EmptyString(), aAlertTitle, aAlertText, true, NS_ConvertASCIItoUTF16(aFolderURI), this,
+        EmptyString(), u"auto"_ns, EmptyString(), EmptyString(), nullptr, false, false);
   }
 
   BounceDockIcon();
 
   if (NS_FAILED(rv)) OnAlertFinished();
 
   return rv;
 }
--- a/mailnews/base/src/nsMessengerUnixIntegration.cpp
+++ b/mailnews/base/src/nsMessengerUnixIntegration.cpp
@@ -304,18 +304,17 @@ nsresult nsMessengerUnixIntegration::Sho
 
   if (useSystemAlert) {
     nsCOMPtr<nsIAlertsService> alertsService(
         do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID, &rv));
     if (NS_SUCCEEDED(rv)) {
       rv = alertsService->ShowAlertNotification(
           NS_LITERAL_STRING(NEW_MAIL_ALERT_ICON), aAlertTitle, aAlertText,
           false, NS_ConvertASCIItoUTF16(aFolderURI), this, EmptyString(),
-          NS_LITERAL_STRING("auto"), EmptyString(), EmptyString(), nullptr,
-          false, false);
+          u"auto"_ns, EmptyString(), EmptyString(), nullptr, false, false);
       if (NS_SUCCEEDED(rv)) return rv;
     }
   }
   AlertFinished();
   rv = ShowNewAlertNotification(false);
 
   if (NS_FAILED(rv))  // go straight to showing the system tray icon.
     AlertFinished();
--- a/mailnews/base/src/nsMessengerWinIntegration.cpp
+++ b/mailnews/base/src/nsMessengerWinIntegration.cpp
@@ -405,19 +405,18 @@ nsresult nsMessengerWinIntegration::Show
   prefBranch->GetBoolPref(SHOW_ALERT_PREF, &showAlert);
 
   if (showAlert) {
     nsCOMPtr<nsIAlertsService> alertsService =
         mozilla::components::Alerts::Service();
     if (alertsService) {
       rv = alertsService->ShowAlertNotification(
           NS_LITERAL_STRING(NEW_MAIL_ALERT_ICON), aAlertTitle, aAlertText, true,
-          NS_ConvertASCIItoUTF16(aFolderURI), this, EmptyString(),
-          NS_LITERAL_STRING("auto"), EmptyString(), EmptyString(), nullptr,
-          false, false);
+          NS_ConvertASCIItoUTF16(aFolderURI), this, EmptyString(), u"auto"_ns,
+          EmptyString(), EmptyString(), nullptr, false, false);
       mAlertInProgress = true;
     }
   }
 
   if (!showAlert ||
       NS_FAILED(rv))  // go straight to showing the system tray icon.
     AlertFinished();
 
@@ -596,17 +595,17 @@ static void EscapeAmpersands(nsString& a
   if (pos == kNotFound) return;
 
   // Next, see if we only have bare ampersands.
   pos = aToolTip.Find("&&", false, pos);
 
   // Windows tooltip code removes one ampersand from each run,
   // then collapses pairs of amperands. This means that in the easy case,
   // we need to replace each ampersand with three.
-  aToolTip.ReplaceSubstring(NS_LITERAL_STRING("&"), NS_LITERAL_STRING("&&&"));
+  aToolTip.ReplaceSubstring(u"&"_ns, u"&&&"_ns);
   if (pos == kNotFound) return;
 
   // We inserted too many ampersands. Remove some.
   for (;;) {
     pos = aToolTip.Find("&&&&&&", false, pos);
     if (pos == kNotFound) return;
 
     aToolTip.Cut(pos, 1);
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -216,17 +216,17 @@ NS_IMETHODIMP nsMsgAccountManager::Obser
     return NS_OK;
   }
   if (!strcmp(aTopic, "quit-application-granted")) {
     // CleanupOnExit will set m_shutdownInProgress to true.
     CleanupOnExit();
     return NS_OK;
   }
   if (!strcmp(aTopic, ABOUT_TO_GO_OFFLINE_TOPIC)) {
-    nsAutoString dataString(NS_LITERAL_STRING("offline"));
+    nsAutoString dataString(u"offline"_ns);
     if (someData) {
       nsAutoString someDataString(someData);
       if (dataString.Equals(someDataString)) CloseCachedConnections();
     }
     return NS_OK;
   }
   if (!strcmp(aTopic, "sleep_notification")) return CloseCachedConnections();
 
@@ -1971,28 +1971,23 @@ NS_IMETHODIMP nsMsgAccountManager::GetLo
   if (NS_SUCCEEDED(rv) && !serverKey.IsEmpty()) {
     rv = GetIncomingServer(serverKey, aServer);
     if (NS_SUCCEEDED(rv)) return rv;
     // otherwise, we're going to fall through to looking for an existing local
     // folders account, because now we fail creating one if one already exists.
   }
 
   // try ("nobody","Local Folders","none"), and work down to any "none" server.
-  rv = FindServer(NS_LITERAL_CSTRING("nobody"),
-                  NS_LITERAL_CSTRING("Local Folders"),
-                  NS_LITERAL_CSTRING("none"), aServer);
+  rv = FindServer("nobody"_ns, "Local Folders"_ns, "none"_ns, aServer);
   if (NS_FAILED(rv) || !*aServer) {
-    rv = FindServer(NS_LITERAL_CSTRING("nobody"), EmptyCString(),
-                    NS_LITERAL_CSTRING("none"), aServer);
+    rv = FindServer("nobody"_ns, EmptyCString(), "none"_ns, aServer);
     if (NS_FAILED(rv) || !*aServer) {
-      rv = FindServer(EmptyCString(), NS_LITERAL_CSTRING("Local Folders"),
-                      NS_LITERAL_CSTRING("none"), aServer);
+      rv = FindServer(EmptyCString(), "Local Folders"_ns, "none"_ns, aServer);
       if (NS_FAILED(rv) || !*aServer)
-        rv = FindServer(EmptyCString(), EmptyCString(),
-                        NS_LITERAL_CSTRING("none"), aServer);
+        rv = FindServer(EmptyCString(), EmptyCString(), "none"_ns, aServer);
     }
   }
 
   NS_ENSURE_SUCCESS(rv, rv);
   if (!*aServer) return NS_ERROR_FAILURE;
 
   // we don't want the Smart Mailboxes server to be the local server.
   bool hidden;
@@ -2019,19 +2014,18 @@ nsresult nsMsgAccountManager::GetLocalFo
 
   return bundle->GetStringFromName("localFolders", localFoldersName);
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::CreateLocalMailAccount() {
   // create the server
   nsCOMPtr<nsIMsgIncomingServer> server;
-  nsresult rv = CreateIncomingServer(
-      NS_LITERAL_CSTRING("nobody"), NS_LITERAL_CSTRING("Local Folders"),
-      NS_LITERAL_CSTRING("none"), getter_AddRefs(server));
+  nsresult rv = CreateIncomingServer("nobody"_ns, "Local Folders"_ns, "none"_ns,
+                                     getter_AddRefs(server));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsString localFoldersName;
   rv = GetLocalFoldersPrettyName(localFoldersName);
   NS_ENSURE_SUCCESS(rv, rv);
   server->SetPrettyName(localFoldersName);
 
   nsCOMPtr<nsINoIncomingServer> noServer;
@@ -2239,18 +2233,17 @@ nsresult VirtualFolderChangeListener::In
     dbFolderInfo->GetCharProperty("searchStr", searchTermString);
     nsCOMPtr<nsIMsgFilterService> filterService =
         do_GetService(NS_MSGFILTERSERVICE_CONTRACTID, &rv);
     nsCOMPtr<nsIMsgFilterList> filterList;
     rv = filterService->GetTempFilterList(m_virtualFolder,
                                           getter_AddRefs(filterList));
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIMsgFilter> tempFilter;
-    filterList->CreateFilter(NS_LITERAL_STRING("temp"),
-                             getter_AddRefs(tempFilter));
+    filterList->CreateFilter(u"temp"_ns, getter_AddRefs(tempFilter));
     NS_ENSURE_SUCCESS(rv, rv);
     filterList->ParseCondition(tempFilter, searchTermString.get());
     NS_ENSURE_SUCCESS(rv, rv);
     m_searchSession = do_CreateInstance(NS_MSGSEARCHSESSION_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIMutableArray> searchTerms;
     rv = tempFilter->GetSearchTerms(getter_AddRefs(searchTerms));
@@ -2619,17 +2612,17 @@ NS_IMETHODIMP nsMsgAccountManager::LoadV
     while (isMore && NS_SUCCEEDED(lineInputStream->ReadLine(buffer, &isMore))) {
       if (!buffer.IsEmpty()) {
         if (version == -1) {
           buffer.Cut(0, 8);
           nsresult irv;
           version = buffer.ToInteger(&irv);
           continue;
         }
-        if (StringBeginsWith(buffer, NS_LITERAL_CSTRING("uri="))) {
+        if (StringBeginsWith(buffer, "uri="_ns)) {
           buffer.Cut(0, 4);
           dbFolderInfo = nullptr;
 
           rv = GetOrCreateFolder(buffer, getter_AddRefs(virtualFolder));
           NS_ENSURE_SUCCESS(rv, rv);
 
           nsCOMPtr<nsIMsgFolder> grandParent;
           nsCOMPtr<nsIMsgFolder> oldParent;
@@ -2676,33 +2669,30 @@ NS_IMETHODIMP nsMsgAccountManager::LoadV
             // here we make sure if our parent is rooted - if not, we're
             // going to loop and add our parent as a child of its grandparent
             // and repeat until we get to the server, or a folder that
             // has its parent set.
             parentFolder->GetParent(getter_AddRefs(grandParent));
             parentFolder->GetIsServer(&isServer);
             buffer.SetLength(lastSlash);
           } while (!grandParent && !isServer);
-        } else if (dbFolderInfo &&
-                   StringBeginsWith(buffer, NS_LITERAL_CSTRING("scope="))) {
+        } else if (dbFolderInfo && StringBeginsWith(buffer, "scope="_ns)) {
           buffer.Cut(0, 6);
           // if this is a cross folder virtual folder, we have a list of folders
           // uris, and we have to add a pending listener for each of them.
           if (!buffer.IsEmpty()) {
             ParseAndVerifyVirtualFolderScope(buffer);
             dbFolderInfo->SetCharProperty(kSearchFolderUriProp, buffer);
             AddVFListenersForVF(virtualFolder, buffer, msgDBService);
           }
-        } else if (dbFolderInfo &&
-                   StringBeginsWith(buffer, NS_LITERAL_CSTRING("terms="))) {
+        } else if (dbFolderInfo && StringBeginsWith(buffer, "terms="_ns)) {
           buffer.Cut(0, 6);
           dbFolderInfo->SetCharProperty("searchStr", buffer);
         } else if (dbFolderInfo &&
-                   StringBeginsWith(buffer,
-                                    NS_LITERAL_CSTRING("searchOnline="))) {
+                   StringBeginsWith(buffer, "searchOnline="_ns)) {
           buffer.Cut(0, 13);
           dbFolderInfo->SetBooleanProperty("searchOnline",
                                            buffer.EqualsLiteral("true"));
         } else if (dbFolderInfo &&
                    Substring(buffer, 0, SEARCH_FOLDER_FLAG_LEN + 1)
                        .Equals(SEARCH_FOLDER_FLAG "=")) {
           buffer.Cut(0, SEARCH_FOLDER_FLAG_LEN + 1);
           dbFolderInfo->SetCharProperty(SEARCH_FOLDER_FLAG, buffer);
--- a/mailnews/base/src/nsMsgContentPolicy.cpp
+++ b/mailnews/base/src/nsMsgContentPolicy.cpp
@@ -109,18 +109,18 @@ bool nsMsgContentPolicy::ShouldAcceptRem
   rv = ios->NewURI(emailAddress, nullptr, nullptr, getter_AddRefs(mailURI));
   NS_ENSURE_SUCCESS(rv, false);
 
   // check with permission manager
   uint32_t permission = 0;
   mozilla::OriginAttributes attrs;
   RefPtr<mozilla::BasePrincipal> principal =
       mozilla::BasePrincipal::CreateContentPrincipal(mailURI, attrs);
-  rv = mPermissionManager->TestPermissionFromPrincipal(
-      principal, NS_LITERAL_CSTRING("image"), &permission);
+  rv = mPermissionManager->TestPermissionFromPrincipal(principal, "image"_ns,
+                                                       &permission);
   NS_ENSURE_SUCCESS(rv, false);
 
   // Only return true if the permission manager has an explicit allow
   return (permission == nsIPermissionManager::ALLOW_ACTION);
 }
 
 /**
  * Extract the host name from aContentLocation, and look it up in our list
@@ -360,18 +360,18 @@ nsMsgContentPolicy::ShouldLoad(nsIURI* a
     *aDecision = nsIContentPolicy::ACCEPT;
     return NS_OK;
   }
 
   uint32_t permission;
   mozilla::OriginAttributes attrs;
   RefPtr<mozilla::BasePrincipal> principal =
       mozilla::BasePrincipal::CreateContentPrincipal(aContentLocation, attrs);
-  mPermissionManager->TestPermissionFromPrincipal(
-      principal, NS_LITERAL_CSTRING("image"), &permission);
+  mPermissionManager->TestPermissionFromPrincipal(principal, "image"_ns,
+                                                  &permission);
   switch (permission) {
     case nsIPermissionManager::UNKNOWN_ACTION: {
       // No exception was found for this location.
       break;
     }
     case nsIPermissionManager::ALLOW_ACTION: {
       *aDecision = nsIContentPolicy::ACCEPT;
       return NS_OK;
@@ -740,18 +740,18 @@ void nsMsgContentPolicy::ComposeShouldLo
         }
 
         // Test whitelist.
         uint32_t permission;
         mozilla::OriginAttributes attrs;
         RefPtr<mozilla::BasePrincipal> principal =
             mozilla::BasePrincipal::CreateContentPrincipal(aContentLocation,
                                                            attrs);
-        mPermissionManager->TestPermissionFromPrincipal(
-            principal, NS_LITERAL_CSTRING("image"), &permission);
+        mPermissionManager->TestPermissionFromPrincipal(principal, "image"_ns,
+                                                        &permission);
         if (permission == nsIPermissionManager::ALLOW_ACTION)
           *aDecision = nsIContentPolicy::ACCEPT;
       }
     }
   }
 }
 
 already_AddRefed<nsIMsgCompose> nsMsgContentPolicy::GetMsgComposeForContext(
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -2935,20 +2935,18 @@ nsresult nsMsgDBView::ApplyCommandToIndi
     // Provide junk-related batch notifications.
     if (command == nsMsgViewCommandType::junk ||
         command == nsMsgViewCommandType::unjunk) {
       nsCOMPtr<nsIMsgFolderNotificationService> notifier(
           do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
 
       if (notifier)
         notifier->NotifyItemEvent(
-            messageArray, NS_LITERAL_CSTRING("JunkStatusChanged"), nullptr,
-            (command == nsMsgViewCommandType::junk)
-                ? NS_LITERAL_CSTRING("junk")
-                : NS_LITERAL_CSTRING("notjunk"));
+            messageArray, "JunkStatusChanged"_ns, nullptr,
+            (command == nsMsgViewCommandType::junk) ? "junk"_ns : "notjunk"_ns);
     }
   }
 
   folder->EnableNotifications(nsIMsgFolder::allMessageCountNotifications, true);
 
   if (thisIsImapFolder) {
     imapMessageFlagsType flags = kNoImapMsgFlag;
     bool addFlags = false;
@@ -2958,32 +2956,30 @@ nsresult nsMsgDBView::ApplyCommandToIndi
         flags |= kImapMsgSeenFlag;
         addFlags = true;
         break;
       case nsMsgViewCommandType::undeleteMsg:
         flags = kImapMsgDeletedFlag;
         addFlags = false;
         break;
       case nsMsgViewCommandType::junk:
-        return imapFolder->StoreCustomKeywords(
-            msgWindow, NS_LITERAL_CSTRING("Junk"),
-            NS_LITERAL_CSTRING("NonJunk"), imapUids, nullptr);
+        return imapFolder->StoreCustomKeywords(msgWindow, "Junk"_ns,
+                                               "NonJunk"_ns, imapUids, nullptr);
       case nsMsgViewCommandType::unjunk: {
         nsCOMPtr<nsIMsgDBHdr> msgHdr;
         GetHdrForFirstSelectedMessage(getter_AddRefs(msgHdr));
         uint32_t msgFlags = 0;
         if (msgHdr) msgHdr->GetFlags(&msgFlags);
 
         if (msgFlags & nsMsgMessageFlags::IMAPDeleted)
           imapFolder->StoreImapFlags(kImapMsgDeletedFlag, false, imapUids,
                                      nullptr);
 
-        return imapFolder->StoreCustomKeywords(
-            msgWindow, NS_LITERAL_CSTRING("NonJunk"),
-            NS_LITERAL_CSTRING("Junk"), imapUids, nullptr);
+        return imapFolder->StoreCustomKeywords(msgWindow, "NonJunk"_ns,
+                                               "Junk"_ns, imapUids, nullptr);
       }
       default:
         break;
     }
 
     // Can't get here without thisIsImapThreadPane == TRUE.
     if (flags != kNoImapMsgFlag) {
       imapFolder->StoreImapFlags(flags, addFlags, imapUids, nullptr);
--- a/mailnews/base/src/nsMsgFolderCompactor.cpp
+++ b/mailnews/base/src/nsMsgFolderCompactor.cpp
@@ -323,17 +323,17 @@ nsresult nsFolderCompactState::Init(nsIM
   nsresult rv;
 
   m_folder = folder;
   m_baseMessageUri = baseMsgUri;
   m_file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   m_file->InitWithFile(path);
 
-  m_file->SetNativeLeafName(NS_LITERAL_CSTRING("nstmp"));
+  m_file->SetNativeLeafName("nstmp"_ns);
   // Make sure we are not crunching existing nstmp file.
   rv = m_file->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 00600);
   NS_ENSURE_SUCCESS(rv, rv);
 
   m_window = aMsgWindow;
   m_keyArray = new nsMsgKeyArray;
   m_size = 0;
   m_totalMsgSize = 0;
@@ -401,18 +401,17 @@ nsresult nsFolderCompactState::StartComp
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Notify that compaction is beginning.  We do this even if there are no
   // messages to be copied because the summary database still gets blown away
   // which is still pretty interesting.  (And we like consistency.)
   nsCOMPtr<nsIMsgFolderNotificationService> notifier(
       do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
   if (notifier)
-    notifier->NotifyItemEvent(m_folder,
-                              NS_LITERAL_CSTRING("FolderCompactStart"), nullptr,
+    notifier->NotifyItemEvent(m_folder, "FolderCompactStart"_ns, nullptr,
                               EmptyCString());
 
   // TODO: test whether sorting the messages (m_keyArray) by messageOffset
   // would improve performance on large files (less seeks).
   // The m_keyArray is in the order as stored in DB and on IMAP or News
   // the messages stored on the mbox file are not necessarily in the same order.
   if (m_size > 0) {
     nsCOMPtr<nsIURI> notUsed;
@@ -577,19 +576,18 @@ nsresult nsFolderCompactState::FinishCom
   }
   if (m_db) m_db->Close(true);
   m_db = nullptr;
 
   // Notify that compaction of the folder is completed.
   nsCOMPtr<nsIMsgFolderNotificationService> notifier(
       do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
   if (notifier)
-    notifier->NotifyItemEvent(m_folder,
-                              NS_LITERAL_CSTRING("FolderCompactFinish"),
-                              nullptr, EmptyCString());
+    notifier->NotifyItemEvent(m_folder, "FolderCompactFinish"_ns, nullptr,
+                              EmptyCString());
   m_folder->NotifyCompactCompleted();
 
   if (m_compactAll)
     rv = CompactNextFolder();
   else
     CompactCompleted(rv);
 
   return rv;
--- a/mailnews/base/src/nsMsgMailSession.cpp
+++ b/mailnews/base/src/nsMsgMailSession.cpp
@@ -257,17 +257,17 @@ nsresult nsMsgMailSession::GetTopmostMsg
       NS_ENSURE_TRUE(topMostWindow, NS_ERROR_FAILURE);
 
       mozilla::dom::Document* domDocument = topMostWindow->GetDoc();
       NS_ENSURE_TRUE(domDocument, NS_ERROR_FAILURE);
 
       mozilla::dom::Element* domElement = domDocument->GetDocumentElement();
       NS_ENSURE_TRUE(domElement, NS_ERROR_FAILURE);
 
-      domElement->GetAttribute(NS_LITERAL_STRING("windowtype"), windowType);
+      domElement->GetAttribute(u"windowtype"_ns, windowType);
       if (windowType.EqualsLiteral("mail:3pane") ||
           windowType.EqualsLiteral("mail:messageWindow"))
         break;
 
       windowEnum->HasMoreElements(&more);
     }
 
     // identified the top most window
--- a/mailnews/base/src/nsMsgPrintEngine.cpp
+++ b/mailnews/base/src/nsMsgPrintEngine.cpp
@@ -215,17 +215,17 @@ nsMsgPrintEngine::SetWindow(mozIDOMWindo
 
   NS_ENSURE_TRUE(mWindow, NS_ERROR_FAILURE);
   nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(mWindow);
 
   window->GetDocShell()->SetAppType(nsIDocShell::APP_TYPE_MAIL);
 
   nsIDocShell* rootShell = window->GetDocShell();
   RefPtr<mozilla::dom::Element> el =
-      rootShell->GetDocument()->GetElementById(NS_LITERAL_STRING("content"));
+      rootShell->GetDocument()->GetElementById(u"content"_ns);
   RefPtr<mozilla::dom::XULFrameElement> frame =
       mozilla::dom::XULFrameElement::FromNodeOrNull(el);
   NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
   RefPtr<mozilla::dom::Document> doc = frame->GetContentDocument();
   NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
   mDocShell = doc->GetDocShell();
   NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);
   SetupObserver();
@@ -433,18 +433,17 @@ nsresult nsMsgPrintEngine::FireThatLoadO
   // if this is a message part (or .eml file on disk)
   // skip it, because we don't want to print the parent message
   // we want to print the part.
   // example:
   // imap://sspitzer@nsmail-1:143/fetch%3EUID%3E/INBOX%3E180958?part=1.1.2&type=application/x-message-display&filename=test"
   if (!StringBeginsWith(uriCStr, NS_LITERAL_CSTRING(DATA_URL_PREFIX)) &&
       !StringBeginsWith(uriCStr, NS_LITERAL_CSTRING(ADDBOOK_URL_PREFIX)) &&
       !uriCStr.EqualsLiteral("about:blank") &&
-      uriCStr.Find(NS_LITERAL_CSTRING("type=application/x-message-display")) ==
-          -1) {
+      uriCStr.Find("type=application/x-message-display"_ns) == -1) {
     rv = GetMessageServiceFromURI(uriCStr, getter_AddRefs(messageService));
   }
 
   if (NS_SUCCEEDED(rv) && messageService) {
     nsCOMPtr<nsIURI> dummyNull;
     rv = messageService->DisplayMessageForPrinting(
         uriCStr.get(), mDocShell, nullptr, nullptr, getter_AddRefs(dummyNull));
   }
@@ -530,17 +529,17 @@ void nsMsgPrintEngine::PrintMsgWindow() 
         webBrowserPrint->GetGlobalPrintSettings(getter_AddRefs(mPrintSettings));
       }
 
       // fix for bug #118887 and bug #176016
       // don't show the actual url when printing mail messages or addressbook
       // cards. for mail, it can review the salt.  for addrbook, it's a data://
       // url, which means nothing to the end user. needs to be " " and not "" or
       // nullptr, otherwise, we'll still print the url
-      mPrintSettings->SetDocURL(NS_LITERAL_STRING(" "));
+      mPrintSettings->SetDocURL(u" "_ns);
 
       nsresult rv = NS_ERROR_FAILURE;
       if (mIsDoingPrintPreview) {
         if (mStartupPPObs) {
           rv = mStartupPPObs->Observe(nullptr, nullptr, nullptr);
         }
       } else {
         mPrintSettings->SetPrintSilent(mCurrentlyPrintingURI != 0);
--- a/mailnews/base/src/nsMsgProgress.cpp
+++ b/mailnews/base/src/nsMsgProgress.cpp
@@ -60,22 +60,21 @@ NS_IMETHODIMP nsMsgProgress::OpenProgres
   ifptr->SetDataIID(&NS_GET_IID(nsIMsgProgress));
 
   array->AppendElement(ifptr);
   array->AppendElement(parameters);
 
   // Open the dialog.
   RefPtr<mozilla::dom::BrowsingContext> newWindow;
 
-  nsString chromeOptions(NS_LITERAL_STRING("chrome,dependent,centerscreen"));
+  nsString chromeOptions(u"chrome,dependent,centerscreen"_ns);
   if (inDisplayModal) chromeOptions.AppendLiteral(",modal");
 
-  return parent->OpenDialog(NS_ConvertASCIItoUTF16(dialogURL),
-                            NS_LITERAL_STRING("_blank"), chromeOptions, array,
-                            getter_AddRefs(newWindow));
+  return parent->OpenDialog(NS_ConvertASCIItoUTF16(dialogURL), u"_blank"_ns,
+                            chromeOptions, array, getter_AddRefs(newWindow));
 }
 
 NS_IMETHODIMP nsMsgProgress::CloseProgressDialog(bool forceClose) {
   m_closeProgress = true;
   return OnStateChange(nullptr, nullptr, nsIWebProgressListener::STATE_STOP,
                        forceClose ? NS_ERROR_FAILURE : NS_OK);
 }
 
--- a/mailnews/base/src/nsMsgWindow.cpp
+++ b/mailnews/base/src/nsMsgWindow.cpp
@@ -69,18 +69,17 @@ NS_IMETHODIMP nsMsgWindow::GetMessageWin
       // but really, we shouldn't even get here in such cases.
       bool doomed;
       rootShell->IsBeingDestroyed(&doomed);
       if (doomed) {
         return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
       }
 
       RefPtr<mozilla::dom::Element> el =
-          rootShell->GetDocument()->GetElementById(
-              NS_LITERAL_STRING("messagepane"));
+          rootShell->GetDocument()->GetElementById(u"messagepane"_ns);
       RefPtr<mozilla::dom::XULFrameElement> frame =
           mozilla::dom::XULFrameElement::FromNodeOrNull(el);
       NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
       RefPtr<mozilla::dom::Document> doc = frame->GetContentDocument();
       NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
       docShell = doc->GetDocShell();
       NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
 
--- a/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp
+++ b/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp
@@ -384,20 +384,19 @@ nsMsgXFVirtualFolderDBView::OnNewSearch(
   nsCOMPtr<nsIMutableArray> searchTerms;
   rv = searchSession->GetSearchTerms(getter_AddRefs(searchTerms));
   NS_ENSURE_SUCCESS(rv, rv);
   nsCString curSearchAsString;
 
   rv = MsgTermListToString(searchTerms, curSearchAsString);
   // Trim off the initial AND/OR, which is irrelevant and inconsistent between
   // what SearchSpec.jsm generates, and what's in virtualFolders.dat.
-  curSearchAsString.Cut(
-      0,
-      StringBeginsWith(curSearchAsString, NS_LITERAL_CSTRING("AND")) ? 3 : 2);
-  terms.Cut(0, StringBeginsWith(terms, NS_LITERAL_CSTRING("AND")) ? 3 : 2);
+  curSearchAsString.Cut(0,
+                        StringBeginsWith(curSearchAsString, "AND"_ns) ? 3 : 2);
+  terms.Cut(0, StringBeginsWith(terms, "AND"_ns) ? 3 : 2);
 
   NS_ENSURE_SUCCESS(rv, rv);
   // If the search session search string doesn't match the vf search str,
   // then we're doing quick search, which means we don't want to invalidate
   // cached results, or used cached results.
   m_doingQuickSearch = !curSearchAsString.Equals(terms);
 
   if (mTree && !m_doingQuickSearch) mTree->BeginUpdateBatch();
--- a/mailnews/base/src/nsSpamSettings.cpp
+++ b/mailnews/base/src/nsSpamSettings.cpp
@@ -43,17 +43,17 @@ nsSpamSettings::nsSpamSettings() {
 
   mServerFilterTrustFlags = 0;
 
   mUseWhiteList = false;
   mUseServerFilter = false;
 
   nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
                                        getter_AddRefs(mLogFile));
-  if (NS_SUCCEEDED(rv)) mLogFile->Append(NS_LITERAL_STRING("junklog.html"));
+  if (NS_SUCCEEDED(rv)) mLogFile->Append(u"junklog.html"_ns);
 }
 
 nsSpamSettings::~nsSpamSettings() {}
 
 NS_IMPL_ISUPPORTS(nsSpamSettings, nsISpamSettings, nsIUrlListener)
 
 NS_IMETHODIMP
 nsSpamSettings::GetLevel(int32_t* aLevel) {
--- a/mailnews/base/src/nsSubscribableServer.cpp
+++ b/mailnews/base/src/nsSubscribableServer.cpp
@@ -797,18 +797,17 @@ nsSubscribableServer::GetCellText(int32_
 NS_IMETHODIMP
 nsSubscribableServer::GetCellValue(int32_t aRow, nsTreeColumn* aCol,
                                    nsAString& retval) {
   nsString colId;
   aCol->GetId(colId);
   if (colId.EqualsLiteral("nameColumn"))
     retval = NS_ConvertUTF8toUTF16(mRowMap[aRow]->path);
   if (colId.EqualsLiteral("subscribedColumn")) {
-    retval = mRowMap[aRow]->isSubscribed ? NS_LITERAL_STRING("true")
-                                         : NS_LITERAL_STRING("false");
+    retval = mRowMap[aRow]->isSubscribed ? u"true"_ns : u"false"_ns;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSubscribableServer::SetCellText(int32_t aRow, nsTreeColumn* aCol,
                                   const nsAString& aText) {
   return NS_OK;
--- a/mailnews/base/test/TestMsgStripRE.cpp
+++ b/mailnews/base/test/TestMsgStripRE.cpp
@@ -46,19 +46,18 @@ TEST(TestMsgStripRE, TestMsgStripREMain)
 {
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> prefBranch(
       do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   EXPECT_TRUE(NS_SUCCEEDED(rv));
 
   // set localizedRe pref, value "SV,ÆØÅ",
   // \xC3\x86, \xC3\x98 and \xC3\x85 are the UTF-8 encodings of Æ, Ø and Å.
-  rv = prefBranch->SetStringPref(
-      "mailnews.localizedRe",
-      NS_LITERAL_CSTRING("SV,\xC3\x86\xC3\x98\xC3\x85"));
+  rv = prefBranch->SetStringPref("mailnews.localizedRe",
+                                 "SV,\xC3\x86\xC3\x98\xC3\x85"_ns);
   EXPECT_TRUE(NS_SUCCEEDED(rv));
 
   // run our tests
   struct testInfo testInfoStructs[] = {
       // Note that re-encoding always happens in UTF-8.
       {"SV: =?ISO-8859-1?Q?=C6blegr=F8d?=", "=?UTF-8?B?w4ZibGVncsO4ZA==?=",
        true},
       {"=?ISO-8859-1?Q?SV=3A=C6blegr=F8d?=", "=?UTF-8?B?w4ZibGVncsO4ZA==?=",
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -2040,18 +2040,17 @@ nsMsgDBFolder::GetForcePropertyEmpty(con
   *_retval = value.EqualsLiteral("true");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgDBFolder::SetForcePropertyEmpty(const char* aPropertyName, bool aValue) {
   nsAutoCString nameEmpty(aPropertyName);
   nameEmpty.AppendLiteral(".empty");
-  return SetStringProperty(nameEmpty.get(), aValue ? NS_LITERAL_CSTRING("true")
-                                                   : NS_LITERAL_CSTRING(""));
+  return SetStringProperty(nameEmpty.get(), aValue ? "true"_ns : ""_ns);
 }
 
 NS_IMETHODIMP
 nsMsgDBFolder::GetInheritedStringProperty(const char* aPropertyName,
                                           nsACString& aPropertyValue) {
   NS_ENSURE_ARG_POINTER(aPropertyName);
   nsCString value;
   nsCOMPtr<nsIMsgIncomingServer> server;
@@ -3069,20 +3068,19 @@ NS_IMETHODIMP nsMsgDBFolder::GetPrettyNa
 
 // -1: not retrieved yet, 1: English, 0: non-English.
 static int isEnglish = -1;
 
 static bool nonEnglishApp() {
   if (isEnglish == -1) {
     nsAutoCString locale;
     mozilla::intl::LocaleService::GetInstance()->GetAppLocaleAsBCP47(locale);
-    isEnglish = (locale.EqualsLiteral("en") ||
-                 StringBeginsWith(locale, NS_LITERAL_CSTRING("en-")))
-                    ? 1
-                    : 0;
+    isEnglish =
+        (locale.EqualsLiteral("en") || StringBeginsWith(locale, "en-"_ns)) ? 1
+                                                                           : 0;
   }
   return isEnglish ? false : true;
 }
 
 static bool hasTrashName(const nsAString& name) {
   // Microsoft calls the folder "Deleted". If the application is non-English,
   // we want to use the localised name instead.
   return name.LowerCaseEqualsLiteral("trash") ||
@@ -3588,17 +3586,17 @@ nsresult nsMsgDBFolder::CreateDirectoryF
    drive. If that path doesn't currently exist then it will create it. Path is
    strictly an out parameter.
   */
 nsresult nsMsgDBFolder::CreateBackupDirectory(nsIFile** resultFile) {
   nsCOMPtr<nsIFile> path;
   nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(path));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = path->Append(NS_LITERAL_STRING("MozillaMailnews"));
+  rv = path->Append(u"MozillaMailnews"_ns);
   bool pathIsDirectory;
   path->IsDirectory(&pathIsDirectory);
 
   // If that doesn't exist, then we have to create this directory
   if (!pathIsDirectory) {
     bool pathExists;
     path->Exists(&pathExists);
     // If for some reason there's a file with the directory separator
@@ -4933,34 +4931,34 @@ NS_IMETHODIMP nsMsgDBFolder::GetMsgTextF
       contentType.AssignLiteral(u"text/plain");
     else
       mimeHdrParam->GetParameter(contentTypeHdr, nullptr, EmptyCString(), false,
                                  nullptr, contentType);
 
     justPassedEndBoundary = false;
 
     // If we are multipart, then we need to get the boundary
-    if (StringBeginsWith(contentType, NS_LITERAL_STRING("multipart/"),
+    if (StringBeginsWith(contentType, u"multipart/"_ns,
                          nsCaseInsensitiveStringComparator)) {
       nsAutoString boundaryParam;
       mimeHdrParam->GetParameter(contentTypeHdr, "boundary", EmptyCString(),
                                  false, nullptr, boundaryParam);
       if (!boundaryParam.IsEmpty()) {
-        nsAutoCString boundary(NS_LITERAL_CSTRING("--"));
+        nsAutoCString boundary("--"_ns);
         boundary.Append(NS_ConvertUTF16toUTF8(boundaryParam));
         boundaryStack.AppendElement(boundary);
       }
     }
 
     // If we are message/rfc822, then there's another header block coming up
     else if (contentType.LowerCaseEqualsLiteral("message/rfc822"))
       continue;
 
     // If we are a text part, then we want it
-    else if (StringBeginsWith(contentType, NS_LITERAL_STRING("text/"),
+    else if (StringBeginsWith(contentType, u"text/"_ns,
                               nsCaseInsensitiveStringComparator)) {
       inMsgBody = true;
 
       if (contentType.LowerCaseEqualsLiteral("text/html")) msgBodyIsHtml = true;
 
       // Also get the charset if required
       if (charset.IsEmpty()) {
         nsAutoString charsetW;
@@ -5098,24 +5096,24 @@ void nsMsgDBFolder::compressQuotesInMsgS
     if (lineFeedPos != -1) {
       const nsAString& currentLine =
           Substring(aMsgSnippet, offset, lineFeedPos - offset);
       // this catches quoted text ("> "), nested quotes of any level (">> ",
       // ">>> ", ...) it also catches empty line quoted text (">"). It might be
       // over aggressive and require tweaking later. Try to strip the citation.
       // If the current line ends with a ':' and the next line looks like a
       // quoted reply (starts with a ">") skip the current line
-      if (StringBeginsWith(currentLine, NS_LITERAL_STRING(">")) ||
+      if (StringBeginsWith(currentLine, u">"_ns) ||
           (lineFeedPos + 1 < msgBodyStrLen && lineFeedPos &&
            aMsgSnippet[lineFeedPos - 1] == char16_t(':') &&
            aMsgSnippet[lineFeedPos + 1] == char16_t('>'))) {
         lastLineWasAQuote = true;
       } else if (!currentLine.IsEmpty()) {
         if (lastLineWasAQuote) {
-          aCompressedQuotes += NS_LITERAL_STRING(" ... ");
+          aCompressedQuotes += u" ... "_ns;
           lastLineWasAQuote = false;
         }
 
         aCompressedQuotes += currentLine;
         // Don't forget to substitute a space for the line feed.
         aCompressedQuotes += char16_t(' ');
       }
 
@@ -5237,20 +5235,19 @@ NS_IMETHODIMP nsMsgDBFolder::RemoveKeywo
     // If the tag is also a label, we should remove the label too...
 
     for (uint32_t i = 0; i < count; i++) {
       nsCOMPtr<nsIMsgDBHdr> message = do_QueryElementAt(aMessages, i, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
       rv = message->GetStringProperty("keywords", getter_Copies(keywords));
       uint32_t removeCount = 0;
       for (uint32_t j = 0; j < keywordArray.Length(); j++) {
-        bool keywordIsLabel =
-            (StringBeginsWith(keywordArray[j], NS_LITERAL_CSTRING("$label")) &&
-             keywordArray[j].CharAt(6) >= '1' &&
-             keywordArray[j].CharAt(6) <= '5');
+        bool keywordIsLabel = (StringBeginsWith(keywordArray[j], "$label"_ns) &&
+                               keywordArray[j].CharAt(6) >= '1' &&
+                               keywordArray[j].CharAt(6) <= '5');
         if (keywordIsLabel) {
           nsMsgLabelValue labelValue;
           message->GetLabel(&labelValue);
           // if we're removing the keyword that corresponds to a pre 2.0 label,
           // we need to clear the old label attribute on the message.
           if (labelValue == (nsMsgLabelValue)(keywordArray[j].CharAt(6) - '0'))
             message->SetLabel((nsMsgLabelValue)0);
         }
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -988,33 +988,32 @@ nsMsgIncomingServer::GetFilterList(nsIMs
     rv = msgFolder->GetFilePath(getter_AddRefs(thisFolder));
     NS_ENSURE_SUCCESS(rv, rv);
 
     mFilterFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = mFilterFile->InitWithFile(thisFolder);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    mFilterFile->AppendNative(NS_LITERAL_CSTRING("msgFilterRules.dat"));
+    mFilterFile->AppendNative("msgFilterRules.dat"_ns);
 
     bool fileExists;
     mFilterFile->Exists(&fileExists);
     if (!fileExists) {
       nsCOMPtr<nsIFile> oldFilterFile =
           do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
       rv = oldFilterFile->InitWithFile(thisFolder);
       NS_ENSURE_SUCCESS(rv, rv);
-      oldFilterFile->AppendNative(NS_LITERAL_CSTRING("rules.dat"));
+      oldFilterFile->AppendNative("rules.dat"_ns);
 
       oldFilterFile->Exists(&fileExists);
       if (fileExists)  // copy rules.dat --> msgFilterRules.dat
       {
-        rv = oldFilterFile->CopyToNative(
-            thisFolder, NS_LITERAL_CSTRING("msgFilterRules.dat"));
+        rv = oldFilterFile->CopyToNative(thisFolder, "msgFilterRules.dat"_ns);
         NS_ENSURE_SUCCESS(rv, rv);
       }
     }
     nsCOMPtr<nsIMsgFilterService> filterService =
         do_GetService(NS_MSGFILTERSERVICE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = filterService->OpenFilterList(mFilterFile, msgFolder, aMsgWindow,
@@ -1758,17 +1757,17 @@ nsresult nsMsgIncomingServer::ConfigureT
     searchTerm->SetAttrib(nsMsgSearchAttrib::JunkScoreOrigin);
     searchTerm->SetOp(nsMsgSearchOp::Isnt);
     searchTerm->SetBooleanAnd(true);
 
     nsCOMPtr<nsIMsgSearchValue> searchValue;
     searchTerm->GetValue(getter_AddRefs(searchValue));
     NS_ENSURE_SUCCESS(rv, rv);
     searchValue->SetAttrib(nsMsgSearchAttrib::JunkScoreOrigin);
-    searchValue->SetStr(NS_LITERAL_STRING("user"));
+    searchValue->SetStr(u"user"_ns);
     searchTerm->SetValue(searchValue);
 
     searchTerms->InsertElementAt(searchTerm, count);
 
     bool moveOnSpam, markAsReadOnSpam;
     spamSettings->GetMoveOnSpam(&moveOnSpam);
     if (moveOnSpam) {
       nsCString spamFolderURI;
@@ -1859,38 +1858,38 @@ nsresult nsMsgIncomingServer::ConfigureT
 
         rv = newFilter->CreateTerm(getter_AddRefs(term));
         if (NS_SUCCEEDED(rv)) {
           rv = term->GetValue(getter_AddRefs(value));
           if (NS_SUCCEEDED(rv)) {
             // we need to use OtherHeader + 1 so nsMsgFilter::GetTerm will
             // return our custom header.
             value->SetAttrib(nsMsgSearchAttrib::OtherHeader + 1);
-            value->SetStr(NS_LITERAL_STRING("multipart/report"));
+            value->SetStr(u"multipart/report"_ns);
             term->SetAttrib(nsMsgSearchAttrib::OtherHeader + 1);
             term->SetOp(nsMsgSearchOp::Contains);
             term->SetBooleanAnd(true);
-            term->SetArbitraryHeader(NS_LITERAL_CSTRING("Content-Type"));
+            term->SetArbitraryHeader("Content-Type"_ns);
             term->SetValue(value);
             newFilter->AppendTerm(term);
           }
         }
         rv = newFilter->CreateTerm(getter_AddRefs(term));
         if (NS_SUCCEEDED(rv)) {
           rv = term->GetValue(getter_AddRefs(value));
           if (NS_SUCCEEDED(rv)) {
             // XXX todo
             // determine if ::OtherHeader is the best way to do this.
             // see nsMsgSearchOfflineMail::MatchTerms()
             value->SetAttrib(nsMsgSearchAttrib::OtherHeader + 1);
-            value->SetStr(NS_LITERAL_STRING("disposition-notification"));
+            value->SetStr(u"disposition-notification"_ns);
             term->SetAttrib(nsMsgSearchAttrib::OtherHeader + 1);
             term->SetOp(nsMsgSearchOp::Contains);
             term->SetBooleanAnd(true);
-            term->SetArbitraryHeader(NS_LITERAL_CSTRING("Content-Type"));
+            term->SetArbitraryHeader("Content-Type"_ns);
             term->SetValue(value);
             newFilter->AppendTerm(term);
           }
         }
         nsCOMPtr<nsIMsgRuleAction> filterAction;
         rv = newFilter->CreateAction(getter_AddRefs(filterAction));
         if (NS_SUCCEEDED(rv)) {
           filterAction->SetType(nsMsgFilterAction::MoveToFolder);
@@ -1904,17 +1903,17 @@ nsresult nsMsgIncomingServer::ConfigureT
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgIncomingServer::ClearTemporaryReturnReceiptsFilter() {
   if (mFilterList) {
     nsCOMPtr<nsIMsgFilter> mdnFilter;
     nsresult rv = mFilterList->GetFilterNamed(
-        NS_LITERAL_STRING("mozilla-temporary-internal-MDN-receipt-filter"),
+        u"mozilla-temporary-internal-MDN-receipt-filter"_ns,
         getter_AddRefs(mdnFilter));
     if (NS_SUCCEEDED(rv) && mdnFilter)
       return mFilterList->RemoveFilter(mdnFilter);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -2091,18 +2090,17 @@ nsMsgIncomingServer::GetForcePropertyEmp
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgIncomingServer::SetForcePropertyEmpty(const char* aPropertyName,
                                            bool aValue) {
   nsAutoCString nameEmpty(aPropertyName);
   nameEmpty.AppendLiteral(".empty");
-  return SetCharValue(nameEmpty.get(), aValue ? NS_LITERAL_CSTRING("true")
-                                              : NS_LITERAL_CSTRING(""));
+  return SetCharValue(nameEmpty.get(), aValue ? "true"_ns : ""_ns);
 }
 
 NS_IMETHODIMP
 nsMsgIncomingServer::GetSortOrder(int32_t* aSortOrder) {
   NS_ENSURE_ARG_POINTER(aSortOrder);
   *aSortOrder = 100000000;
   return NS_OK;
 }
--- a/mailnews/base/util/nsMsgMailNewsUrl.cpp
+++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp
@@ -1033,17 +1033,17 @@ NS_IMETHODIMP nsMsgMailNewsUrl::SetMsgHe
   mMsgHeaderSink = aMsgHdrSink;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgMailNewsUrl::GetIsMessageUri(bool* aIsMessageUri) {
   NS_ENSURE_ARG(aIsMessageUri);
   nsAutoCString scheme;
   m_baseURL->GetScheme(scheme);
-  *aIsMessageUri = StringEndsWith(scheme, NS_LITERAL_CSTRING("-message"));
+  *aIsMessageUri = StringEndsWith(scheme, "-message"_ns);
   return NS_OK;
 }
 
 NS_IMPL_ISUPPORTS(nsMsgMailNewsUrl::Mutator, nsIURISetters, nsIURIMutator)
 
 NS_IMETHODIMP
 nsMsgMailNewsUrl::Mutate(nsIURIMutator** aMutator) {
   RefPtr<nsMsgMailNewsUrl::Mutator> mutator = new nsMsgMailNewsUrl::Mutator();
--- a/mailnews/base/util/nsMsgTxn.cpp
+++ b/mailnews/base/util/nsMsgTxn.cpp
@@ -211,17 +211,17 @@ nsresult nsMsgTxn::GetMsgWindow(nsIMsgWi
 }
 
 nsresult nsMsgTxn::SetMsgWindow(nsIMsgWindow* msgWindow) {
   m_msgWindow = msgWindow;
   return NS_OK;
 }
 
 nsresult nsMsgTxn::SetTransactionType(uint32_t txnType) {
-  return SetPropertyAsUint32(NS_LITERAL_STRING("type"), txnType);
+  return SetPropertyAsUint32(u"type"_ns, txnType);
 }
 
 /*none of the callers pass null aFolder,
   we always initialize aResult (before we pass in) for the case where the key is
   not in the db*/
 nsresult nsMsgTxn::CheckForToggleDelete(nsIMsgFolder* aFolder,
                                         const nsMsgKey& aMsgKey,
                                         bool* aResult) {
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -836,17 +836,17 @@ nsresult GetOrCreateJunkFolder(const nsA
     if (!exists) {
       // Hack to work around a localization bug with the Junk Folder.
       // Please see Bug #270261 for more information...
       nsString localizedJunkName;
       msgFolder->GetName(localizedJunkName);
 
       // force the junk folder name to be Junk so it gets created on disk
       // correctly...
-      msgFolder->SetName(NS_LITERAL_STRING("Junk"));
+      msgFolder->SetName(u"Junk"_ns);
       msgFolder->SetFlag(nsMsgFolderFlags::Junk);
       rv = msgFolder->CreateStorageIfMissing(aListener);
       NS_ENSURE_SUCCESS(rv, rv);
 
       // now restore the localized folder name...
       msgFolder->SetName(localizedJunkName);
 
       // XXX TODO
--- a/mailnews/compose/src/nsMsgAttachmentHandler.cpp
+++ b/mailnews/compose/src/nsMsgAttachmentHandler.cpp
@@ -347,19 +347,19 @@ nsresult nsMsgAttachmentHandler::PickEnc
       // If there are nulls, we must always encode, because sendmail will
       // blow up.
       encode_p = true;
     } else {
       encode_p = false;
     }
 
     // MIME requires a special case that these types never be encoded.
-    if (StringBeginsWith(m_type, NS_LITERAL_CSTRING("message"),
+    if (StringBeginsWith(m_type, "message"_ns,
                          nsCaseInsensitiveCStringComparator) ||
-        StringBeginsWith(m_type, NS_LITERAL_CSTRING("multipart"),
+        StringBeginsWith(m_type, "multipart"_ns,
                          nsCaseInsensitiveCStringComparator)) {
       encode_p = false;
       if (m_desiredType.LowerCaseEqualsLiteral(TEXT_PLAIN))
         m_desiredType.Truncate();
     }
 
     // If the Mail charset is multibyte, we force it to use Base64 for
     // attachments.
@@ -448,18 +448,17 @@ DONE:
     else
       m_type = TEXT_PLAIN;
   }
   return NS_OK;
 }
 
 nsresult nsMsgAttachmentHandler::PickCharset() {
   if (!m_charset.IsEmpty() ||
-      !StringBeginsWith(m_type, NS_LITERAL_CSTRING("text/"),
-                        nsCaseInsensitiveCStringComparator))
+      !StringBeginsWith(m_type, "text/"_ns, nsCaseInsensitiveCStringComparator))
     return NS_OK;
 
   if (!mTmpFile) return NS_OK;
 
   return MsgDetectCharsetFromFile(mTmpFile, m_charset);
 }
 
 static nsresult FetcherURLDoneCallback(nsresult aStatus,
@@ -643,18 +642,17 @@ nsresult nsMsgAttachmentHandler::SnarfAt
     mTmpFile = nullptr;
     return NS_MSG_UNABLE_TO_OPEN_TMP_FILE;
   }
 
   nsCString sourceURISpec;
   rv = mURL->GetSpec(sourceURISpec);
   NS_ENSURE_SUCCESS(rv, rv);
 #ifdef XP_MACOSX
-  if (!m_bogus_attachment &&
-      StringBeginsWith(sourceURISpec, NS_LITERAL_CSTRING("file://"))) {
+  if (!m_bogus_attachment && StringBeginsWith(sourceURISpec, "file://"_ns)) {
     // Unescape the path (i.e. un-URLify it) before making a FSSpec
     nsAutoCString filePath;
     filePath.Adopt(nsMsgGetLocalFileFromURL(sourceURISpec.get()));
     nsAutoCString unescapedFilePath;
     MsgUnescapeString(filePath, 0, unescapedFilePath);
 
     nsCOMPtr<nsIFile> sourceFile;
     NS_NewNativeLocalFile(unescapedFilePath, true, getter_AddRefs(sourceFile));
--- a/mailnews/compose/src/nsMsgCompFields.cpp
+++ b/mailnews/compose/src/nsMsgCompFields.cpp
@@ -76,18 +76,17 @@ nsMsgCompFields::nsMsgCompFields()
   m_forceMsgEncoding = false;
   m_needToCheckCharset = true;
   m_attachmentReminder = false;
   m_deliveryFormat = nsIMsgCompSendFormat::AskUser;
 
   // Get the default charset from pref, use this as a mail charset.
   nsString charset;
   NS_GetLocalizedUnicharPreferenceWithDefault(
-      nullptr, "mailnews.send_default_charset", NS_LITERAL_STRING("UTF-8"),
-      charset);
+      nullptr, "mailnews.send_default_charset", u"UTF-8"_ns, charset);
 
   LossyCopyUTF16toASCII(charset,
                         m_DefaultCharacterSet);  // Charsets better be ASCII
   SetCharacterSet(m_DefaultCharacterSet.get());
 }
 
 nsMsgCompFields::~nsMsgCompFields() {}
 
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -290,17 +290,17 @@ nsresult mime_generate_headers(nsIMsgCom
     // Ignore error since we're testing the return value.
     mozilla::Unused << pHTTPHandler->GetUserAgent(userAgentString);
 
     if (!userAgentString.IsEmpty())
       finalHeaders->SetUnstructuredHeader(
           "User-Agent", NS_ConvertUTF8toUTF16(userAgentString));
   }
 
-  finalHeaders->SetUnstructuredHeader("MIME-Version", NS_LITERAL_STRING("1.0"));
+  finalHeaders->SetUnstructuredHeader("MIME-Version", u"1.0"_ns);
 
   nsAutoCString newsgroups;
   finalHeaders->GetRawHeader("Newsgroups", newsgroups);
   if (!newsgroups.IsEmpty()) {
     // Since the newsgroup header can contain data in the form of:
     // "news://news.mozilla.org/netscape.test,news://news.mozilla.org/netscape.junk"
     // we need to turn that into: "netscape.test,netscape.junk"
     // (XXX: can it really?)
@@ -503,19 +503,18 @@ char* mime_generate_attachment_headers(
   nsAutoString realName;
   if (real_name) {
     encodedRealName = RFC2231ParmFolding("filename", real_name);
     // somehow RFC2231ParamFolding failed. fall back to legacy method
     if (!encodedRealName || !*encodedRealName) {
       PR_FREEIF(encodedRealName);
       parmFolding = 0;
       // Not RFC 2231 style encoding (it's not standard-compliant)
-      encodedRealName =
-          LegacyParmFolding(NS_LITERAL_CSTRING("UTF-8"),
-                            nsDependentCString(real_name), parmFolding);
+      encodedRealName = LegacyParmFolding(
+          "UTF-8"_ns, nsDependentCString(real_name), parmFolding);
     }
   }
 
   nsCString buf;  // very likely to be longer than 64 characters
   buf.AppendLiteral("Content-Type: ");
   buf.Append(type);
   if (type_param && *type_param) {
     if (*type_param != ';') buf.AppendLiteral("; ");
@@ -601,19 +600,18 @@ char* mime_generate_attachment_headers(
   }
 
 #ifdef EMIT_NAME_IN_CONTENT_TYPE
   if (encodedRealName && *encodedRealName) {
     // Note that we don't need to output the name field if the name encoding is
     // RFC 2231. If the MUA knows the RFC 2231, it should know the RFC 2183 too.
     if (parmFolding != 2) {
       // The underlying JS MIME code will only handle UTF-8 here.
-      char* nameValue =
-          LegacyParmFolding(NS_LITERAL_CSTRING("UTF-8"),
-                            nsDependentCString(real_name), parmFolding);
+      char* nameValue = LegacyParmFolding(
+          "UTF-8"_ns, nsDependentCString(real_name), parmFolding);
       if (!nameValue || !*nameValue) {
         PR_FREEIF(nameValue);
         nameValue = encodedRealName;
       }
       buf.AppendLiteral(";\r\n name=\"");
       buf.Append(nameValue);
       buf.Append('"');
       if (nameValue != encodedRealName) PR_FREEIF(nameValue);
@@ -1177,28 +1175,25 @@ void msg_pick_real_name(nsMsgAttachmentH
     nsresult rv = attachment->mURL->GetSpec(url);
     if (NS_FAILED(rv)) return;
 
     s = url.get();
     s2 = PL_strchr(s, ':');
     if (s2) s = s2 + 1;
     // If we know the URL doesn't have a sensible file name in it,
     // don't bother emitting a content-disposition.
-    if (StringBeginsWith(url, NS_LITERAL_CSTRING("news:"),
-                         nsCaseInsensitiveCStringComparator) ||
-        StringBeginsWith(url, NS_LITERAL_CSTRING("snews:"),
+    if (StringBeginsWith(url, "news:"_ns, nsCaseInsensitiveCStringComparator) ||
+        StringBeginsWith(url, "snews:"_ns,
                          nsCaseInsensitiveCStringComparator) ||
-        StringBeginsWith(url, NS_LITERAL_CSTRING("IMAP:"),
-                         nsCaseInsensitiveCStringComparator) ||
-        StringBeginsWith(url, NS_LITERAL_CSTRING("mailbox:"),
+        StringBeginsWith(url, "IMAP:"_ns, nsCaseInsensitiveCStringComparator) ||
+        StringBeginsWith(url, "mailbox:"_ns,
                          nsCaseInsensitiveCStringComparator))
       return;
 
-    if (StringBeginsWith(url, NS_LITERAL_CSTRING("data:"),
-                         nsCaseInsensitiveCStringComparator)) {
+    if (StringBeginsWith(url, "data:"_ns, nsCaseInsensitiveCStringComparator)) {
       int32_t endNonData = url.FindChar(',');
       if (endNonData == -1) return;
       nsCString nonDataPart(Substring(url, 5, endNonData - 5));
       int32_t filenamePos = nonDataPart.Find("filename=");
       if (filenamePos != -1) {
         filenamePos += 9;
         int32_t endFilename = nonDataPart.FindChar(';', filenamePos);
         if (endFilename == -1) endFilename = endNonData;
@@ -1275,36 +1270,34 @@ void msg_pick_real_name(nsMsgAttachmentH
     // understand which traditionally has an extension, we just special-
     // case it here!
 
     // Note that it's special-cased in a similar way in libmime/mimei.c.
     if (attachment->m_encoding.LowerCaseEqualsLiteral(ENCODING_UUENCODE) ||
         attachment->m_encoding.LowerCaseEqualsLiteral(ENCODING_UUENCODE2) ||
         attachment->m_encoding.LowerCaseEqualsLiteral(ENCODING_UUENCODE3) ||
         attachment->m_encoding.LowerCaseEqualsLiteral(ENCODING_UUENCODE4)) {
-      if (StringEndsWith(attachment->m_realName, NS_LITERAL_CSTRING(".uu")))
+      if (StringEndsWith(attachment->m_realName, ".uu"_ns))
         attachment->m_realName.Cut(attachment->m_realName.Length() - 3, 3);
-      else if (StringEndsWith(attachment->m_realName,
-                              NS_LITERAL_CSTRING(".uue")))
+      else if (StringEndsWith(attachment->m_realName, ".uue"_ns))
         attachment->m_realName.Cut(attachment->m_realName.Length() - 4, 4);
     }
   }
 }
 
 // Utility to create a nsIURI object...
 nsresult nsMsgNewURL(nsIURI** aInstancePtrResult, const nsCString& aSpec) {
   nsresult rv = NS_OK;
   if (nullptr == aInstancePtrResult) return NS_ERROR_NULL_POINTER;
   nsCOMPtr<nsIIOService> pNetService = mozilla::services::GetIOService();
   NS_ENSURE_TRUE(pNetService, NS_ERROR_UNEXPECTED);
-  if (aSpec.Find("://") == kNotFound &&
-      !StringBeginsWith(aSpec, NS_LITERAL_CSTRING("data:"))) {
+  if (aSpec.Find("://") == kNotFound && !StringBeginsWith(aSpec, "data:"_ns)) {
     // XXXjag Temporary fix for bug 139362 until the real problem(bug 70083) get
     // fixed
-    nsAutoCString uri(NS_LITERAL_CSTRING("http://"));
+    nsAutoCString uri("http://"_ns);
     uri.Append(aSpec);
     rv = pNetService->NewURI(uri, nullptr, nullptr, aInstancePtrResult);
   } else
     rv = pNetService->NewURI(aSpec, nullptr, nullptr, aInstancePtrResult);
   return rv;
 }
 
 char* nsMsgGetLocalFileFromURL(const char* url) {
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -468,18 +468,17 @@ nsresult nsMsgCompose::TagEmbeddedObject
     nsCOMPtr<Element> domElement = do_QueryElementAt(aNodeList, i);
     if (!domElement) continue;
     if (IsEmbeddedObjectSafe(originalScheme.get(), originalHost.get(),
                              originalPath.get(), domElement))
       continue;  // Don't need to tag this object, it's safe to send it.
 
     // The source of this object should not be sent with the message.
     IgnoredErrorResult rv2;
-    domElement->SetAttribute(NS_LITERAL_STRING("moz-do-not-send"),
-                             NS_LITERAL_STRING("true"), rv2);
+    domElement->SetAttribute(u"moz-do-not-send"_ns, u"true"_ns, rv2);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgCompose::GetInsertingQuotedContent(bool* aInsertingQuotedText) {
   NS_ENSURE_ARG_POINTER(aInsertingQuotedText);
@@ -497,18 +496,18 @@ MOZ_CAN_RUN_SCRIPT void nsMsgCompose::In
     const nsAString& aText, const nsAString& classStr) {
   NS_ASSERTION(m_editor,
                "InsertDivWrappedTextAtSelection called, but no editor exists");
   if (!m_editor) return;
 
   RefPtr<Element> divElem;
   nsCOMPtr<nsIHTMLEditor> htmlEditor(do_QueryInterface(m_editor));
 
-  nsresult rv = htmlEditor->CreateElementWithDefaults(NS_LITERAL_STRING("div"),
-                                                      getter_AddRefs(divElem));
+  nsresult rv =
+      htmlEditor->CreateElementWithDefaults(u"div"_ns, getter_AddRefs(divElem));
 
   NS_ENSURE_SUCCESS_VOID(rv);
 
   // We need the document
   nsCOMPtr<Document> doc;
   rv = m_editor->GetDocument(getter_AddRefs(doc));
   NS_ENSURE_SUCCESS_VOID(rv);
 
@@ -527,18 +526,18 @@ MOZ_CAN_RUN_SCRIPT void nsMsgCompose::In
     IgnoredErrorResult rv2;
     divElem->AppendChild(*textNode, rv2);
     if (rv2.Failed()) {
       return;
     }
 
     // Now create and insert a BR
     RefPtr<Element> brElem;
-    rv = htmlEditor->CreateElementWithDefaults(NS_LITERAL_STRING("br"),
-                                               getter_AddRefs(brElem));
+    rv =
+        htmlEditor->CreateElementWithDefaults(u"br"_ns, getter_AddRefs(brElem));
     NS_ENSURE_SUCCESS_VOID(rv);
     divElem->AppendChild(*brElem, rv2);
     if (rv2.Failed()) {
       return;
     }
 
     if (delimiter == end) break;
     start = ++delimiter;
@@ -554,17 +553,17 @@ MOZ_CAN_RUN_SCRIPT void nsMsgCompose::In
     RefPtr<Selection> selection;
     m_editor->GetSelection(getter_AddRefs(selection));
 
     if (selection) selection->Collapse(parent, offset + 1);
   }
   if (divElem) {
     RefPtr<Element> divElem2 = divElem;
     IgnoredErrorResult rv2;
-    divElem2->SetAttribute(NS_LITERAL_STRING("class"), classStr, rv2);
+    divElem2->SetAttribute(u"class"_ns, classStr, rv2);
   }
 }
 
 /*
  * The following function replaces <plaintext> tags with <x-plaintext>.
  * <plaintext> is a funny beast: It leads to everything following it
  * being displayed verbatim, even a </plaintext> tag is ignored.
  */
@@ -659,18 +658,17 @@ nsMsgCompose::ConvertAndLoadComposeWindo
             htmlEditor->InsertLineBreak();
           else {
             htmlEditor->InsertLineBreak();
             htmlEditor->InsertLineBreak();
           }
         }
       }
 
-      InsertDivWrappedTextAtSelection(aPrefix,
-                                      NS_LITERAL_STRING("moz-cite-prefix"));
+      InsertDivWrappedTextAtSelection(aPrefix, u"moz-cite-prefix"_ns);
     }
 
     if (!aBuf.IsEmpty()) {
       // This leaves the caret at the right place to insert a bottom signature.
       if (aHTMLEditor) {
         nsAutoString body(aBuf);
         remove_plaintext_tag(body);
         htmlEditor->InsertAsCitedQuotation(body, mCiteReference, true,
@@ -688,18 +686,17 @@ nsMsgCompose::ConvertAndLoadComposeWindo
       // we cannot add it on top earlier, because TagEmbeddedObjects will mark
       // all images in the signature as "moz-do-not-send"
       if (sigOnTop) MoveToBeginningOfDocument();
 
       if (aHTMLEditor)
         htmlEditor->InsertHTML(aSignature);
       else {
         htmlEditor->InsertLineBreak();
-        InsertDivWrappedTextAtSelection(aSignature,
-                                        NS_LITERAL_STRING("moz-signature"));
+        InsertDivWrappedTextAtSelection(aSignature, u"moz-signature"_ns);
       }
 
       if (sigOnTop) htmlEditor->EndOfDocument();
     }
   } else {
     if (aHTMLEditor) {
       mInsertingQuotedContent = true;
       if (isForwarded &&
@@ -751,43 +748,42 @@ nsMsgCompose::ConvertAndLoadComposeWindo
         htmlEditor->InsertHTML(aSignature);
         if (isForwarded && sigOnTop) htmlEditor->EndOfDocument();
       } else
         htmlEditor->EndOfDocument();
     } else {
       bool sigOnTopInserted = false;
       if (isForwarded && sigOnTop && !aSignature.IsEmpty()) {
         htmlEditor->InsertLineBreak();
-        InsertDivWrappedTextAtSelection(aSignature,
-                                        NS_LITERAL_STRING("moz-signature"));
+        InsertDivWrappedTextAtSelection(aSignature, u"moz-signature"_ns);
         htmlEditor->EndOfDocument();
         sigOnTopInserted = true;
       }
 
       if (!aBuf.IsEmpty()) {
         nsresult rv;
         RefPtr<Element> divElem;
         RefPtr<Element> extraBr;
 
         if (isForwarded) {
           // Special treatment for forwarded messages: Part 1.
           // Create a <div> of the required class.
-          rv = htmlEditor->CreateElementWithDefaults(NS_LITERAL_STRING("div"),
+          rv = htmlEditor->CreateElementWithDefaults(u"div"_ns,
                                                      getter_AddRefs(divElem));
           NS_ENSURE_SUCCESS(rv, rv);
 
           nsAutoString attributeName;
           nsAutoString attributeValue;
           attributeName.AssignLiteral("class");
           attributeValue.AssignLiteral("moz-forward-container");
           IgnoredErrorResult rv1;
           divElem->SetAttribute(attributeName, attributeValue, rv1);
 
           // We can't insert an empty <div>, so fill it with something.
-          rv = htmlEditor->CreateElementWithDefaults(NS_LITERAL_STRING("br"),
+          rv = htmlEditor->CreateElementWithDefaults(u"br"_ns,
                                                      getter_AddRefs(extraBr));
           NS_ENSURE_SUCCESS(rv, rv);
 
           ErrorResult rv2;
           divElem->AppendChild(*extraBr, rv2);
           if (rv2.Failed()) {
             return rv2.StealNSResult();
           }
@@ -833,18 +829,17 @@ nsMsgCompose::ConvertAndLoadComposeWindo
         // It's OK to use, even if we're not forwarding and didn't create a
         // <div>.
         rv = MoveToEndOfDocument();
         NS_ENSURE_SUCCESS(rv, rv);
       }
 
       if ((!isForwarded || !sigOnTop) && !aSignature.IsEmpty()) {
         htmlEditor->InsertLineBreak();
-        InsertDivWrappedTextAtSelection(aSignature,
-                                        NS_LITERAL_STRING("moz-signature"));
+        InsertDivWrappedTextAtSelection(aSignature, u"moz-signature"_ns);
       }
     }
   }
 
   if (aBuf.IsEmpty())
     htmlEditor->BeginningOfDocument();
   else {
     switch (reply_on_top) {
@@ -1234,18 +1229,17 @@ NS_IMETHODIMP nsMsgCompose::SendMsg(MSG_
 
   // i'm assuming the compose window is still up at this point...
   if (m_window) {
     nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(m_window);
     window->GetPrompter(getter_AddRefs(prompt));
   }
 
   // Set content type based on which type of compose window we had.
-  nsString contentType = (m_composeHTML) ? NS_LITERAL_STRING("text/html")
-                                         : NS_LITERAL_STRING("text/plain");
+  nsString contentType = (m_composeHTML) ? u"text/html"_ns : u"text/plain"_ns;
   nsString msgBody;
   const char* charset = m_compFields->GetCharacterSet();
   if (m_editor) {
     // Reset message body previously stored in the compose fields
     // There is 2 nsIMsgCompFields::SetBody() functions using a pointer as
     // argument, therefore a casting is required.
     m_compFields->SetBody((const char*)nullptr);
 
@@ -1268,18 +1262,17 @@ NS_IMETHODIMP nsMsgCompose::SendMsg(MSG_
     }
     rv = m_editor->OutputToString(contentType, flags, msgBody);
     NS_ENSURE_SUCCESS(rv, rv);
   } else {
     m_compFields->GetBody(msgBody);
   }
   if (!msgBody.IsEmpty()) {
     // Ensure body ends in CRLF to avoid SMTP server timeout when sent.
-    if (!StringEndsWith(msgBody, NS_LITERAL_STRING("\r\n")))
-      msgBody.AppendLiteral("\r\n");
+    if (!StringEndsWith(msgBody, u"\r\n"_ns)) msgBody.AppendLiteral("\r\n");
     bool isAsciiOnly = mozilla::IsAsciiNullTerminated(
         static_cast<const char16_t*>(msgBody.get()));
     // Convert body to mail charset
     nsCString outCString;
     rv = nsMsgI18NConvertFromUnicode(
         charset ? nsDependentCString(charset) : EmptyCString(), msgBody,
         outCString, true);
     if (m_compFields->GetForceMsgEncoding()) isAsciiOnly = false;
@@ -1378,17 +1371,17 @@ NS_IMETHODIMP nsMsgCompose::SendMsg(MSG_
         // Eudora, which saves off the attachments separately from the message
         // body
         nsCString userid;
         (void)identity->GetEmail(userid);
         int32_t index = userid.FindChar('@');
         if (index != kNotFound) userid.SetLength(index);
 
         if (userid.IsEmpty())
-          attachment->SetName(NS_LITERAL_STRING("vcard.vcf"));
+          attachment->SetName(u"vcard.vcf"_ns);
         else {
           // Replace any dot with underscore to stop vCards
           // generating false positives with some heuristic scanners
           userid.ReplaceChar('.', '_');
           userid.AppendLiteral(".vcf");
           attachment->SetName(NS_ConvertASCIItoUTF16(userid));
         }
 
@@ -1528,26 +1521,25 @@ static nsresult fixCharset(nsCString& aC
 
   // Replace an unrecognized charset with the default.
   if (NS_FAILED(rv)) {
     nsCOMPtr<nsIPrefBranch> prefs(
         do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
     nsString defaultCharset;
     NS_GetLocalizedUnicharPreferenceWithDefault(
-        prefs, "mailnews.send_default_charset", NS_LITERAL_STRING("UTF-8"),
-        defaultCharset);
+        prefs, "mailnews.send_default_charset", u"UTF-8"_ns, defaultCharset);
     LossyCopyUTF16toASCII(defaultCharset, aCharset);
     return NS_OK;
   }
 
   // Don't accept UTF-16 ever. UTF-16 should never be selected as an
   // outgoing encoding for e-mail. MIME can't handle those messages
   // encoded in ASCII-incompatible encodings.
-  if (StringBeginsWith(aCharset, NS_LITERAL_CSTRING("UTF-16"))) {
+  if (StringBeginsWith(aCharset, "UTF-16"_ns)) {
     aCharset.AssignLiteral("UTF-8");
   }
   return NS_OK;
 }
 
 // This used to be called BEFORE editor was created
 //  (it did the loadURI that triggered editor creation)
 // It is called from JS after editor creation
@@ -1657,17 +1649,17 @@ nsresult nsMsgCompose::CreateMessage(con
                                      MSG_ComposeType type,
                                      nsIMsgCompFields* compFields) {
   nsresult rv = NS_OK;
   mType = type;
   mDraftDisposition = nsIMsgFolder::nsMsgDispositionState_None;
 
   mDeleteDraft = (type == nsIMsgCompType::Draft);
   nsAutoCString msgUri(originalMsgURI);
-  bool fileUrl = StringBeginsWith(msgUri, NS_LITERAL_CSTRING("file:"));
+  bool fileUrl = StringBeginsWith(msgUri, "file:"_ns);
   int32_t typeIndex = msgUri.Find("type=application/x-message-display");
   if (typeIndex != kNotFound && typeIndex > 0) {
     // Strip out type=application/x-message-display because it confuses libmime.
     msgUri.Cut(typeIndex, sizeof("type=application/x-message-display"));
     if (fileUrl)  // we're dealing with an .eml file msg
     {
       // We have now removed the type from the uri. Make sure we don't have
       // an uri with "&&" now. If we do, remove the second '&'.
@@ -1918,17 +1910,17 @@ nsresult nsMsgCompose::CreateMessage(con
       if (isFirstPass && !charset.IsEmpty())
         m_compFields->SetCharacterSet(charset.get());
 
       nsString subject;
       rv = msgHdr->GetMime2DecodedSubject(subject);
       if (NS_FAILED(rv)) return rv;
 
       // Check if (was: is present in the subject
-      int32_t wasOffset = subject.RFind(NS_LITERAL_STRING(" (was:"));
+      int32_t wasOffset = subject.RFind(u" (was:"_ns);
       bool strip = true;
 
       if (wasOffset >= 0) {
         // Check the number of references, to check if was: should be stripped
         // First, assume that it should be stripped; the variable will be set to
         // false later if stripping should not happen.
         uint16_t numRef;
         msgHdr->GetNumReferences(&numRef);
@@ -3006,19 +2998,19 @@ nsresult nsMsgCompose::QuoteOriginalMess
 
   nsCOMPtr<nsIMsgDBHdr> originalMsgHdr = mOrigMsgHdr;
   if (!originalMsgHdr) {
     rv = GetMsgDBHdrFromURI(mOriginalMsgURI.get(),
                             getter_AddRefs(originalMsgHdr));
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  bool fileUrl = StringBeginsWith(mOriginalMsgURI, NS_LITERAL_CSTRING("file:"));
+  bool fileUrl = StringBeginsWith(mOriginalMsgURI, "file:"_ns);
   if (fileUrl) {
-    mOriginalMsgURI.Replace(0, 5, NS_LITERAL_CSTRING("mailbox:"));
+    mOriginalMsgURI.Replace(0, 5, "mailbox:"_ns);
     mOriginalMsgURI.AppendLiteral("?number=0");
   }
 
   // Create the consumer output stream.. this will receive all the HTML from
   // libmime
   mQuoteStreamListener = new QuotingOutputStreamListener(
       mOriginalMsgURI.get(), originalMsgHdr, mWhatHolder != 1,
       !bAutoQuote || !mHtmlToQuote.IsEmpty(), m_identity, mQuote,
@@ -4068,18 +4060,17 @@ nsresult nsMsgCompose::ProcessSignature(
             // type is for this signature...if we can't, we assume text
             nsAutoCString sigContentType;
             nsresult rv2;  // don't want to clobber the other rv
             nsCOMPtr<nsIMIMEService> mimeFinder(
                 do_GetService(NS_MIMESERVICE_CONTRACTID, &rv2));
             if (NS_SUCCEEDED(rv2)) {
               rv2 = mimeFinder->GetTypeFromFile(sigFile, sigContentType);
               if (NS_SUCCEEDED(rv2)) {
-                if (StringBeginsWith(sigContentType,
-                                     NS_LITERAL_CSTRING("image/"),
+                if (StringBeginsWith(sigContentType, "image/"_ns,
                                      nsCaseInsensitiveCStringComparator))
                   imageSig = true;
                 else if (sigContentType.Equals(
                              TEXT_HTML, nsCaseInsensitiveCStringComparator))
                   htmlSig = true;
               }
             }
           }
@@ -4293,17 +4284,17 @@ nsresult nsMsgCompose::BuildBodyMessageA
   nsAutoString tSignature;
   if (addSignature) ProcessSignature(m_identity, isQuoted, &tSignature);
 
   // if type is new, but we have body, this is probably a mapi send, so we need
   // to replace '\n' with <br> so that the line breaks won't be lost by html. if
   // mailtourl, do the same.
   if (m_composeHTML &&
       (mType == nsIMsgCompType::New || mType == nsIMsgCompType::MailToUrl))
-    body.ReplaceSubstring(NS_LITERAL_STRING("\n"), NS_LITERAL_STRING("<br>"));
+    body.ReplaceSubstring(u"\n"_ns, u"<br>"_ns);
 
   // Restore flowed text wrapping for Drafts/Templates.
   // Look for unquoted lines - if we have an unquoted line
   // that ends in a space, join this line with the next one
   // by removing the end of line char(s).
   int32_t wrapping_enabled = 0;
   GetWrapLength(&wrapping_enabled);
   if (!m_composeHTML && wrapping_enabled) {
@@ -4311,23 +4302,23 @@ nsresult nsMsgCompose::BuildBodyMessageA
     for (uint32_t i = 0; i < body.Length(); i++) {
       if (i == 0 || body[i - 1] == '\n')  // newline
       {
         if (body[i] == '>') {
           quote = true;
           continue;
         }
         nsString s(Substring(body, i, 10));
-        if (StringBeginsWith(s, NS_LITERAL_STRING("-- \r")) ||
-            StringBeginsWith(s, NS_LITERAL_STRING("-- \n"))) {
+        if (StringBeginsWith(s, u"-- \r"_ns) ||
+            StringBeginsWith(s, u"-- \n"_ns)) {
           i += 4;
           continue;
         }
-        if (StringBeginsWith(s, NS_LITERAL_STRING("- -- \r")) ||
-            StringBeginsWith(s, NS_LITERAL_STRING("- -- \n"))) {
+        if (StringBeginsWith(s, u"- -- \r"_ns) ||
+            StringBeginsWith(s, u"- -- \n"_ns)) {
           i += 6;
           continue;
         }
       }
       if (body[i] == '\n' && i > 1) {
         if (quote) {
           quote = false;
           continue;  // skip quoted lines
@@ -4993,59 +4984,59 @@ void nsMsgCompose::TagConvertible(Elemen
   *_retval = nsIMsgCompConvertible::No;
 
   nsAutoString element;
   element = node->NodeName();
 
   // A style attribute on any element can change layout in any way,
   // so that is not convertible.
   nsAutoString attribValue;
-  node->GetAttribute(NS_LITERAL_STRING("style"), attribValue);
+  node->GetAttribute(u"style"_ns, attribValue);
   if (!attribValue.IsEmpty()) {
     *_retval = nsIMsgCompConvertible::No;
     return;
   }
 
   // moz-* classes are used internally by the editor and mail composition
   // (like moz-cite-prefix or moz-signature). Those can be discarded.
   // But any other ones are unconvertible. Style can be attached to them or any
   // other context (e.g. in microformats).
-  node->GetAttribute(NS_LITERAL_STRING("class"), attribValue);
+  node->GetAttribute(u"class"_ns, attribValue);
   if (!attribValue.IsEmpty()) {
-    if (StringBeginsWith(attribValue, NS_LITERAL_STRING("moz-"),
+    if (StringBeginsWith(attribValue, u"moz-"_ns,
                          nsCaseInsensitiveStringComparator)) {
       // We assume that anything with a moz-* class is convertible regardless of
       // the tag, because we add, for example, class="moz-signature" to HTML
       // messages and we still want to be able to downgrade them.
       *_retval = nsIMsgCompConvertible::Plain;
     } else {
       *_retval = nsIMsgCompConvertible::No;
     }
 
     return;
   }
 
   // ID attributes can contain attached style/context or be target of links
   // so we should preserve them.
-  node->GetAttribute(NS_LITERAL_STRING("id"), attribValue);
+  node->GetAttribute(u"id"_ns, attribValue);
   if (!attribValue.IsEmpty()) {
     *_retval = nsIMsgCompConvertible::No;
     return;
   }
 
   // Alignment is not convertible to plaintext; editor currently uses this.
-  node->GetAttribute(NS_LITERAL_STRING("align"), attribValue);
+  node->GetAttribute(u"align"_ns, attribValue);
   if (!attribValue.IsEmpty()) {
     *_retval = nsIMsgCompConvertible::No;
     return;
   }
 
   // Title attribute is not convertible to plaintext;
   // this also preserves any links with titles.
-  node->GetAttribute(NS_LITERAL_STRING("title"), attribValue);
+  node->GetAttribute(u"title"_ns, attribValue);
   if (!attribValue.IsEmpty()) {
     *_retval = nsIMsgCompConvertible::No;
     return;
   }
 
   if (  // Considered convertible to plaintext: Some "simple" elements
         // without non-convertible attributes like style, class, id,
         // or align (see above).
@@ -5081,59 +5072,58 @@ void nsMsgCompose::TagConvertible(Elemen
                            element.LowerCaseEqualsLiteral("code") ||
                            element.LowerCaseEqualsLiteral("b") ||
                            element.LowerCaseEqualsLiteral("i") ||
                            element.LowerCaseEqualsLiteral("u")))) {
     *_retval = nsIMsgCompConvertible::Altering;
   } else if (element.LowerCaseEqualsLiteral("body")) {
     *_retval = nsIMsgCompConvertible::Plain;
 
-    if (node->HasAttribute(
-            NS_LITERAL_STRING("background")) ||  // There is a background image
-        node->HasAttribute(NS_LITERAL_STRING(
-            "dir"))) {  // dir=rtl attributes should not downconvert
+    if (node->HasAttribute(u"background"_ns) ||  // There is a background image
+        node->HasAttribute(
+            u"dir"_ns)) {  // dir=rtl attributes should not downconvert
       *_retval = nsIMsgCompConvertible::No;
     } else {
       nsAutoString color;
-      if (node->HasAttribute(NS_LITERAL_STRING("text"))) {
-        node->GetAttribute(NS_LITERAL_STRING("text"), color);
+      if (node->HasAttribute(u"text"_ns)) {
+        node->GetAttribute(u"text"_ns, color);
         if (!color.EqualsLiteral("#000000"))
           *_retval = nsIMsgCompConvertible::Altering;
       }
       if (*_retval != nsIMsgCompConvertible::Altering &&  // small optimization
-          node->HasAttribute(NS_LITERAL_STRING("bgcolor"))) {
-        node->GetAttribute(NS_LITERAL_STRING("bgcolor"), color);
+          node->HasAttribute(u"bgcolor"_ns)) {
+        node->GetAttribute(u"bgcolor"_ns, color);
         if (!color.LowerCaseEqualsLiteral("#ffffff"))
           *_retval = nsIMsgCompConvertible::Altering;
       }
     }
 
     // ignore special color setting for link, vlink and alink at this point.
   } else if (element.LowerCaseEqualsLiteral("blockquote")) {
     // Skip <blockquote type="cite">
     *_retval = nsIMsgCompConvertible::Yes;
 
-    node->GetAttribute(NS_LITERAL_STRING("type"), attribValue);
+    node->GetAttribute(u"type"_ns, attribValue);
     if (attribValue.LowerCaseEqualsLiteral("cite")) {
       *_retval = nsIMsgCompConvertible::Plain;
     }
   } else if (element.LowerCaseEqualsLiteral("div") ||
              element.LowerCaseEqualsLiteral("span") ||
              element.LowerCaseEqualsLiteral("a")) {
     // Do some special checks for these tags. They are inside this |else if|
     // for performance reasons.
 
     // Maybe, it's an <a> element inserted by another recognizer (e.g. 4.x')
     if (element.LowerCaseEqualsLiteral("a")) {
       // Ignore anchor tag, if the URI is the same as the text
       // (as inserted by recognizers).
       *_retval = nsIMsgCompConvertible::Altering;
 
       nsAutoString hrefValue;
-      node->GetAttribute(NS_LITERAL_STRING("href"), hrefValue);
+      node->GetAttribute(u"href"_ns, hrefValue);
       nsINodeList* children = node->ChildNodes();
       if (children->Length() > 0) {
         nsINode* pItem = children->Item(0);
         nsAutoString textValue;
         pItem->GetNodeValue(textValue);
         if (textValue == hrefValue) *_retval = nsIMsgCompConvertible::Plain;
       }
     }
@@ -5422,18 +5412,17 @@ nsMsgCompose::SetIdentity(nsIMsgIdentity
       rv = MoveToEndOfDocument();
     }
 
     if (NS_SUCCEEDED(rv)) {
       if (m_composeHTML) {
         rv = MOZ_KnownLive(editor->AsHTMLEditor())->InsertHTML(aSignature);
       } else {
         rv = editor->InsertLineBreak();
-        InsertDivWrappedTextAtSelection(aSignature,
-                                        NS_LITERAL_STRING("moz-signature"));
+        InsertDivWrappedTextAtSelection(aSignature, u"moz-signature"_ns);
       }
     }
     editor->EndTransaction();
   }
 
   return rv;
 }
 
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -246,18 +246,18 @@ nsMsgComposeService::GetOrigWindowSelect
 
   // Now delve down in to the message to get the HTML representation of the
   // selection
   nsCOMPtr<nsIDocShell> rootShell;
   rv = aMsgWindow->GetRootDocShell(getter_AddRefs(rootShell));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIDocShell> messagePaneDocShell;
-  RefPtr<mozilla::dom::Element> el = rootShell->GetDocument()->GetElementById(
-      NS_LITERAL_STRING("messagepane"));
+  RefPtr<mozilla::dom::Element> el =
+      rootShell->GetDocument()->GetElementById(u"messagepane"_ns);
   RefPtr<mozilla::dom::XULFrameElement> frame =
       mozilla::dom::XULFrameElement::FromNodeOrNull(el);
   NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
   RefPtr<mozilla::dom::Document> doc = frame->GetContentDocument();
   NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
   messagePaneDocShell = doc->GetDocShell();
   NS_ENSURE_TRUE(messagePaneDocShell, NS_ERROR_FAILURE);
 
@@ -313,17 +313,17 @@ nsMsgComposeService::GetOrigWindowSelect
   nsCOMPtr<nsIContentViewer> contentViewer;
   rv = messagePaneDocShell->GetContentViewer(getter_AddRefs(contentViewer));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<mozilla::dom::Document> domDocument(contentViewer->GetDocument());
 
   nsCOMPtr<nsIDocumentEncoder> docEncoder = do_createHTMLCopyEncoder();
 
-  rv = docEncoder->Init(domDocument, NS_LITERAL_STRING("text/html"), 0);
+  rv = docEncoder->Init(domDocument, u"text/html"_ns, 0);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = docEncoder->SetSelection(sel);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoString selHTML;
   rv = docEncoder->EncodeToString(selHTML);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -691,27 +691,26 @@ NS_IMETHODIMP nsMsgTemplateReplyHelper::
   if (replyTo.IsEmpty()) mHdrToReplyTo->GetAuthor(getter_Copies(replyTo));
   compFields->SetTo(NS_ConvertUTF8toUTF16(replyTo));
 
   nsString body;
   nsString templateSubject, replySubject;
 
   mHdrToReplyTo->GetMime2DecodedSubject(replySubject);
   mTemplateHdr->GetMime2DecodedSubject(templateSubject);
-  nsString subject(NS_LITERAL_STRING("Auto: "));  // RFC 3834 3.1.5.
+  nsString subject(u"Auto: "_ns);  // RFC 3834 3.1.5.
   subject.Append(templateSubject);
   if (!replySubject.IsEmpty()) {
     subject.AppendLiteral(u" (was: ");
     subject.Append(replySubject);
     subject.Append(u')');
   }
 
   compFields->SetSubject(subject);
-  compFields->SetRawHeader("Auto-Submitted", NS_LITERAL_CSTRING("auto-replied"),
-                           nullptr);
+  compFields->SetRawHeader("Auto-Submitted", "auto-replied"_ns, nullptr);
 
   nsCString charset;
   rv = mTemplateHdr->GetCharset(getter_Copies(charset));
   NS_ENSURE_SUCCESS(rv, rv);
   compFields->SetCharacterSet(charset.get());
   rv = nsMsgI18NConvertToUnicode(charset, mTemplateBody, body);
   NS_WARNING_ASSERTION(NS_SUCCEEDED(rv),
                        "couldn't convert templ body to unicode");
@@ -1241,21 +1240,21 @@ nsresult nsMsgComposeService::RunMessage
     mimeConverter->SetForwardToAddress(aForwardTo);
   }
   mimeConverter->SetOverrideComposeFormat(aOverrideComposeFormat);
   mimeConverter->SetIdentity(aIdentity);
   mimeConverter->SetOriginalMsgURI(aOriginalMsgURI);
   mimeConverter->SetOrigMsgHdr(aOrigMsgHdr);
 
   nsCOMPtr<nsIURI> url;
-  bool fileUrl = StringBeginsWith(aMsgURI, NS_LITERAL_CSTRING("file:"));
+  bool fileUrl = StringBeginsWith(aMsgURI, "file:"_ns);
   nsCString mailboxUri(aMsgURI);
   if (fileUrl) {
     // We loaded a .eml file from a file: url. Construct equivalent mailbox url.
-    mailboxUri.Replace(0, 5, NS_LITERAL_CSTRING("mailbox:"));
+    mailboxUri.Replace(0, 5, "mailbox:"_ns);
     mailboxUri.AppendLiteral("&number=0");
     // Need this to prevent nsMsgCompose::TagEmbeddedObjects from setting
     // inline images as moz-do-not-send.
     mimeConverter->SetOriginalMsgURI(mailboxUri.get());
   }
   if (fileUrl || PromiseFlatCString(aMsgURI).Find(
                      "&type=application/x-message-display") >= 0)
     rv = NS_NewURI(getter_AddRefs(url), mailboxUri);
@@ -1320,51 +1319,51 @@ NS_IMETHODIMP
 nsMsgComposeService::Handle(nsICommandLine* aCmdLine) {
   NS_ENSURE_ARG_POINTER(aCmdLine);
 
   nsresult rv;
   int32_t found, end, count;
   nsAutoString uristr;
   bool composeShouldHandle = true;
 
-  rv = aCmdLine->FindFlag(NS_LITERAL_STRING("compose"), false, &found);
+  rv = aCmdLine->FindFlag(u"compose"_ns, false, &found);
   NS_ENSURE_SUCCESS(rv, rv);
 
 #ifndef MOZ_SUITE
   // MAC OS X passes in -url mailto:mscott@mozilla.org into the command line
   // instead of -compose.
   if (found == -1) {
-    rv = aCmdLine->FindFlag(NS_LITERAL_STRING("url"), false, &found);
+    rv = aCmdLine->FindFlag(u"url"_ns, false, &found);
     // we don't want to consume the argument for -url unless we're sure it is a
     // mailto url and we'll figure that out shortly.
     composeShouldHandle = false;
   }
 #endif
 
   if (found == -1) return NS_OK;
 
   end = found;
 
   rv = aCmdLine->GetLength(&count);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (count > found + 1) {
     aCmdLine->GetArgument(found + 1, uristr);
-    if (StringBeginsWith(uristr, NS_LITERAL_STRING("mailto:")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("preselectid=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("to=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("cc=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("bcc=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("newsgroups=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("subject=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("format=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("body=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("attachment=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("message=")) ||
-        StringBeginsWith(uristr, NS_LITERAL_STRING("from="))) {
+    if (StringBeginsWith(uristr, u"mailto:"_ns) ||
+        StringBeginsWith(uristr, u"preselectid="_ns) ||
+        StringBeginsWith(uristr, u"to="_ns) ||
+        StringBeginsWith(uristr, u"cc="_ns) ||
+        StringBeginsWith(uristr, u"bcc="_ns) ||
+        StringBeginsWith(uristr, u"newsgroups="_ns) ||
+        StringBeginsWith(uristr, u"subject="_ns) ||
+        StringBeginsWith(uristr, u"format="_ns) ||
+        StringBeginsWith(uristr, u"body="_ns) ||
+        StringBeginsWith(uristr, u"attachment="_ns) ||
+        StringBeginsWith(uristr, u"message="_ns) ||
+        StringBeginsWith(uristr, u"from="_ns)) {
       composeShouldHandle = true;  // the -url argument looks like mailto
       end++;
       // mailto: URIs are frequently passed with spaces in them. They should be
       // escaped with %20, but we hack around broken clients. See bug 231032.
       while (end + 1 < count) {
         nsAutoString curarg;
         aCmdLine->GetArgument(end + 1, curarg);
         if (curarg.First() == '-') break;
--- a/mailnews/compose/src/nsMsgQuote.cpp
+++ b/mailnews/compose/src/nsMsgQuote.cpp
@@ -95,17 +95,17 @@ nsresult nsMsgQuote::QuoteMessage(
   mStreamListener = aQuoteMsgStreamListener;
 
   nsAutoCString msgUri(msgURI);
   bool fileUrl = !strncmp(msgURI, "file:", 5);
   bool forwardedMessage =
       PL_strstr(msgURI, "&realtype=message/rfc822") != nullptr;
   nsCOMPtr<nsIURI> newURI;
   if (fileUrl) {
-    msgUri.Replace(0, 5, NS_LITERAL_CSTRING("mailbox:"));
+    msgUri.Replace(0, 5, "mailbox:"_ns);
     msgUri.AppendLiteral("?number=0");
     rv = NS_NewURI(getter_AddRefs(newURI), msgUri);
     nsCOMPtr<nsIMsgMessageUrl> mailUrl(do_QueryInterface(newURI));
     if (mailUrl) mailUrl->SetMessageHeader(aMsgHdr);
   } else if (forwardedMessage)
     rv = NS_NewURI(getter_AddRefs(newURI), msgURI);
   else {
     nsCOMPtr<nsIMsgMessageService> msgService;
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -1542,18 +1542,17 @@ nsresult nsMsgComposeAndSend::ProcessMul
                  (NS_SUCCEEDED(uri->SchemeIs("snews", &match)) && match))
           (*aNewsCount)++;
         else {
           // Additional account types need a mechanism to report that they are
           // message protocols. If there is an nsIMsgProtocolInfo component
           // registered for this scheme, we'll consider it a mailbox
           // attachment.
           nsAutoCString contractID;
-          contractID.Assign(
-              NS_LITERAL_CSTRING("@mozilla.org/messenger/protocol/info;1"));
+          contractID.Assign("@mozilla.org/messenger/protocol/info;1"_ns);
           nsAutoCString scheme;
           uri->GetScheme(scheme);
           contractID.Append(scheme);
           nsCOMPtr<nsIMsgProtocolInfo> msgProtocolInfo =
               do_CreateInstance(contractID.get());
           if (msgProtocolInfo) (*aMailboxCount)++;
         }
       }
@@ -1565,17 +1564,17 @@ nsresult nsMsgComposeAndSend::ProcessMul
     //
     // Ok, while we are here, we should whack the DOM with the generated
     // Content-ID for this object. This will be necessary for generating
     // the HTML we need.
     //
     if (domSaveArray[j].element &&
         !m_attachments[duplicateOf == -1 ? i : duplicateOf]
              ->m_contentId.IsEmpty()) {
-      nsString newSpec(NS_LITERAL_STRING("cid:"));
+      nsString newSpec(u"cid:"_ns);
       newSpec.AppendASCII(m_attachments[duplicateOf == -1 ? i : duplicateOf]
                               ->m_contentId.get());
 
       // We know the types of objects this element can be, let's see what we
       // come up with.
       RefPtr<HTMLImageElement> image =
           HTMLImageElement::FromNode(domSaveArray[j].element);
       RefPtr<HTMLAnchorElement> anchor =
@@ -1924,18 +1923,17 @@ nsresult nsMsgComposeAndSend::AddCompFie
           nsCOMPtr<nsIURI> nsiuri;
           rv = NS_MutateURI(NS_STANDARDURLMUTATOR_CONTRACTID)
                    .SetSpec(url)
                    .Finalize(nsiuri);
           NS_ENSURE_SUCCESS(rv, rv);
 
           nsAutoCString scheme;
           nsiuri->GetScheme(scheme);
-          bool isAMessageAttachment =
-              StringEndsWith(scheme, NS_LITERAL_CSTRING("-message"));
+          bool isAMessageAttachment = StringEndsWith(scheme, "-message"_ns);
 
           m_attachments[newLoc]->mDeleteFile = true;
           m_attachments[newLoc]->m_done = false;
           m_attachments[newLoc]->SetMimeDeliveryState(this);
 
           if (!isAMessageAttachment)
             nsMsgNewURL(getter_AddRefs(m_attachments[newLoc]->mURL), url);
 
@@ -2160,18 +2158,17 @@ nsresult nsMsgComposeAndSend::HackAttach
                  (NS_SUCCEEDED(uri->SchemeIs("snews", &match)) && match))
           news_count++;
         else {
           // Additional account types need a mechanism to report that they are
           // message protocols. If there is an nsIMsgProtocolInfo component
           // registered for this scheme, we'll consider it a mailbox
           // attachment.
           nsAutoCString contractID;
-          contractID.Assign(
-              NS_LITERAL_CSTRING("@mozilla.org/messenger/protocol/info;1"));
+          contractID.Assign("@mozilla.org/messenger/protocol/info;1"_ns);
           nsAutoCString scheme;
           uri->GetScheme(scheme);
           contractID.Append(scheme);
           nsCOMPtr<nsIMsgProtocolInfo> msgProtocolInfo =
               do_CreateInstance(contractID.get());
           if (msgProtocolInfo) mailbox_count++;
         }
         if (uri)
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -1388,11 +1388,11 @@ nsMsgSendLater::DoShutdownTask(nsIUrlLis
 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsMsgSendLater::GetCurrentTaskName(nsAString& aResult) {
   // XXX Bug 440794 will localize this, left as non-localized whilst we decide
   // on the actual strings and try out the UI.
-  aResult = NS_LITERAL_STRING("Sending Messages");
+  aResult = u"Sending Messages"_ns;
   return NS_OK;
 }
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -119,17 +119,17 @@ nsresult nsExplainErrorDetails(nsISmtpUr
         // message string smtpPermSizeExceeded1 contains a %d.
         // (The special case can be removed if that string ever changes, then
         // %d should be changed to %S.)
         nsTextFormatter::ssprintf(msg, eMsg.get(), atoi(arg1), (void*)nullptr);
       } else {
         // Some error strings contain %s. We're supplying 16-bit strings,
         // so replace those with %S. It's a bit hacky. but it saves
         // us tweaking some pretty old message strings.
-        eMsg.ReplaceSubstring(NS_LITERAL_STRING("%s"), NS_LITERAL_STRING("%S"));
+        eMsg.ReplaceSubstring(u"%s"_ns, u"%S"_ns);
         nsTextFormatter::ssprintf(
             msg, eMsg.get(), NS_ConvertUTF8toUTF16(arg1).get(),
             arg2 ? NS_ConvertUTF8toUTF16(arg2).get() : nullptr);
       }
       break;
     default:
       NS_WARNING("falling to default error code");
       bundle->GetStringFromName("communicationsError", eMsg);
@@ -859,57 +859,57 @@ nsresult nsSmtpProtocol::SendEhloRespons
     if (responseLine.LowerCaseEqualsLiteral("starttls")) {
       SetFlag(SMTP_EHLO_STARTTLS_ENABLED);
     } else if (responseLine.LowerCaseEqualsLiteral("dsn")) {
       SetFlag(SMTP_EHLO_DSN_ENABLED);
     } else if (responseLine.LowerCaseEqualsLiteral("clientid")) {
       SetFlag(SMTP_EHLO_CLIENTID_ENABLED);
       // If we have "clientid" in the ehlo response, then TLS must be present.
       if (m_prefSocketType == nsMsgSocketType::SSL) m_tlsEnabled = true;
-    } else if (StringBeginsWith(responseLine, NS_LITERAL_CSTRING("AUTH"),
+    } else if (StringBeginsWith(responseLine, "AUTH"_ns,
                                 nsCaseInsensitiveCStringComparator)) {
       SetFlag(SMTP_AUTH);
 
-      if (responseLine.Find(NS_LITERAL_CSTRING("GSSAPI"),
+      if (responseLine.Find("GSSAPI"_ns,
                             /* ignoreCase = */ true) >= 0)
         SetFlag(SMTP_AUTH_GSSAPI_ENABLED);
 
-      if (responseLine.Find(NS_LITERAL_CSTRING("CRAM-MD5"),
+      if (responseLine.Find("CRAM-MD5"_ns,
                             /* ignoreCase = */ true) >= 0)
         SetFlag(SMTP_AUTH_CRAM_MD5_ENABLED);
 
-      if (responseLine.Find(NS_LITERAL_CSTRING("NTLM"),
+      if (responseLine.Find("NTLM"_ns,
                             /* ignoreCase = */ true) >= 0)
         SetFlag(SMTP_AUTH_NTLM_ENABLED);
 
-      if (responseLine.Find(NS_LITERAL_CSTRING("MSN"),
+      if (responseLine.Find("MSN"_ns,
                             /* ignoreCase = */ true) >= 0)
         SetFlag(SMTP_AUTH_MSN_ENABLED);
 
-      if (responseLine.Find(NS_LITERAL_CSTRING("PLAIN"),
+      if (responseLine.Find("PLAIN"_ns,
                             /* ignoreCase = */ true) >= 0)
         SetFlag(SMTP_AUTH_PLAIN_ENABLED);
 
-      if (responseLine.Find(NS_LITERAL_CSTRING("LOGIN"),
+      if (responseLine.Find("LOGIN"_ns,
                             /* ignoreCase = */ true) >= 0)
         SetFlag(SMTP_AUTH_LOGIN_ENABLED);
 
-      if (responseLine.Find(NS_LITERAL_CSTRING("EXTERNAL"),
+      if (responseLine.Find("EXTERNAL"_ns,
                             /* ignoreCase = */ true) >= 0)
         SetFlag(SMTP_AUTH_EXTERNAL_ENABLED);
 
-      if (responseLine.Find(NS_LITERAL_CSTRING("XOAUTH2"),
+      if (responseLine.Find("XOAUTH2"_ns,
                             /* ignoreCase = */ true) >= 0)
         SetFlag(SMTP_AUTH_OAUTH2_ENABLED);
-    } else if (StringBeginsWith(responseLine, NS_LITERAL_CSTRING("SIZE"),
+    } else if (StringBeginsWith(responseLine, "SIZE"_ns,
                                 nsCaseInsensitiveCStringComparator)) {
       SetFlag(SMTP_EHLO_SIZE_ENABLED);
 
       m_sizelimit = atol((responseLine.get()) + 4);
-    } else if (StringBeginsWith(responseLine, NS_LITERAL_CSTRING("8BITMIME"),
+    } else if (StringBeginsWith(responseLine, "8BITMIME"_ns,
                                 nsCaseInsensitiveCStringComparator)) {
       SetFlag(SMTP_EHLO_8BIT_ENABLED);
     }
 
     startPos = endPos + 1;
   } while (endPos >= 0);
 
   if (TestFlag(SMTP_EHLO_SIZE_ENABLED) && m_sizelimit > 0 &&
--- a/mailnews/compose/src/nsSmtpServer.cpp
+++ b/mailnews/compose/src/nsSmtpServer.cpp
@@ -592,17 +592,17 @@ nsSmtpServer::ForgetPassword() {
 
 NS_IMETHODIMP
 nsSmtpServer::GetServerURI(nsACString& aResult) {
   aResult = GetServerURIInternal(true);
   return NS_OK;
 }
 
 nsCString nsSmtpServer::GetServerURIInternal(const bool aIncludeUsername) {
-  nsCString uri(NS_LITERAL_CSTRING("smtp://"));
+  nsCString uri("smtp://"_ns);
   nsresult rv;
 
   if (aIncludeUsername) {
     nsCString username;
     rv = GetUsername(username);
 
     if (NS_SUCCEEDED(rv) && !username.IsEmpty()) {
       nsCString escapedUsername;
--- a/mailnews/compose/src/nsSmtpService.cpp
+++ b/mailnews/compose/src/nsSmtpService.cpp
@@ -318,30 +318,30 @@ NS_IMETHODIMP nsSmtpService::NewChannel(
 
   // These always succeed because the pipe is initialized above.
   MOZ_ALWAYS_SUCCEEDS(pipe->GetInputStream(getter_AddRefs(pipeIn)));
   MOZ_ALWAYS_SUCCEEDS(pipe->GetOutputStream(getter_AddRefs(pipeOut)));
 
   pipeOut->Close();
 
   if (aLoadInfo) {
-    return NS_NewInputStreamChannelInternal(
-        _retval, aURI, pipeIn.forget(),
-        NS_LITERAL_CSTRING("application/x-mailto"), EmptyCString(), aLoadInfo);
+    return NS_NewInputStreamChannelInternal(_retval, aURI, pipeIn.forget(),
+                                            "application/x-mailto"_ns,
+                                            EmptyCString(), aLoadInfo);
   }
 
   nsCOMPtr<nsIPrincipal> nullPrincipal =
       do_CreateInstance("@mozilla.org/nullprincipal;1", &rv);
   NS_ASSERTION(NS_SUCCEEDED(rv), "CreateInstance of nullprincipal failed.");
   if (NS_FAILED(rv)) return rv;
 
   return NS_NewInputStreamChannel(
       _retval, aURI, pipeIn.forget(), nullPrincipal,
       nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
-      nsIContentPolicy::TYPE_OTHER, NS_LITERAL_CSTRING("application/x-mailto"));
+      nsIContentPolicy::TYPE_OTHER, "application/x-mailto"_ns);
 }
 
 NS_IMETHODIMP
 nsSmtpService::GetServers(nsISimpleEnumerator** aResult) {
   NS_ENSURE_ARG_POINTER(aResult);
 
   // now read in the servers from prefs if necessary
   uint32_t serverCount = mSmtpServers.Count();
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -920,21 +920,20 @@ class MsgDBReporter final : public nsIMe
 
   NS_IMETHOD CollectReports(nsIHandleReportCallback* aCb, nsISupports* aClosure,
                             bool aAnonymize) override {
     nsCString path;
     GetPath(path, aAnonymize);
     nsCOMPtr<nsIMsgDatabase> database = do_QueryReferent(mDatabase);
     nsMsgDatabase* db =
         database ? static_cast<nsMsgDatabase*>(database.get()) : nullptr;
-    return aCb->Callback(
-        EmptyCString(), path, nsIMemoryReporter::KIND_HEAP,
-        nsIMemoryReporter::UNITS_BYTES,
-        db ? db->SizeOfIncludingThis(GetMallocSize) : 0,
-        NS_LITERAL_CSTRING("Memory used for the folder database."), aClosure);
+    return aCb->Callback(EmptyCString(), path, nsIMemoryReporter::KIND_HEAP,
+                         nsIMemoryReporter::UNITS_BYTES,
+                         db ? db->SizeOfIncludingThis(GetMallocSize) : 0,
+                         "Memory used for the folder database."_ns, aClosure);
   }
 
   void GetPath(nsACString& memoryPath, bool aAnonymize) {
     memoryPath.AssignLiteral("explicit/maildb/database(");
     nsCOMPtr<nsIMsgDatabase> database = do_QueryReferent(mDatabase);
     nsCOMPtr<nsIMsgFolder> folder;
     if (database) database->GetFolder(getter_AddRefs(folder));
     if (folder) {
--- a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
+++ b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
@@ -56,17 +56,17 @@ static mozilla::LazyLogModule BayesianFi
 static const char* kBayesianFilterTokenDelimiters = " \t\n\r\f.";
 static unsigned int kMinLengthForToken =
     3;  // lower bound on the number of characters in a word before we treat it
         // as a token
 static unsigned int kMaxLengthForToken =
     12;  // upper bound on the number of characters in a word to be declared as
          // a token
 
-#define FORGED_RECEIVED_HEADER_HINT NS_LITERAL_CSTRING("may be forged")
+#define FORGED_RECEIVED_HEADER_HINT "may be forged"_ns
 
 #ifndef M_LN2
 #  define M_LN2 0.69314718055994530942
 #endif
 
 #ifndef M_E
 #  define M_E 2.7182818284590452354
 #endif
@@ -495,18 +495,17 @@ void Tokenizer::tokenizeHeaders(nsIUTF8S
         }
 
         // important: leave out sender field. Too strong of an indicator
         break;
       case 'x':  // (2) X-Mailer / user-agent works best if it is untokenized,
                  // just fold the case and any leading/trailing white space
         // all headers beginning with x-mozilla are being changed by us, so
         // ignore
-        if (StringBeginsWith(headerName, NS_LITERAL_CSTRING("x-mozilla")))
-          break;
+        if (StringBeginsWith(headerName, "x-mozilla"_ns)) break;
         // fall through
         [[fallthrough]];
       case 'u':
         addTokenForHeader(headerName.get(), headerValue);
         break;
       default:
         addTokenForHeader(headerName.get(), headerValue);
         break;
@@ -737,20 +736,18 @@ void Tokenizer::tokenize(const char* aTe
 
   // RSS feeds store their summary information as an iframe. But due to
   // bug 365953, we can't see those in the plaintext serializer. As a
   // workaround, allow an option to replace iframe with div in the message
   // text. We disable by default, since most people won't be applying bayes
   // to RSS
 
   if (mIframeToDiv) {
-    text.ReplaceSubstring(NS_LITERAL_STRING("<iframe"),
-                          NS_LITERAL_STRING("<div"));
-    text.ReplaceSubstring(NS_LITERAL_STRING("/iframe>"),
-                          NS_LITERAL_STRING("/div>"));
+    text.ReplaceSubstring(u"<iframe"_ns, u"<div"_ns);
+    text.ReplaceSubstring(u"/iframe>"_ns, u"/div>"_ns);
   }
 
   stripHTML(text, strippedUCS2);
 
   // convert 0x3000(full width space) into 0x0020
   char16_t* substr_start = strippedUCS2.BeginWriting();
   char16_t* substr_end = strippedUCS2.EndWriting();
   while (substr_start != substr_end) {
@@ -1278,20 +1275,19 @@ nsresult nsBayesianFilter::tokenizeMessa
 
   nsCOMPtr<nsIMsgMessageService> msgService;
   nsresult rv = GetMessageServiceFromURI(nsDependentCString(aMessageURI),
                                          getter_AddRefs(msgService));
   NS_ENSURE_SUCCESS(rv, rv);
 
   aAnalyzer->setSource(aMessageURI);
   nsCOMPtr<nsIURI> dummyNull;
-  return msgService->StreamMessage(aMessageURI, aAnalyzer->mTokenListener,
-                                   aMsgWindow, nullptr, true /* convert data */,
-                                   NS_LITERAL_CSTRING("filter"), false,
-                                   getter_AddRefs(dummyNull));
+  return msgService->StreamMessage(
+      aMessageURI, aAnalyzer->mTokenListener, aMsgWindow, nullptr,
+      true /* convert data */, "filter"_ns, false, getter_AddRefs(dummyNull));
 }
 
 // a TraitAnalysis is the per-token representation of the statistical
 // calculations, basically created to group information that is then
 // sorted by mDistance
 struct TraitAnalysis {
   uint32_t mTokenIndex;
   double mDistance;
@@ -2163,31 +2159,31 @@ bool CorpusStore::readTokens(FILE* strea
 
 nsresult CorpusStore::getTrainingFile(nsIFile** aTrainingFile) {
   // should we cache the profile manager's directory?
   nsCOMPtr<nsIFile> profileDir;
 
   nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
                                        getter_AddRefs(profileDir));
   NS_ENSURE_SUCCESS(rv, rv);
-  rv = profileDir->Append(NS_LITERAL_STRING("training.dat"));
+  rv = profileDir->Append(u"training.dat"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return profileDir->QueryInterface(NS_GET_IID(nsIFile), (void**)aTrainingFile);
 }
 
 nsresult CorpusStore::getTraitFile(nsIFile** aTraitFile) {
   // should we cache the profile manager's directory?
   nsCOMPtr<nsIFile> profileDir;
 
   nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
                                        getter_AddRefs(profileDir));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = profileDir->Append(NS_LITERAL_STRING("traits.dat"));
+  rv = profileDir->Append(u"traits.dat"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return profileDir->QueryInterface(NS_GET_IID(nsIFile), (void**)aTraitFile);
 }
 
 static const char kMagicCookie[] = {'\xFE', '\xED', '\xFA', '\xCE'};
 
 // random string used to identify trait file and version (last byte is version)
--- a/mailnews/extensions/fts3/src/nsFts3Tokenizer.cpp
+++ b/mailnews/extensions/fts3/src/nsFts3Tokenizer.cpp
@@ -25,37 +25,35 @@ nsFts3Tokenizer::nsFts3Tokenizer() {}
 nsFts3Tokenizer::~nsFts3Tokenizer() {}
 
 NS_IMETHODIMP
 nsFts3Tokenizer::RegisterTokenizer(mozIStorageConnection* connection) {
   nsresult rv;
   nsCOMPtr<mozIStorageStatement> selectStatement;
 
   // -- register the tokenizer
-  rv = connection->CreateStatement(
-      NS_LITERAL_CSTRING("SELECT fts3_tokenizer(?1, ?2)"),
-      getter_AddRefs(selectStatement));
+  rv = connection->CreateStatement("SELECT fts3_tokenizer(?1, ?2)"_ns,
+                                   getter_AddRefs(selectStatement));
   NS_ENSURE_SUCCESS(rv, rv);
 
   const sqlite3_tokenizer_module* module = nullptr;
   sqlite3Fts3PorterTokenizerModule(&module);
   if (!module) return NS_ERROR_FAILURE;
 
-  rv = selectStatement->BindUTF8StringByIndex(0,
-                                              NS_LITERAL_CSTRING("mozporter"));
+  rv = selectStatement->BindUTF8StringByIndex(0, "mozporter"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = selectStatement->BindBlobByIndex(1, (uint8_t*)&module, sizeof(module));
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool hasMore;
   rv = selectStatement->ExecuteStep(&hasMore);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // -- register the ranking function
   nsCOMPtr<mozIStorageFunction> func = new nsGlodaRankerFunction();
   NS_ENSURE_TRUE(func, NS_ERROR_OUT_OF_MEMORY);
-  rv = connection->CreateFunction(NS_LITERAL_CSTRING("glodaRank"),
+  rv = connection->CreateFunction("glodaRank"_ns,
                                   -1,  // variable argument support
                                   func);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return rv;
 }
--- a/mailnews/extensions/smime/src/nsCertPicker.cpp
+++ b/mailnews/extensions/smime/src/nsCertPicker.cpp
@@ -360,18 +360,18 @@ NS_IMETHODIMP nsCertPicker::PickByUsage(
           /* for the case when selectedNickname refers to nickname + serial */
           if (nickWithSerial == nsDependentString(selectedNickname)) {
             selectedIndex = CertsToUse;
             selectionFound = true;
           }
         }
       } else {
         // Placeholder, to keep the indexes valid.
-        certNicknameList.AppendElement(NS_LITERAL_STRING(""));
-        certDetailsList.AppendElement(NS_LITERAL_STRING(""));
+        certNicknameList.AppendElement(u""_ns);
+        certDetailsList.AppendElement(u""_ns);
       }
 
       ++CertsToUse;
     }
   }
 
   if (certNicknameList.IsEmpty()) {
     return NS_ERROR_NOT_AVAILABLE;
--- a/mailnews/imap/src/nsImapIncomingServer.cpp
+++ b/mailnews/imap/src/nsImapIncomingServer.cpp
@@ -1092,17 +1092,17 @@ NS_IMETHODIMP nsImapIncomingServer::Poss
       // or the canonical path - one or the other, but be consistent.
       dupFolderPath.ReplaceChar('/', hierarchyDelimiter);
       if (hierarchyDelimiter != '/')
         nsImapUrl::UnescapeSlashes(dupFolderPath.BeginWriting());
 
       // GMail gives us a localized name for the inbox but doesn't let
       // us select that localized name.
       if (boxFlags & kImapInbox)
-        imapFolder->SetOnlineName(NS_LITERAL_CSTRING("INBOX"));
+        imapFolder->SetOnlineName("INBOX"_ns);
       else if (onlineName.IsEmpty() || !onlineName.Equals(dupFolderPath))
         imapFolder->SetOnlineName(dupFolderPath);
 
       if (hierarchyDelimiter != '/')
         nsImapUrl::UnescapeSlashes(folderName.BeginWriting());
       if (NS_SUCCEEDED(CopyMUTF7toUTF16(folderName, unicodeName)))
         child->SetPrettyName(unicodeName);
     }
@@ -1317,32 +1317,32 @@ NS_IMETHODIMP nsImapIncomingServer::Disc
     if (NS_SUCCEEDED(rv) && identity) {
       nsCString folderUri;
       identity->GetFccFolder(folderUri);
       nsCString existingUri;
 
       if (CheckSpecialFolder(folderUri, nsMsgFolderFlags::SentMail,
                              existingUri)) {
         identity->SetFccFolder(existingUri);
-        identity->SetFccFolderPickerMode(NS_LITERAL_CSTRING("1"));
+        identity->SetFccFolderPickerMode("1"_ns);
       }
       identity->GetDraftFolder(folderUri);
       if (CheckSpecialFolder(folderUri, nsMsgFolderFlags::Drafts,
                              existingUri)) {
         identity->SetDraftFolder(existingUri);
-        identity->SetDraftsFolderPickerMode(NS_LITERAL_CSTRING("1"));
+        identity->SetDraftsFolderPickerMode("1"_ns);
       }
       bool archiveEnabled;
       identity->GetArchiveEnabled(&archiveEnabled);
       if (archiveEnabled) {
         identity->GetArchiveFolder(folderUri);
         if (CheckSpecialFolder(folderUri, nsMsgFolderFlags::Archive,
                                existingUri)) {
           identity->SetArchiveFolder(existingUri);
-          identity->SetArchivesFolderPickerMode(NS_LITERAL_CSTRING("1"));
+          identity->SetArchivesFolderPickerMode("1"_ns);
         }
       }
       identity->GetStationeryFolder(folderUri);
       if (!folderUri.IsEmpty()) {
         nsCOMPtr<nsIMsgFolder> folder;
         rv = GetOrCreateFolder(folderUri, getter_AddRefs(folder));
         if (NS_SUCCEEDED(rv)) rv = folder->SetFlag(nsMsgFolderFlags::Templates);
       }
@@ -1679,17 +1679,17 @@ nsImapIncomingServer::FEAlert(const nsAS
     if (NS_SUCCEEDED(rv)) {
       nsString message;
       nsString tempString(aAlertString);
       AutoTArray<nsString, 2> params = {hostName, tempString};
 
       rv = m_stringBundle->FormatStringFromName("imapServerAlert", params,
                                                 message);
       if (NS_SUCCEEDED(rv)) {
-        aUrl->SetErrorCode(NS_LITERAL_CSTRING("imap-server-alert"));
+        aUrl->SetErrorCode("imap-server-alert"_ns);
         aUrl->SetErrorMessage(message);
 
         return AlertUser(message, aUrl);
       }
     }
   }
   return AlertUser(aAlertString, aUrl);
 }
@@ -1769,17 +1769,17 @@ NS_IMETHODIMP nsImapIncomingServer::FEAl
   nsImapAction imapAction;
 
   imapUrl->GetRequiredImapState(&imapState);
   imapUrl->GetImapAction(&imapAction);
   nsString folderName;
 
   NS_ConvertUTF8toUTF16 unicodeMsg(message);
 
-  aUrl->SetErrorCode(NS_LITERAL_CSTRING("imap-server-error"));
+  aUrl->SetErrorCode("imap-server-error"_ns);
   aUrl->SetErrorMessage(unicodeMsg);
 
   nsCOMPtr<nsIMsgFolder> folder;
   if (imapState == nsIImapUrl::nsImapSelectedState ||
       imapAction == nsIImapUrl::nsImapFolderStatus) {
     aUrl->GetFolder(getter_AddRefs(folder));
     if (folder) folder->GetPrettyName(folderName);
     msgName = "imapFolderCommandFailed";
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -549,18 +549,18 @@ NS_IMETHODIMP nsImapMailFolder::GetSubFo
       rv = CreateSubFolders(pathFile);
     }
     if (isServer) {
       nsCOMPtr<nsIMsgFolder> inboxFolder;
 
       GetFolderWithFlags(nsMsgFolderFlags::Inbox, getter_AddRefs(inboxFolder));
       if (!inboxFolder) {
         // create an inbox if we don't have one.
-        CreateClientSubfolderInfo(NS_LITERAL_CSTRING("INBOX"),
-                                  kOnlineHierarchySeparatorUnknown, 0, true);
+        CreateClientSubfolderInfo("INBOX"_ns, kOnlineHierarchySeparatorUnknown,
+                                  0, true);
       }
     }
 
     int32_t count = mSubFolders.Count();
     nsCOMPtr<nsISimpleEnumerator> dummy;
     for (int32_t i = 0; i < count; i++)
       mSubFolders[i]->GetSubFolders(getter_AddRefs(dummy));
 
@@ -740,19 +740,18 @@ NS_IMETHODIMP nsImapMailFolder::UpdateFo
 
   bool isServer;
   rv = GetIsServer(&isServer);
   if (NS_SUCCEEDED(rv) && isServer) {
     if (!m_haveDiscoveredAllFolders) {
       bool hasSubFolders = false;
       GetHasSubFolders(&hasSubFolders);
       if (!hasSubFolders) {
-        rv = CreateClientSubfolderInfo(NS_LITERAL_CSTRING("Inbox"),
-                                       kOnlineHierarchySeparatorUnknown, 0,
-                                       false);
+        rv = CreateClientSubfolderInfo(
+            "Inbox"_ns, kOnlineHierarchySeparatorUnknown, 0, false);
         NS_ENSURE_SUCCESS(rv, rv);
       }
       m_haveDiscoveredAllFolders = true;
     }
     selectFolder = false;
   }
   rv = GetDatabase();
   if (NS_FAILED(rv)) {
@@ -2959,22 +2958,19 @@ nsresult nsImapMailFolder::NormalEndHead
   }
 
   if (m_isGmailServer) {
     nsCOMPtr<nsIImapFlagAndUidState> flagState;
     aProtocol->GetFlagAndUidState(getter_AddRefs(flagState));
     nsCString msgIDValue;
     nsCString threadIDValue;
     nsCString labelsValue;
-    flagState->GetCustomAttribute(m_curMsgUid, NS_LITERAL_CSTRING("X-GM-MSGID"),
-                                  msgIDValue);
-    flagState->GetCustomAttribute(m_curMsgUid, NS_LITERAL_CSTRING("X-GM-THRID"),
-                                  threadIDValue);
-    flagState->GetCustomAttribute(
-        m_curMsgUid, NS_LITERAL_CSTRING("X-GM-LABELS"), labelsValue);
+    flagState->GetCustomAttribute(m_curMsgUid, "X-GM-MSGID"_ns, msgIDValue);
+    flagState->GetCustomAttribute(m_curMsgUid, "X-GM-THRID"_ns, threadIDValue);
+    flagState->GetCustomAttribute(m_curMsgUid, "X-GM-LABELS"_ns, labelsValue);
     newMsgHdr->SetStringProperty("X-GM-MSGID", msgIDValue.get());
     newMsgHdr->SetStringProperty("X-GM-THRID", threadIDValue.get());
     newMsgHdr->SetStringProperty("X-GM-LABELS", labelsValue.get());
   }
 
   m_msgParser->Clear();  // clear out parser, because it holds onto a msg hdr.
   m_msgParser->SetMailDB(nullptr);  // tell it to let go of the db too.
   // I don't think we want to do this - it does bad things like set the size
@@ -3309,19 +3305,18 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
               mDatabase->MarkMDNSent(msgKey, true, nullptr);
             }
             nsresult rv = MoveIncorporatedMessage(
                 msgHdr, mDatabase, actionTargetFolderUri, filter, msgWindow);
             if (NS_SUCCEEDED(rv)) {
               m_msgMovedByFilter = true;
             } else {
               if (loggingEnabled) {
-                (void)filter->LogRuleHitFail(
-                    filterAction, msgHdr, rv,
-                    NS_LITERAL_CSTRING("filterFailureMoveFailed"));
+                (void)filter->LogRuleHitFail(filterAction, msgHdr, rv,
+                                             "filterFailureMoveFailed"_ns);
               }
             }
           }
           // don't apply any more filters, even if it was a move to the same
           // folder
           *applyMore = false;
         } break;
         case nsMsgFilterAction::CopyToFolder: {
@@ -3351,19 +3346,18 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
 
             nsCOMPtr<nsIMsgCopyService> copyService =
                 do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
             if (NS_FAILED(rv)) break;
             rv = copyService->CopyMessages(this, messageArray, dstFolder, false,
                                            nullptr, msgWindow, false);
             if (NS_FAILED(rv)) {
               if (loggingEnabled) {
-                (void)filter->LogRuleHitFail(
-                    filterAction, msgHdr, rv,
-                    NS_LITERAL_CSTRING("filterFailureCopyFailed"));
+                (void)filter->LogRuleHitFail(filterAction, msgHdr, rv,
+                                             "filterFailureCopyFailed"_ns);
               }
             }
           }
         } break;
         case nsMsgFilterAction::MarkRead: {
           mDatabase->MarkHdrRead(msgHdr, true, nullptr);
           rv = StoreImapFlags(kImapMsgSeenFlag, true, {msgKey}, nullptr);
           msgIsNew = false;
@@ -3498,21 +3492,21 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
             if (NS_SUCCEEDED(rv) && compService) {
               rv = compService->ReplyWithTemplate(
                   msgHdr, replyTemplateUri.get(), msgWindow, server);
               if (NS_FAILED(rv)) {
                 NS_WARNING("ReplyWithTemplate failed");
                 if (rv == NS_ERROR_ABORT) {
                   (void)filter->LogRuleHitFail(
                       filterAction, msgHdr, rv,
-                      NS_LITERAL_CSTRING("filterFailureSendingReplyAborted"));
+                      "filterFailureSendingReplyAborted"_ns);
                 } else {
                   (void)filter->LogRuleHitFail(
                       filterAction, msgHdr, rv,
-                      NS_LITERAL_CSTRING("filterFailureSendingReplyError"));
+                      "filterFailureSendingReplyError"_ns);
                 }
               }
             }
           }
         } break;
 
         case nsMsgFilterAction::StopExecution: {
           // don't apply any more filters
@@ -3550,17 +3544,17 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
     }
     if (NS_FAILED(rv)) {
       finalResult = rv;
       MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
               ("(Imap) Action execution failed with error: %" PRIx32,
                static_cast<uint32_t>(rv)));
       if (loggingEnabled) {
         (void)filter->LogRuleHitFail(filterAction, msgHdr, rv,
-                                     NS_LITERAL_CSTRING("filterFailureAction"));
+                                     "filterFailureAction"_ns);
       }
     } else {
       MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
               ("(Imap) Action execution succeeded"));
     }
   }
   if (!msgIsNew) {
     int32_t numNewMessages;
@@ -4838,39 +4832,36 @@ nsImapMailFolder::GetCurMoveCopyMessageI
             isJunk = true;
         }
 
         nsCString keywords;  // MsgFindKeyword can't use nsACString
         mailCopyState->m_message->GetStringProperty("keywords",
                                                     getter_Copies(keywords));
         int32_t start;
         int32_t length;
-        bool hasJunk = MsgFindKeyword(NS_LITERAL_CSTRING("junk"), keywords,
-                                      &start, &length);
+        bool hasJunk = MsgFindKeyword("junk"_ns, keywords, &start, &length);
         if (hasJunk && !isJunk)
           keywords.Cut(start, length);
         else if (!hasJunk && isJunk)
           keywords.AppendLiteral(" Junk");
-        bool hasNonJunk = MsgFindKeyword(NS_LITERAL_CSTRING("nonjunk"),
-                                         keywords, &start, &length);
+        bool hasNonJunk =
+            MsgFindKeyword("nonjunk"_ns, keywords, &start, &length);
         if (!hasNonJunk)
-          hasNonJunk = MsgFindKeyword(NS_LITERAL_CSTRING("notjunk"), keywords,
-                                      &start, &length);
+          hasNonJunk = MsgFindKeyword("notjunk"_ns, keywords, &start, &length);
         if (hasNonJunk && !isNotJunk)
           keywords.Cut(start, length);
         else if (!hasNonJunk && isNotJunk)
           keywords.AppendLiteral(" NonJunk");
 
         // Cleanup extra spaces
         while (!keywords.IsEmpty() && keywords.First() == ' ')
           keywords.Cut(0, 1);
         while (!keywords.IsEmpty() && keywords.Last() == ' ')
           keywords.Cut(keywords.Length() - 1, 1);
-        while (!keywords.IsEmpty() &&
-               (start = keywords.Find(NS_LITERAL_CSTRING("  "))) >= 0)
+        while (!keywords.IsEmpty() && (start = keywords.Find("  "_ns)) >= 0)
           keywords.Cut(start, 1);
         aKeywords.Assign(keywords);
       }
     }
     // if we don't have a source header, and it's not the drafts folder,
     // then mark the message read, since it must be an append to the
     // fcc or templates folder.
     else if (mailCopyState) {
@@ -6874,17 +6865,17 @@ void nsImapMailFolder::SetPendingAttribu
   if (aIsMove)
     prefBranch->GetCharPref("mailnews.database.summary.dontPreserveOnMove",
                             dontPreserve);
   else
     prefBranch->GetCharPref("mailnews.database.summary.dontPreserveOnCopy",
                             dontPreserve);
 
   // We'll add spaces at beginning and end so we can search for space-name-space
-  nsCString dontPreserveEx(NS_LITERAL_CSTRING(" "));
+  nsCString dontPreserveEx(" "_ns);
   dontPreserveEx.Append(dontPreserve);
   dontPreserveEx.Append(' ');
 
   // these properties are set as integers below, so don't set them again
   // in the iteration through the properties
   dontPreserveEx.AppendLiteral(
       "offlineMsgSize msgOffset flags priority pseudoHdr ");
 
@@ -6916,17 +6907,17 @@ void nsImapMailFolder::SetPendingAttribu
         msgDBHdr->GetPropertyEnumerator(getter_AddRefs(propertyEnumerator));
     NS_ENSURE_SUCCESS_VOID(rv);
 
     nsAutoCString property;
     nsCString sourceString;
     bool hasMore;
     while (NS_SUCCEEDED(propertyEnumerator->HasMore(&hasMore)) && hasMore) {
       propertyEnumerator->GetNext(property);
-      nsAutoCString propertyEx(NS_LITERAL_CSTRING(" "));
+      nsAutoCString propertyEx(" "_ns);
       propertyEx.Append(property);
       propertyEx.Append(' ');
       if (dontPreserveEx.Find(propertyEx) != kNotFound) continue;
 
       nsCString sourceString;
       msgDBHdr->GetStringProperty(property.get(), getter_Copies(sourceString));
       mDatabase->SetAttributeOnPendingHdr(msgDBHdr, property.get(),
                                           sourceString.get());
@@ -8384,26 +8375,24 @@ bool nsImapMailFolder::ShowPreviewText()
     prefBranch->GetBoolPref("mail.biff.alert.show_preview", &showPreviewText);
   return showPreviewText;
 }
 
 nsresult nsImapMailFolder::PlaybackCoalescedOperations() {
   if (m_moveCoalescer) {
     nsTArray<nsMsgKey>* junkKeysToClassify = m_moveCoalescer->GetKeyBucket(0);
     if (junkKeysToClassify && !junkKeysToClassify->IsEmpty())
-      StoreCustomKeywords(m_moveCoalescer->GetMsgWindow(),
-                          NS_LITERAL_CSTRING("Junk"), EmptyCString(),
-                          *junkKeysToClassify, nullptr);
+      StoreCustomKeywords(m_moveCoalescer->GetMsgWindow(), "Junk"_ns,
+                          EmptyCString(), *junkKeysToClassify, nullptr);
     junkKeysToClassify->Clear();
     nsTArray<nsMsgKey>* nonJunkKeysToClassify =
         m_moveCoalescer->GetKeyBucket(1);
     if (nonJunkKeysToClassify && !nonJunkKeysToClassify->IsEmpty())
-      StoreCustomKeywords(m_moveCoalescer->GetMsgWindow(),
-                          NS_LITERAL_CSTRING("NonJunk"), EmptyCString(),
-                          *nonJunkKeysToClassify, nullptr);
+      StoreCustomKeywords(m_moveCoalescer->GetMsgWindow(), "NonJunk"_ns,
+                          EmptyCString(), *nonJunkKeysToClassify, nullptr);
     nonJunkKeysToClassify->Clear();
     return m_moveCoalescer->PlaybackMoves(ShowPreviewText());
   }
   return NS_OK;  // must not be any coalesced operations
 }
 
 NS_IMETHODIMP
 nsImapMailFolder::SetJunkScoreForMessages(
@@ -8411,22 +8400,19 @@ nsImapMailFolder::SetJunkScoreForMessage
     const nsACString& aJunkScore) {
   nsresult rv = nsMsgDBFolder::SetJunkScoreForMessages(aMessages, aJunkScore);
   if (NS_SUCCEEDED(rv)) {
     nsAutoCString messageIds;
     nsTArray<nsMsgKey> keys;
     nsresult rv = BuildIdsAndKeyArray2(aMessages, messageIds, keys);
     NS_ENSURE_SUCCESS(rv, rv);
     StoreCustomKeywords(
-        nullptr,
-        aJunkScore.EqualsLiteral("0") ? NS_LITERAL_CSTRING("NonJunk")
-                                      : NS_LITERAL_CSTRING("Junk"),
-        aJunkScore.EqualsLiteral("0") ? NS_LITERAL_CSTRING("Junk")
-                                      : NS_LITERAL_CSTRING("NonJunk"),
-        keys, nullptr);
+        nullptr, aJunkScore.EqualsLiteral("0") ? "NonJunk"_ns : "Junk"_ns,
+        aJunkScore.EqualsLiteral("0") ? "Junk"_ns : "NonJunk"_ns, keys,
+        nullptr);
     if (mDatabase) mDatabase->Commit(nsMsgDBCommitType::kLargeCommit);
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsImapMailFolder::OnMessageClassified(const char* aMsgURI,
                                       nsMsgJunkStatus aClassification,
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -2934,17 +2934,17 @@ void nsImapProtocol::ProcessSelectedStat
             HandleMemoryFailure();
         } break;
         case nsIImapUrl::nsImapDeleteFolderAndMsgs:
           DeleteFolderAndMsgs(mailboxName.get());
           break;
         case nsIImapUrl::nsImapDeleteAllMsgs: {
           uint32_t numberOfMessages = GetServerStateParser().NumberOfMessages();
           if (numberOfMessages) {
-            Store(NS_LITERAL_CSTRING("1:*"), "+FLAGS.SILENT (\\Deleted)",
+            Store("1:*"_ns, "+FLAGS.SILENT (\\Deleted)",
                   false);  // use sequence #'s
 
             if (GetServerStateParser().LastCommandSuccessful())
               Expunge();  // expunge messages with deleted flag
             if (GetServerStateParser().LastCommandSuccessful()) {
               // convert name back from utf7
               nsCString canonicalName;
               const char* selectedMailboxName =
@@ -4175,17 +4175,17 @@ void nsImapProtocol::ProcessMailboxUpdat
           bool expungeHappened = numNewUIDs != (numExists - numPrevExists);
           if (expungeHappened) {
             // Sanity check failed - need full fetch to remove expunged msgs.
             MOZ_LOG(IMAP_CS, LogLevel::Debug,
                     ("Other client expunged msgs, do full fetch to remove "
                      "expunged msgs"));
             m_flagState->Reset();
             m_flagState->SetPartialUIDFetch(false);
-            FetchMessage(NS_LITERAL_CSTRING("1:*"), kFlags);
+            FetchMessage("1:*"_ns, kFlags);
           } else if (numNewUIDs == 0) {
             // Nothing has been expunged and no new UIDs, so if just a flag
             // change on existing message(s), avoid unneeded fetch of flags for
             // messages with UIDs at and above uid (see var uid above) when
             // "highwater mark" fetch occurs below.
             if (mFolderHighestUID && flagChangeDetected) {
               MOZ_LOG(IMAP_CS, LogLevel::Debug,
                       ("Avoid unneeded fetches after just flag changes"));
@@ -4895,17 +4895,17 @@ void nsImapProtocol::DiscoverMailboxSpec
           }
         }
 
         // Don't set the Trash flag if not using the Trash model
         if (GetDeleteIsMoveToTrash() && !onlineTrashFolderExists &&
             adoptedBoxSpec->mAllocatedPathName.Find(
                 m_trashFolderPath, /* ignoreCase = */ true) != -1) {
           bool trashExists = false;
-          if (StringBeginsWith(m_trashFolderPath, NS_LITERAL_CSTRING("INBOX/"),
+          if (StringBeginsWith(m_trashFolderPath, "INBOX/"_ns,
                                nsCaseInsensitiveCStringComparator)) {
             nsAutoCString pathName(adoptedBoxSpec->mAllocatedPathName.get() +
                                    6);
             trashExists =
                 StringBeginsWith(
                     adoptedBoxSpec->mAllocatedPathName, m_trashFolderPath,
                     nsCaseInsensitiveCStringComparator) && /* "INBOX/" */
                 pathName.Equals(Substring(m_trashFolderPath, 6),
@@ -6844,17 +6844,17 @@ void nsImapProtocol::OnDeleteFolder(cons
     if (deleted) FolderDeleted(sourceMailbox);
   }
 }
 
 void nsImapProtocol::RemoveMsgsAndExpunge() {
   uint32_t numberOfMessages = GetServerStateParser().NumberOfMessages();
   if (numberOfMessages) {
     // Remove all msgs and expunge the folder (ie, compact it).
-    Store(NS_LITERAL_CSTRING("1:*"), "+FLAGS.SILENT (\\Deleted)",
+    Store("1:*"_ns, "+FLAGS.SILENT (\\Deleted)",
           false);  // use sequence #'s
     if (GetServerStateParser().LastCommandSuccessful()) Expunge();
   }
 }
 
 void nsImapProtocol::DeleteFolderAndMsgs(const char* sourceMailbox) {
   RemoveMsgsAndExpunge();
   if (GetServerStateParser().LastCommandSuccessful()) {
--- a/mailnews/imap/src/nsImapServerResponseParser.cpp
+++ b/mailnews/imap/src/nsImapServerResponseParser.cpp
@@ -1126,52 +1126,50 @@ void nsImapServerResponseParser::msg_fet
       else {
         fMsgID = CreateAtom();
         AdvanceToNextToken();
         nsCString msgIDValue;
         msgIDValue.Assign(fMsgID);
         if (fCurrentResponseUID == 0)
           fFlagState->GetUidOfMessage(fFetchResponseIndex - 1,
                                       &fCurrentResponseUID);
-        fFlagState->SetCustomAttribute(
-            fCurrentResponseUID, NS_LITERAL_CSTRING("X-GM-MSGID"), msgIDValue);
+        fFlagState->SetCustomAttribute(fCurrentResponseUID, "X-GM-MSGID"_ns,
+                                       msgIDValue);
         PR_FREEIF(fMsgID);
       }
     } else if (!PL_strcasecmp(fNextToken, "X-GM-THRID")) {
       AdvanceToNextToken();
       if (!fNextToken)
         SetSyntaxError(true);
       else {
         fThreadID = CreateAtom();
         AdvanceToNextToken();
         nsCString threadIDValue;
         threadIDValue.Assign(fThreadID);
         if (fCurrentResponseUID == 0)
           fFlagState->GetUidOfMessage(fFetchResponseIndex - 1,
                                       &fCurrentResponseUID);
-        fFlagState->SetCustomAttribute(fCurrentResponseUID,
-                                       NS_LITERAL_CSTRING("X-GM-THRID"),
+        fFlagState->SetCustomAttribute(fCurrentResponseUID, "X-GM-THRID"_ns,
                                        threadIDValue);
         PR_FREEIF(fThreadID);
       }
     } else if (!PL_strcasecmp(fNextToken, "X-GM-LABELS")) {
       AdvanceToNextToken();
       if (!fNextToken)
         SetSyntaxError(true);
       else {
         fLabels = CreateParenGroup();
         nsCString labelsValue;
         labelsValue.Assign(fLabels);
         labelsValue.Cut(0, 1);
         labelsValue.Cut(labelsValue.Length() - 1, 1);
         if (fCurrentResponseUID == 0)
           fFlagState->GetUidOfMessage(fFetchResponseIndex - 1,
                                       &fCurrentResponseUID);
-        fFlagState->SetCustomAttribute(fCurrentResponseUID,
-                                       NS_LITERAL_CSTRING("X-GM-LABELS"),
+        fFlagState->SetCustomAttribute(fCurrentResponseUID, "X-GM-LABELS"_ns,
                                        labelsValue);
         PR_FREEIF(fLabels);
       }
     }
 
     // I only fetch RFC822 so I should never see these BODY responses
     else if (!PL_strcasecmp(fNextToken, "BODY"))
       skip_to_CRLF();  // I never ask for this
@@ -1348,17 +1346,17 @@ void nsImapServerResponseParser::xaolenv
     if (ContinueParse()) {
       AdvanceToNextToken();
       if (ContinueParse()) {
         nsAutoCString fromLine;
         if (!strcmp(GetSelectedMailboxName(), "Sent Items")) {
           // xaol envelope switches the From with the To, so we switch them back
           // and create a fake from line From: user@aol.com
           fromLine.AppendLiteral("To: ");
-          nsAutoCString fakeFromLine(NS_LITERAL_CSTRING("From: "));
+          nsAutoCString fakeFromLine("From: "_ns);
           fakeFromLine.Append(fServerConnection.GetImapUserName());
           fakeFromLine.AppendLiteral("@aol.com");
           fServerConnection.HandleMessageDownLoadLine(fakeFromLine.get(),
                                                       false);
         } else {
           fromLine.AppendLiteral("From: ");
         }
         parse_address(fromLine);
--- a/mailnews/imap/src/nsImapService.cpp
+++ b/mailnews/imap/src/nsImapService.cpp
@@ -216,18 +216,17 @@ NS_IMETHODIMP nsImapService::LiteSelectF
                        nsIImapUrl::nsImapLiteSelectFolder, aMsgWindow, aURL);
 }
 
 NS_IMETHODIMP nsImapService::GetUrlForUri(const char* aMessageURI,
                                           nsIURI** aURL,
                                           nsIMsgWindow* aMsgWindow) {
   nsAutoCString messageURI(aMessageURI);
 
-  if (messageURI.Find(NS_LITERAL_CSTRING(
-          "&type=application/x-message-display")) != kNotFound)
+  if (messageURI.Find("&type=application/x-message-display"_ns) != kNotFound)
     return NS_NewURI(aURL, aMessageURI);
 
   nsCOMPtr<nsIMsgFolder> folder;
   nsAutoCString msgKey;
   nsresult rv = DecomposeImapURI(messageURI, getter_AddRefs(folder), msgKey);
   if (NS_SUCCEEDED(rv)) {
     nsCOMPtr<nsIImapUrl> imapUrl;
     nsAutoCString urlSpec;
@@ -521,19 +520,17 @@ NS_IMETHODIMP nsImapService::DisplayMess
                      (dontMarkAsReadPos != kNotFound));
       }
 
       rv = FetchMessage(imapUrl,
                         forcePeek ? nsIImapUrl::nsImapMsgFetchPeek
                                   : nsIImapUrl::nsImapMsgFetch,
                         folder, imapMessageSink, aMsgWindow, aDisplayConsumer,
                         msgKey, false,
-                        (mPrintingOperation) ? NS_LITERAL_CSTRING("print")
-                                             : NS_LITERAL_CSTRING(""),
-                        aURL);
+                        (mPrintingOperation) ? "print"_ns : ""_ns, aURL);
     }
   }
   return rv;
 }
 
 nsresult nsImapService::FetchMimePart(
     nsIImapUrl* aImapUrl, nsImapAction aImapAction,
     nsIMsgFolder* aImapMailFolder, nsIImapMessageSink* aImapMessage,
--- a/mailnews/imap/src/nsImapUtils.cpp
+++ b/mailnews/imap/src/nsImapUtils.cpp
@@ -41,17 +41,17 @@ nsresult nsParseImapMessageURI(const cha
   if (!key) return NS_ERROR_NULL_POINTER;
 
   nsAutoCString uriStr(uri);
   int32_t folderEnd = -1;
   // imap-message uri's can have imap:// url strings tacked on the end,
   // e.g., when opening/saving attachments. We don't want to look for '#'
   // in that part of the uri, if the attachment name contains '#',
   // so check for that here.
-  if (StringBeginsWith(uriStr, NS_LITERAL_CSTRING("imap-message")))
+  if (StringBeginsWith(uriStr, "imap-message"_ns))
     folderEnd = uriStr.Find("imap://");
 
   int32_t keySeparator = uriStr.RFindChar('#', folderEnd);
   if (keySeparator != -1) {
     int32_t keyEndSeparator = MsgFindCharInSet(uriStr, "/?&", keySeparator);
     nsAutoString folderPath;
     folderURI = StringHead(uriStr, keySeparator);
     folderURI.Cut(4, 8);  // cut out the _message part of imap-message:
--- a/mailnews/import/applemail/src/nsAppleMailImport.cpp
+++ b/mailnews/import/applemail/src/nsAppleMailImport.cpp
@@ -200,17 +200,17 @@ NS_IMETHODIMP nsAppleMailImportMail::Fin
   if (NS_SUCCEEDED(rv)) {
     // 2. look for "global" mailboxes, that don't belong to any specific
     // account. they are inside the
     //    root's Mailboxes/ folder
     nsCOMPtr<nsIFile> mailboxesDir(
         do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
     if (NS_SUCCEEDED(rv)) {
       mailboxesDir->InitWithFile(aMailboxFile);
-      rv = mailboxesDir->Append(NS_LITERAL_STRING("Mailboxes"));
+      rv = mailboxesDir->Append(u"Mailboxes"_ns);
       if (NS_SUCCEEDED(rv)) {
         IMPORT_LOG0("Looking for global Apple mailboxes");
 
         mCurDepth++;
         rv = FindMboxDirs(mailboxesDir, resultsArray, importService);
         mCurDepth--;
       }
     }
@@ -244,21 +244,21 @@ void nsAppleMailImportMail::FindAccountM
 
     if (isDirectory) {
       // now let's see if it's an account folder. if so, we want to traverse it
       // for .mbox children
       nsAutoString folderName;
       currentEntry->GetLeafName(folderName);
       bool isAccountFolder = false;
 
-      if (StringBeginsWith(folderName, NS_LITERAL_STRING("POP-"))) {
+      if (StringBeginsWith(folderName, u"POP-"_ns)) {
         // cut off "POP-" prefix so we get a nice folder name
         folderName.Cut(0, 4);
         isAccountFolder = true;
-      } else if (StringBeginsWith(folderName, NS_LITERAL_STRING("IMAP-"))) {
+      } else if (StringBeginsWith(folderName, u"IMAP-"_ns)) {
         // cut off "IMAP-" prefix so we get a nice folder name
         folderName.Cut(0, 5);
         isAccountFolder = true;
       }
 
       if (isAccountFolder) {
         IMPORT_LOG1("Found account: %s\n",
                     NS_ConvertUTF16toUTF8(folderName).get());
@@ -298,32 +298,32 @@ nsresult nsAppleMailImportMail::AddMboxD
   nsAutoString folderName;
   aFolder->GetLeafName(folderName);
 
   // cut off the suffix, if any, or prefix if this is an account folder.
   if (StringEndsWith(folderName, NS_LITERAL_STRING(POP_MBOX_SUFFIX)))
     folderName.SetLength(folderName.Length() - 5);
   else if (StringEndsWith(folderName, NS_LITERAL_STRING(IMAP_MBOX_SUFFIX)))
     folderName.SetLength(folderName.Length() - 9);
-  else if (StringBeginsWith(folderName, NS_LITERAL_STRING("POP-")))
+  else if (StringBeginsWith(folderName, u"POP-"_ns))
     folderName.Cut(4, folderName.Length());
-  else if (StringBeginsWith(folderName, NS_LITERAL_STRING("IMAP-")))
+  else if (StringBeginsWith(folderName, u"IMAP-"_ns))
     folderName.Cut(5, folderName.Length());
 
   nsCOMPtr<nsIImportMailboxDescriptor> desc;
   nsresult rv =
       aImportService->CreateNewMailboxDescriptor(getter_AddRefs(desc));
   if (NS_SUCCEEDED(rv)) {
     // find out number of messages in this .mbox
     uint32_t numMessages = 0;
     {
       // move to the .mbox's Messages folder
       nsCOMPtr<nsIFile> messagesFolder;
       aFolder->Clone(getter_AddRefs(messagesFolder));
-      nsresult rv = messagesFolder->Append(NS_LITERAL_STRING("Messages"));
+      nsresult rv = messagesFolder->Append(u"Messages"_ns);
       NS_ENSURE_SUCCESS(rv, rv);
 
       // count the number of messages in this folder. it sucks that we have to
       // iterate through the folder but XPCOM doesn't give us any way to just
       // get the file count, unfortunately. :-(
       nsCOMPtr<nsIDirectoryEnumerator> dirEnumerator;
       messagesFolder->GetDirectoryEntries(getter_AddRefs(dirEnumerator));
       if (dirEnumerator) {
@@ -485,17 +485,17 @@ nsAppleMailImportMail::ImportMailbox(nsI
   // then we've got some messages to import!
   uint32_t mailboxIdentifier;
   aMailbox->GetIdentifier(&mailboxIdentifier);
 
   if (mailboxIdentifier != kAccountMailboxID) {
     // move to the .mbox's Messages folder
     nsCOMPtr<nsIFile> messagesFolder;
     mboxFolder->Clone(getter_AddRefs(messagesFolder));
-    rv = messagesFolder->Append(NS_LITERAL_STRING("Messages"));
+    rv = messagesFolder->Append(u"Messages"_ns);
     if (NS_FAILED(rv)) {
       // even if there are no messages, it might still be a valid mailbox, or
       // even a parent for other mailboxes.
       //
       // just indicate that we're done, using the same number that we used to
       // estimate number of messages earlier.
       uint32_t finalSize;
       aMailbox->GetSize(&finalSize);
@@ -540,17 +540,17 @@ nsAppleMailImportMail::ImportMailbox(nsI
 
       // make sure it's an .emlx file
       bool isFile = false;
       currentEntry->IsFile(&isFile);
       if (!isFile) continue;
 
       nsAutoString leafName;
       currentEntry->GetLeafName(leafName);
-      if (!StringEndsWith(leafName, NS_LITERAL_STRING(".emlx"))) continue;
+      if (!StringEndsWith(leafName, u".emlx"_ns)) continue;
 
       nsCOMPtr<nsIMsgDBHdr> msgHdr;
       bool reusable;
       rv =
           msgStore->GetNewMsgOutputStream(aDstFolder, getter_AddRefs(msgHdr),
                                           &reusable, getter_AddRefs(outStream));
       if (NS_FAILED(rv)) break;
 
--- a/mailnews/import/applemail/src/nsEmlxHelperUtils.mm
+++ b/mailnews/import/applemail/src/nsEmlxHelperUtils.mm
@@ -81,17 +81,17 @@ nsresult nsEmlxHelperUtils::ConvertToMbo
     break;
   }
 
   // go through foundFromLines
   if (foundFromLines.Length()) {
     const char* chunkStart = aMessageBufferStart;
     for (unsigned i = 0; i < foundFromLines.Length(); ++i) {
       aOutBuffer.Append(chunkStart, (foundFromLines[i] - chunkStart));
-      aOutBuffer.Append(NS_LITERAL_CSTRING(">"));
+      aOutBuffer.Append(">"_ns);
 
       chunkStart = foundFromLines[i];
     }
     aOutBuffer.Append(chunkStart, (aMessageBufferEnd - chunkStart));
   }
 
   return NS_OK;
 }
--- a/mailnews/import/becky/src/nsBeckyAddressBooks.cpp
+++ b/mailnews/import/becky/src/nsBeckyAddressBooks.cpp
@@ -60,17 +60,17 @@ nsBeckyAddressBooks::GetNeedsFieldMap(ns
 }
 
 nsresult nsBeckyAddressBooks::FindAddressBookDirectory(
     nsIFile** aAddressBookDirectory) {
   nsCOMPtr<nsIFile> userDirectory;
   nsresult rv = nsBeckyUtils::FindUserDirectory(getter_AddRefs(userDirectory));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = userDirectory->Append(NS_LITERAL_STRING("AddrBook"));
+  rv = userDirectory->Append(u"AddrBook"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool exists = false;
   rv = userDirectory->Exists(&exists);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!exists) return NS_ERROR_FILE_NOT_FOUND;
 
   bool isDirectory = false;
@@ -116,17 +116,17 @@ bool nsBeckyAddressBooks::IsAddressBookF
 
   nsresult rv;
   bool isFile = false;
   rv = aFile->IsFile(&isFile);
   if (NS_FAILED(rv) && !isFile) return false;
 
   nsAutoString name;
   rv = aFile->GetLeafName(name);
-  return StringEndsWith(name, NS_LITERAL_STRING(".bab"));
+  return StringEndsWith(name, u".bab"_ns);
 }
 
 bool nsBeckyAddressBooks::HasAddressBookFile(nsIFile* aDirectory) {
   if (!aDirectory) return false;
 
   nsresult rv;
   bool isDirectory = false;
   rv = aDirectory->IsDirectory(&isDirectory);
--- a/mailnews/import/becky/src/nsBeckyFilters.cpp
+++ b/mailnews/import/becky/src/nsBeckyFilters.cpp
@@ -55,19 +55,19 @@ nsresult nsBeckyFilters::GetFilterFile(b
 
   // We assume the caller has already checked that aLocation is a directory,
   // otherwise it would not make sense to call us.
 
   nsresult rv;
   nsCOMPtr<nsIFile> filter;
   aLocation->Clone(getter_AddRefs(filter));
   if (aIncoming)
-    rv = filter->Append(NS_LITERAL_STRING("IFilter.def"));
+    rv = filter->Append(u"IFilter.def"_ns);
   else
-    rv = filter->Append(NS_LITERAL_STRING("OFilter.def"));
+    rv = filter->Append(u"OFilter.def"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool exists = false;
   rv = filter->Exists(&exists);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!exists) return NS_ERROR_FILE_NOT_FOUND;
 
   filter.forget(aFile);
@@ -224,17 +224,17 @@ nsresult nsBeckyFilters::SetSearchTerm(c
   rv = term->SetValue(value);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = term->SetBooleanAnd(false);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!searchKeyword.IsEmpty())
     rv = aFilter->SetFilterName(searchKeyword);
   else
-    rv = aFilter->SetFilterName(NS_LITERAL_STRING("No name"));
+    rv = aFilter->SetFilterName(u"No name"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return aFilter->AppendTerm(term);
 }
 
 nsresult nsBeckyFilters::CreateRuleAction(nsIMsgFilter* aFilter,
                                           nsMsgRuleActionType actionType,
                                           nsIMsgRuleAction** _retval) {
@@ -494,17 +494,17 @@ nsresult nsBeckyFilters::ParseFilterFile
         break;
       case '!':
         SetRuleAction(line, filter);
         break;
       case '@':
         SetSearchTerm(line, filter);
         break;
       case '$':  // $X: disabled
-        if (StringBeginsWith(line, NS_LITERAL_CSTRING("$X")) && filter) {
+        if (StringBeginsWith(line, "$X"_ns) && filter) {
           filter->SetEnabled(false);
         }
         break;
       default:
         break;
     }
   }
 
--- a/mailnews/import/becky/src/nsBeckyMail.cpp
+++ b/mailnews/import/becky/src/nsBeckyMail.cpp
@@ -196,26 +196,25 @@ nsresult nsBeckyMail::CollectMailboxesIn
     nsCOMPtr<nsIFile> file;
     rv = entries->GetNextFile(getter_AddRefs(file));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsAutoString name;
     rv = file->GetLeafName(name);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    if (StringEndsWith(name, NS_LITERAL_STRING(".bmf"))) {
+    if (StringEndsWith(name, u".bmf"_ns)) {
       AppendMailboxDescriptor(file, mailboxName, aDepth, aCollected);
     }
 
     // The Folder.lst file is not created if there is only one sub folder,
     // so we need to find the sub folder by our hands.
     // The folder name does not begin with # or ! maybe. Yes, maybe...
     if (!folderListExists) {
-      if (StringBeginsWith(name, NS_LITERAL_STRING("#")) ||
-          StringBeginsWith(name, NS_LITERAL_STRING("!")))
+      if (StringBeginsWith(name, u"#"_ns) || StringBeginsWith(name, u"!"_ns))
         continue;
 
       bool isDirectory = false;
       rv = file->IsDirectory(&isDirectory);
       if (isDirectory) {
         CollectMailboxesInDirectory(file, aDepth + 1, aCollected);
         continue;
       }
@@ -387,17 +386,17 @@ nsresult ImportMessageRunnable::GetAttac
                                                   const nsCString& aHeader,
                                                   nsIFile** _retval) {
   nsresult rv;
   nsCOMPtr<nsIFile> attachmentFile;
 
   rv = aMailboxFile->Clone(getter_AddRefs(attachmentFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = attachmentFile->Append(NS_LITERAL_STRING("#Attach"));
+  rv = attachmentFile->Append(u"#Attach"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoCString nativeAttachmentPath;
   rv = GetBeckyIncludeValue(aHeader, nativeAttachmentPath);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = attachmentFile->AppendRelativeNativePath(nativeAttachmentPath);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -479,17 +478,17 @@ NS_IMETHODIMP ImportMessageRunnable::Run
       if (!reusable) outputStream->Close();
       mResult = msgStore->GetNewMsgOutputStream(mFolder, getter_AddRefs(msgHdr),
                                                 &reusable,
                                                 getter_AddRefs(outputStream));
     } else if (IsBeckyIncludeLine(line)) {
       mResult = WriteAttachmentFile(mMessageFile, line, outputStream);
     } else {
       uint32_t writtenBytes = 0;
-      if (StringBeginsWith(line, NS_LITERAL_CSTRING("..")))
+      if (StringBeginsWith(line, ".."_ns))
         line.Cut(0, 1);
       else if (CheckHeaderKey(line, "From"))
         line.Insert('>', 0);
 
       line.AppendLiteral(MSG_LINEBREAK);
       mResult = outputStream->Write(line.get(), line.Length(), &writtenBytes);
     }
   }
--- a/mailnews/import/becky/src/nsBeckySettings.cpp
+++ b/mailnews/import/becky/src/nsBeckySettings.cpp
@@ -129,52 +129,46 @@ nsresult nsBeckySettings::CreateIncoming
 
   return NS_OK;
 }
 
 nsresult nsBeckySettings::SetupSmtpServer(nsISmtpServer** aServer) {
   nsresult rv;
   nsAutoCString userName, serverName;
 
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("SMTPServer"), serverName);
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("UserID"), userName);
+  mParser->GetString("Account"_ns, "SMTPServer"_ns, serverName);
+  mParser->GetString("Account"_ns, "UserID"_ns, userName);
 
   nsCOMPtr<nsISmtpServer> server;
   bool existing = false;
   rv =
       CreateSmtpServer(userName, serverName, getter_AddRefs(server), &existing);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // If we already have an existing server, do not touch it's settings.
   if (existing) {
     server.forget(aServer);
     return NS_OK;
   }
 
   nsAutoCString value;
-  rv = mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                          NS_LITERAL_CSTRING("SMTPPort"), value);
+  rv = mParser->GetString("Account"_ns, "SMTPPort"_ns, value);
   int32_t port = 25;
   if (NS_SUCCEEDED(rv)) {
     nsresult errorCode;
     port = value.ToInteger(&errorCode, 10);
   }
   server->SetPort(port);
 
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("SSLSMTP"), value);
+  mParser->GetString("Account"_ns, "SSLSMTP"_ns, value);
   if (value.EqualsLiteral("1")) server->SetSocketType(nsMsgSocketType::SSL);
 
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("SMTPAUTH"), value);
+  mParser->GetString("Account"_ns, "SMTPAUTH"_ns, value);
   if (value.EqualsLiteral("1")) {
-    mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                       NS_LITERAL_CSTRING("SMTPAUTHMODE"), value);
+    mParser->GetString("Account"_ns, "SMTPAUTHMODE"_ns, value);
     nsMsgAuthMethodValue authMethod = nsMsgAuthMethod::none;
     if (value.EqualsLiteral("1")) {
       authMethod = nsMsgAuthMethod::passwordEncrypted;
     } else if (value.EqualsLiteral("2") || value.EqualsLiteral("4") ||
                value.EqualsLiteral("6")) {
       authMethod = nsMsgAuthMethod::passwordCleartext;
     } else {
       authMethod = nsMsgAuthMethod::anything;
@@ -187,130 +181,114 @@ nsresult nsBeckySettings::SetupSmtpServe
   return NS_OK;
 }
 
 nsresult nsBeckySettings::SetPop3ServerProperties(
     nsIMsgIncomingServer* aServer) {
   nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(aServer);
 
   nsAutoCString value;
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("POP3Auth"),
+  mParser->GetString("Account"_ns, "POP3Auth"_ns,
                      value);  // 0: plain, 1: APOP, 2: CRAM-MD5, 3: NTLM
   nsMsgAuthMethodValue authMethod;
   if (value.IsEmpty() || value.EqualsLiteral("0")) {
     authMethod = nsMsgAuthMethod::passwordCleartext;
   } else if (value.EqualsLiteral("1")) {
     authMethod = nsMsgAuthMethod::old;
   } else if (value.EqualsLiteral("2")) {
     authMethod = nsMsgAuthMethod::passwordEncrypted;
   } else if (value.EqualsLiteral("3")) {
     authMethod = nsMsgAuthMethod::NTLM;
   } else {
     authMethod = nsMsgAuthMethod::none;
   }
   aServer->SetAuthMethod(authMethod);
 
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("LeaveServer"), value);
+  mParser->GetString("Account"_ns, "LeaveServer"_ns, value);
   if (value.EqualsLiteral("1")) {
     pop3Server->SetLeaveMessagesOnServer(true);
-    nsresult rv = mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                                     NS_LITERAL_CSTRING("KeepDays"), value);
+    nsresult rv = mParser->GetString("Account"_ns, "KeepDays"_ns, value);
     if (NS_FAILED(rv)) return NS_OK;
 
     nsresult errorCode;
     int32_t leftDays = value.ToInteger(&errorCode, 10);
     if (NS_SUCCEEDED(errorCode)) {
       pop3Server->SetNumDaysToLeaveOnServer(leftDays);
       pop3Server->SetDeleteByAgeFromServer(true);
     }
   }
 
   return NS_OK;
 }
 
 nsresult nsBeckySettings::SetupIncomingServer(nsIMsgIncomingServer** aServer) {
   nsAutoCString value;
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("Protocol"), value);
+  mParser->GetString("Account"_ns, "Protocol"_ns, value);
   nsCString protocol;
   if (value.EqualsLiteral("1")) {
-    protocol = NS_LITERAL_CSTRING("imap");
+    protocol = "imap"_ns;
   } else {
-    protocol = NS_LITERAL_CSTRING("pop3");
+    protocol = "pop3"_ns;
   }
 
   nsAutoCString userName, serverName;
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("MailServer"), serverName);
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("UserID"), userName);
+  mParser->GetString("Account"_ns, "MailServer"_ns, serverName);
+  mParser->GetString("Account"_ns, "UserID"_ns, userName);
 
   nsresult rv;
   nsCOMPtr<nsIMsgIncomingServer> server;
   rv = CreateIncomingServer(userName, serverName, protocol,
                             getter_AddRefs(server));
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool isSecure = false;
   int32_t port = 0;
   nsresult errorCode;
   if (protocol.EqualsLiteral("pop3")) {
     SetPop3ServerProperties(server);
-    rv = mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                            NS_LITERAL_CSTRING("POP3Port"), value);
+    rv = mParser->GetString("Account"_ns, "POP3Port"_ns, value);
     if (NS_SUCCEEDED(rv))
       port = value.ToInteger(&errorCode, 10);
     else
       port = 110;
-    mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                       NS_LITERAL_CSTRING("SSLPOP"), value);
+    mParser->GetString("Account"_ns, "SSLPOP"_ns, value);
     if (value.EqualsLiteral("1")) isSecure = true;
   } else if (protocol.EqualsLiteral("imap")) {
-    rv = mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                            NS_LITERAL_CSTRING("IMAP4Port"), value);
+    rv = mParser->GetString("Account"_ns, "IMAP4Port"_ns, value);
     if (NS_SUCCEEDED(rv))
       port = value.ToInteger(&errorCode, 10);
     else
       port = 143;
-    mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                       NS_LITERAL_CSTRING("SSLIMAP"), value);
+    mParser->GetString("Account"_ns, "SSLIMAP"_ns, value);
     if (value.EqualsLiteral("1")) isSecure = true;
   }
 
   server->SetPort(port);
   if (isSecure) server->SetSocketType(nsMsgSocketType::SSL);
 
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("CheckInt"), value);
+  mParser->GetString("Account"_ns, "CheckInt"_ns, value);
   if (value.EqualsLiteral("1")) server->SetDoBiff(true);
-  rv = mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                          NS_LITERAL_CSTRING("CheckEvery"), value);
+  rv = mParser->GetString("Account"_ns, "CheckEvery"_ns, value);
   if (NS_SUCCEEDED(rv)) {
     int32_t minutes = value.ToInteger(&errorCode, 10);
     if (NS_SUCCEEDED(errorCode)) server->SetBiffMinutes(minutes);
   }
 
   server.forget(aServer);
 
   return NS_OK;
 }
 
 nsresult nsBeckySettings::CreateIdentity(nsIMsgIdentity** aIdentity) {
   nsAutoCString email, fullName, identityName, bccAddress;
 
-  mParser->GetString(NS_LITERAL_CSTRING("Account"), NS_LITERAL_CSTRING("Name"),
-                     identityName);
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("YourName"), fullName);
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("MailAddress"), email);
-  mParser->GetString(NS_LITERAL_CSTRING("Account"),
-                     NS_LITERAL_CSTRING("PermBcc"), bccAddress);
+  mParser->GetString("Account"_ns, "Name"_ns, identityName);
+  mParser->GetString("Account"_ns, "YourName"_ns, fullName);
+  mParser->GetString("Account"_ns, "MailAddress"_ns, email);
+  mParser->GetString("Account"_ns, "PermBcc"_ns, bccAddress);
 
   nsresult rv;
   nsCOMPtr<nsIMsgAccountManager> accountManager =
       do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgIdentity> identity;
   rv = accountManager->CreateIdentity(getter_AddRefs(identity));
--- a/mailnews/import/becky/src/nsBeckyUtils.cpp
+++ b/mailnews/import/becky/src/nsBeckyUtils.cpp
@@ -31,17 +31,17 @@
 
 nsresult nsBeckyUtils::FindUserDirectoryOnWindows7(nsIFile** aLocation) {
   NS_ENSURE_ARG_POINTER(aLocation);
 
   nsresult rv;
   nsCOMPtr<nsIFile> directory;
   rv = GetSpecialSystemDirectory(Win_Documents, getter_AddRefs(directory));
   NS_ENSURE_SUCCESS(rv, rv);
-  rv = directory->AppendNative(NS_LITERAL_CSTRING("Becky"));
+  rv = directory->AppendNative("Becky"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool exists = false;
   rv = directory->Exists(&exists);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!exists) return NS_ERROR_FILE_NOT_FOUND;
 
   bool isDirectory = false;
@@ -56,17 +56,17 @@ nsresult nsBeckyUtils::FindUserDirectory
 nsresult nsBeckyUtils::FindUserDirectoryOnWindowsXP(nsIFile** aLocation) {
   NS_ENSURE_ARG_POINTER(aLocation);
 
   nsresult rv;
   nsCOMPtr<nsIFile> directory =
       do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = directory->InitWithPath(NS_LITERAL_STRING("C:\\Becky!"));
+  rv = directory->InitWithPath(u"C:\\Becky!"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool exists = false;
   rv = directory->Exists(&exists);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!exists) return NS_ERROR_FILE_NOT_FOUND;
 
   bool isDirectory = false;
@@ -130,17 +130,17 @@ nsresult nsBeckyUtils::CreateLineInputSt
 
 nsresult nsBeckyUtils::GetFolderListFile(nsIFile* aLocation,
                                          nsIFile** _retval) {
   nsresult rv;
   nsCOMPtr<nsIFile> folderListFile;
   rv = aLocation->Clone(getter_AddRefs(folderListFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = folderListFile->Append(NS_LITERAL_STRING("Folder.lst"));
+  rv = folderListFile->Append(u"Folder.lst"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool exists;
   rv = folderListFile->Exists(&exists);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!exists) return NS_ERROR_FILE_NOT_FOUND;
 
@@ -203,17 +203,17 @@ nsresult nsBeckyUtils::GetDefaultMailbox
 
 nsresult nsBeckyUtils::GetMailboxINIFile(nsIFile* aDirectory,
                                          nsIFile** _retval) {
   nsresult rv;
   nsCOMPtr<nsIFile> target;
   rv = aDirectory->Clone(getter_AddRefs(target));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = target->Append(NS_LITERAL_STRING("Mailbox.ini"));
+  rv = target->Append(u"Mailbox.ini"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
   bool exists;
   rv = target->Exists(&exists);
   if (!exists) return NS_ERROR_FILE_NOT_FOUND;
 
   target.forget(_retval);
   return NS_OK;
 }
@@ -230,18 +230,17 @@ nsresult nsBeckyUtils::CreateINIParserFo
 
 nsresult nsBeckyUtils::GetMailboxNameFromINIFile(nsIFile* aFile,
                                                  nsCString& aName) {
   nsresult rv;
   nsCOMPtr<nsIINIParser> parser;
   rv = CreateINIParserForFile(aFile, getter_AddRefs(parser));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return parser->GetString(NS_LITERAL_CSTRING("Account"),
-                           NS_LITERAL_CSTRING("Name"), aName);
+  return parser->GetString("Account"_ns, "Name"_ns, aName);
 }
 
 nsresult nsBeckyUtils::ConvertToUTF8File(nsIFile* aSourceFile,
                                          nsIFile** _retval) {
   nsresult rv;
   nsCOMPtr<nsIFile> convertedFile;
   rv = GetSpecialDirectoryWithFileName(NS_OS_TEMP_DIR,
                                        "thunderbird-becky-import",
--- a/mailnews/import/outlook/src/nsOutlookCompose.cpp
+++ b/mailnews/import/outlook/src/nsOutlookCompose.cpp
@@ -199,17 +199,17 @@ nsresult nsOutlookCompose::CreateIdentit
   nsCOMPtr<nsIMsgAccountManager> accMgr =
       do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = accMgr->CreateIdentity(getter_AddRefs(m_pIdentity));
   nsString name;
   name.AssignLiteral("Import Identity");
   if (m_pIdentity) {
     m_pIdentity->SetFullName(name);
-    m_pIdentity->SetEmail(NS_LITERAL_CSTRING("import@service.invalid"));
+    m_pIdentity->SetEmail("import@service.invalid"_ns);
   }
   return rv;
 }
 
 void nsOutlookCompose::ReleaseIdentity() { m_pIdentity = nullptr; }
 
 nsresult nsOutlookCompose::CreateComponents(void) {
   nsresult rv = NS_OK;
--- a/mailnews/import/outlook/src/nsOutlookMail.cpp
+++ b/mailnews/import/outlook/src/nsOutlookMail.cpp
@@ -680,17 +680,17 @@ nsresult nsOutlookMail::CreateList(const
   m_mapi.MAPIFreeBuffer(value);
 
   nsIAbDirectory* outList;
   rv = pDirectory->AddMailList(newList, &outList);
   return rv;
 }
 
 void nsOutlookMail::SanitizeValue(nsString& val) {
-  val.ReplaceSubstring(NS_LITERAL_STRING("\r\n"), NS_LITERAL_STRING(", "));
+  val.ReplaceSubstring(u"\r\n"_ns, u", "_ns);
   val.ReplaceChar("\r\n", ',');
 }
 
 void nsOutlookMail::SplitString(nsString& val1, nsString& val2) {
   // Find the last line if there is more than one!
   int32_t idx = val1.RFind("\x0D\x0A");
   int32_t cnt = 2;
   if (idx == -1) {
--- a/mailnews/import/outlook/src/nsOutlookSettings.cpp
+++ b/mailnews/import/outlook/src/nsOutlookSettings.cpp
@@ -161,17 +161,17 @@ nsresult OutlookSettings::QueryAccountSu
   return NS_ERROR_FAILURE;
 }
 
 nsresult OutlookSettings::GetDefaultMailAccountName(nsAString& aName) {
   nsCOMPtr<nsIWindowsRegKey> key;
   nsresult rv = QueryAccountSubKey(getter_AddRefs(key));
   if (NS_FAILED(rv)) return rv;
 
-  return key->ReadStringValue(NS_LITERAL_STRING("Default Mail Account"), aName);
+  return key->ReadStringValue(u"Default Mail Account"_ns, aName);
 }
 
 bool OutlookSettings::DoImport(nsIMsgAccount** aAccount) {
   nsCOMPtr<nsIWindowsRegKey> key;
   nsresult rv = OutlookSettings::FindAccountsKey(getter_AddRefs(key));
   if (NS_FAILED(rv)) {
     IMPORT_LOG0("*** Error finding Outlook registry account keys\n");
     return false;
@@ -202,22 +202,22 @@ bool OutlookSettings::DoImport(nsIMsgAcc
 
     // Get the values for this account.
     nsAutoCString nativeKeyName;
     NS_CopyUnicodeToNative(keyName, nativeKeyName);
     IMPORT_LOG1("Opened Outlook account: %s\n", nativeKeyName.get());
 
     nsCOMPtr<nsIMsgAccount> account;
     nsAutoString value;
-    rv = subKey->ReadStringValue(NS_LITERAL_STRING("IMAP Server"), value);
+    rv = subKey->ReadStringValue(u"IMAP Server"_ns, value);
     if (NS_SUCCEEDED(rv) &&
         DoIMAPServer(accMgr, subKey, value, getter_AddRefs(account)))
       accounts++;
 
-    rv = subKey->ReadStringValue(NS_LITERAL_STRING("POP3 Server"), value);
+    rv = subKey->ReadStringValue(u"POP3 Server"_ns, value);
     if (NS_SUCCEEDED(rv) &&
         DoPOP3Server(accMgr, subKey, value, getter_AddRefs(account))) {
       popCount++;
       accounts++;
       if (aAccount && account) {
         // If we created a mail account, get rid of it since
         // we have 2 POP accounts!
         if (popCount > 1)
@@ -238,48 +238,47 @@ bool OutlookSettings::DoImport(nsIMsgAcc
 
   return accounts != 0;
 }
 
 nsresult OutlookSettings::GetAccountName(nsIWindowsRegKey* aKey,
                                          const nsString& aDefaultName,
                                          nsAString& aAccountName) {
   nsresult rv;
-  rv = aKey->ReadStringValue(NS_LITERAL_STRING("Account Name"), aAccountName);
+  rv = aKey->ReadStringValue(u"Account Name"_ns, aAccountName);
   if (NS_FAILED(rv)) aAccountName.Assign(aDefaultName);
 
   return NS_OK;
 }
 
 bool OutlookSettings::DoIMAPServer(nsIMsgAccountManager* aMgr,
                                    nsIWindowsRegKey* aKey,
                                    const nsString& aServerName,
                                    nsIMsgAccount** aAccount) {
   nsAutoString userName;
   nsresult rv;
-  rv = aKey->ReadStringValue(NS_LITERAL_STRING("IMAP User Name"), userName);
+  rv = aKey->ReadStringValue(u"IMAP User Name"_ns, userName);
   if (NS_FAILED(rv)) return false;
 
   bool result = false;
 
   // I now have a user name/server name pair, find out if it already exists?
   nsAutoCString nativeUserName;
   NS_CopyUnicodeToNative(userName, nativeUserName);
   nsAutoCString nativeServerName;
   NS_CopyUnicodeToNative(aServerName, nativeServerName);
   nsCOMPtr<nsIMsgIncomingServer> in;
-  rv = aMgr->FindServer(nativeUserName, nativeServerName,
-                        NS_LITERAL_CSTRING("imap"), getter_AddRefs(in));
+  rv = aMgr->FindServer(nativeUserName, nativeServerName, "imap"_ns,
+                        getter_AddRefs(in));
   if (NS_FAILED(rv) || (in == nullptr)) {
     // Create the incoming server and an account for it?
-    rv = aMgr->CreateIncomingServer(nativeUserName, nativeServerName,
-                                    NS_LITERAL_CSTRING("imap"),
+    rv = aMgr->CreateIncomingServer(nativeUserName, nativeServerName, "imap"_ns,
                                     getter_AddRefs(in));
     if (NS_SUCCEEDED(rv) && in) {
-      rv = in->SetType(NS_LITERAL_CSTRING("imap"));
+      rv = in->SetType("imap"_ns);
       // TODO SSL, auth method
 
       IMPORT_LOG2("Created IMAP server named: %s, userName: %s\n",
                   nativeServerName.get(), nativeUserName.get());
 
       nsAutoString prettyName;
       if (NS_SUCCEEDED(GetAccountName(aKey, aServerName, prettyName)))
         rv = in->SetPrettyName(prettyName);
@@ -306,34 +305,33 @@ bool OutlookSettings::DoIMAPServer(nsIMs
 }
 
 bool OutlookSettings::DoPOP3Server(nsIMsgAccountManager* aMgr,
                                    nsIWindowsRegKey* aKey,
                                    const nsString& aServerName,
                                    nsIMsgAccount** aAccount) {
   nsAutoString userName;
   nsresult rv;
-  rv = aKey->ReadStringValue(NS_LITERAL_STRING("POP3 User Name"), userName);
+  rv = aKey->ReadStringValue(u"POP3 User Name"_ns, userName);
   if (NS_FAILED(rv)) return false;
 
   // I now have a user name/server name pair, find out if it already exists?
   nsAutoCString nativeUserName;
   NS_CopyUnicodeToNative(userName, nativeUserName);
   nsAutoCString nativeServerName;
   NS_CopyUnicodeToNative(aServerName, nativeServerName);
   nsCOMPtr<nsIMsgIncomingServer> in;
-  rv = aMgr->FindServer(nativeUserName, nativeServerName,
-                        NS_LITERAL_CSTRING("pop3"), getter_AddRefs(in));
+  rv = aMgr->FindServer(nativeUserName, nativeServerName, "pop3"_ns,
+                        getter_AddRefs(in));
   if (NS_SUCCEEDED(rv)) return true;
 
   // Create the incoming server and an account for it?
-  rv = aMgr->CreateIncomingServer(nativeUserName, nativeServerName,
-                                  NS_LITERAL_CSTRING("pop3"),
+  rv = aMgr->CreateIncomingServer(nativeUserName, nativeServerName, "pop3"_ns,
                                   getter_AddRefs(in));
-  rv = in->SetType(NS_LITERAL_CSTRING("pop3"));
+  rv = in->SetType("pop3"_ns);
 
   // TODO SSL, auth method
 
   nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(in);
   NS_ENSURE_SUCCESS(rv, false);
 
   // set local folders as the Inbox to use for this POP3 server
   nsCOMPtr<nsIMsgIncomingServer> localFoldersServer;
@@ -377,51 +375,49 @@ bool OutlookSettings::DoPOP3Server(nsIMs
 
   rv = account->SetIncomingServer(in);
 
   IMPORT_LOG0(
       "Created a new account and set the incoming server to the POP3 "
       "server.\n");
 
   uint32_t leaveOnServer;
-  rv = aKey->ReadIntValue(NS_LITERAL_STRING("Leave Mail On Server"),
-                          &leaveOnServer);
+  rv = aKey->ReadIntValue(u"Leave Mail On Server"_ns, &leaveOnServer);
   if (NS_SUCCEEDED(rv))
     pop3Server->SetLeaveMessagesOnServer(leaveOnServer == 1 ? true : false);
 
   // Fiddle with the identities
   SetIdentities(aMgr, account, aKey);
 
   if (aAccount) account.forget(aAccount);
 
   return true;
 }
 
 void OutlookSettings::SetIdentities(nsIMsgAccountManager* aMgr,
                                     nsIMsgAccount* aAcc,
                                     nsIWindowsRegKey* aKey) {
   // Get the relevant information for an identity
   nsAutoString name;
-  aKey->ReadStringValue(NS_LITERAL_STRING("SMTP Display Name"), name);
+  aKey->ReadStringValue(u"SMTP Display Name"_ns, name);
 
   nsAutoString server;
-  aKey->ReadStringValue(NS_LITERAL_STRING("SMTP Server"), server);
+  aKey->ReadStringValue(u"SMTP Server"_ns, server);
 
   nsAutoString email;
-  aKey->ReadStringValue(NS_LITERAL_STRING("SMTP Email Address"), email);
+  aKey->ReadStringValue(u"SMTP Email Address"_ns, email);
 
   nsAutoString reply;
-  aKey->ReadStringValue(NS_LITERAL_STRING("SMTP Reply To Email Address"),
-                        reply);
+  aKey->ReadStringValue(u"SMTP Reply To Email Address"_ns, reply);
 
   nsAutoString userName;
-  aKey->ReadStringValue(NS_LITERAL_STRING("SMTP User Name"), userName);
+  aKey->ReadStringValue(u"SMTP User Name"_ns, userName);
 
   nsAutoString orgName;
-  aKey->ReadStringValue(NS_LITERAL_STRING("SMTP Organization Name"), orgName);
+  aKey->ReadStringValue(u"SMTP Organization Name"_ns, orgName);
 
   nsresult rv;
   nsCOMPtr<nsIMsgIdentity> id;
   if (!email.IsEmpty() && !name.IsEmpty() && !server.IsEmpty()) {
     // The default identity, nor any other identities matched,
     // create a new one and add it to the account.
     rv = aMgr->CreateIdentity(getter_AddRefs(id));
     if (id) {
--- a/mailnews/import/src/nsImportStringBundle.cpp
+++ b/mailnews/import/src/nsImportStringBundle.cpp
@@ -33,17 +33,17 @@ void nsImportStringBundle::GetStringByID
 char16_t* nsImportStringBundle::GetStringByID(int32_t aStringID,
                                               nsIStringBundle* aBundle) {
   if (aBundle) {
     nsAutoString str;
     nsresult rv = aBundle->GetStringFromID(aStringID, str);
     if (NS_SUCCEEDED(rv)) return ToNewUnicode(str);
   }
 
-  nsString resultString(NS_LITERAL_STRING("[StringID "));
+  nsString resultString(u"[StringID "_ns);
   resultString.AppendInt(aStringID);
   resultString.AppendLiteral("?]");
 
   return ToNewUnicode(resultString);
 }
 
 void nsImportStringBundle::GetStringByName(const char* aName,
                                            nsIStringBundle* aBundle,
@@ -54,14 +54,14 @@ void nsImportStringBundle::GetStringByNa
 char16_t* nsImportStringBundle::GetStringByName(const char* aName,
                                                 nsIStringBundle* aBundle) {
   if (aBundle) {
     nsAutoString str;
     nsresult rv = aBundle->GetStringFromName(aName, str);
     if (NS_SUCCEEDED(rv)) return ToNewUnicode(str);
   }
 
-  nsString resultString(NS_LITERAL_STRING("[StringName "));
+  nsString resultString(u"[StringName "_ns);
   resultString.Append(NS_ConvertUTF8toUTF16(aName).get());
   resultString.AppendLiteral("?]");
 
   return ToNewUnicode(resultString);
 }
--- a/mailnews/import/text/src/nsTextImport.cpp
+++ b/mailnews/import/text/src/nsTextImport.cpp
@@ -461,20 +461,20 @@ NS_IMETHODIMP ImportAddressImpl::GetNeed
 
   if (isLDIF) *_retval = false;
 
   return NS_OK;
 }
 
 void ImportAddressImpl::SanitizeSampleData(nsString& val) {
   // remove any line-feeds...
-  int32_t offset = val.Find(NS_LITERAL_STRING("\x0D\x0A"));
+  int32_t offset = val.Find(u"\x0D\x0A"_ns);
   while (offset != -1) {
-    val.Replace(offset, 2, NS_LITERAL_STRING(", "));
-    offset = val.Find(NS_LITERAL_STRING("\x0D\x0A"), offset + 2);
+    val.Replace(offset, 2, u", "_ns);
+    offset = val.Find(u"\x0D\x0A"_ns, offset + 2);
   }
   offset = val.FindChar(13);
   while (offset != -1) {
     val.Replace(offset, 1, ',');
     offset = val.FindChar(13, offset + 2);
   }
   offset = val.FindChar(10);
   while (offset != -1) {
--- a/mailnews/import/winlivemail/nsWMSettings.cpp
+++ b/mailnews/import/winlivemail/nsWMSettings.cpp
@@ -120,35 +120,35 @@ bool WMSettings::DoImport(nsIMsgAccount*
   }
   // 'poll for messages' setting in WM is a global setting-Like OE
   // for all accounts dword ==0xffffffff for don't poll else 1/60000 = minutes
   checkNewMailTime = 30;
   checkNewMail = false;
 
   nsresult rv;
   nsCOMPtr<nsIWindowsRegKey> subKey;
-  if (NS_SUCCEEDED(key->OpenChild(NS_LITERAL_STRING("mail"),
+  if (NS_SUCCEEDED(key->OpenChild(u"mail"_ns,
                                   nsIWindowsRegKey::ACCESS_QUERY_VALUE,
                                   getter_AddRefs(subKey)))) {
     uint32_t dwordResult = -1;
-    rv = subKey->ReadIntValue(NS_LITERAL_STRING("Poll For Mail"),
+    rv = subKey->ReadIntValue(u"Poll For Mail"_ns,
                               &dwordResult);  // reg_dword
     subKey->Close();
     if (NS_SUCCEEDED(rv) && dwordResult != -1) {
       checkNewMail = true;
       checkNewMailTime = dwordResult / 60000;
     }
   }
   // these are in main windowsmail key and if they don't exist-not to worry
   // (less than 64 chars) e.g.
   // account{4A18B81E-83CA-472A-8D7F-5301C0B97B8D}.oeaccount
   nsAutoString defMailAcct, defNewsAcct;
-  key->ReadStringValue(NS_LITERAL_STRING("Default Mail Account"),
+  key->ReadStringValue(u"Default Mail Account"_ns,
                        defMailAcct);  // ref_sz
-  key->ReadStringValue(NS_LITERAL_STRING("Default News Account"),
+  key->ReadStringValue(u"Default News Account"_ns,
                        defNewsAcct);  // ref_sz
 
   nsCOMPtr<nsIMsgAccountManager> accMgr =
       do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     IMPORT_LOG0("*** Failed to create an account manager!\n");
     return false;
   }
@@ -205,24 +205,24 @@ bool WMSettings::DoIMAPServer(nsIMsgAcco
   if (ppAccount) *ppAccount = nullptr;
 
   nsAutoString userName, value;
   if (NS_FAILED(nsWMUtils::GetValueForTag(xmlDoc, "IMAP_User_Name", userName)))
     return false;
   bool result = false;
   // I now have a user name/server name pair, find out if it already exists?
   nsCOMPtr<nsIMsgIncomingServer> in;
-  nsresult rv = pMgr->FindServer(
-      NS_ConvertUTF16toUTF8(userName), NS_ConvertUTF16toUTF8(serverName),
-      NS_LITERAL_CSTRING("imap"), getter_AddRefs(in));
+  nsresult rv = pMgr->FindServer(NS_ConvertUTF16toUTF8(userName),
+                                 NS_ConvertUTF16toUTF8(serverName), "imap"_ns,
+                                 getter_AddRefs(in));
   if (NS_FAILED(rv) || (in == nullptr)) {
     // Create the incoming server and an account for it?
-    rv = pMgr->CreateIncomingServer(
-        NS_ConvertUTF16toUTF8(userName), NS_ConvertUTF16toUTF8(serverName),
-        NS_LITERAL_CSTRING("imap"), getter_AddRefs(in));
+    rv = pMgr->CreateIncomingServer(NS_ConvertUTF16toUTF8(userName),
+                                    NS_ConvertUTF16toUTF8(serverName),
+                                    "imap"_ns, getter_AddRefs(in));
     if (NS_SUCCEEDED(rv) && in) {
       nsCOMPtr<nsIImapIncomingServer> imapServer = do_QueryInterface(in);
       if (!imapServer) {
         IMPORT_LOG1("*** Failed to create nsIImapIncomingServer for %S!\n",
                     serverName.get());
         return false;
       }
       if (NS_SUCCEEDED(
@@ -300,24 +300,24 @@ bool WMSettings::DoPOP3Server(nsIMsgAcco
   if (ppAccount) *ppAccount = nullptr;
 
   nsAutoString userName, value;
   if (NS_FAILED(nsWMUtils::GetValueForTag(xmlDoc, "POP3_User_Name", userName)))
     return false;
   bool result = false;
   // I now have a user name/server name pair, find out if it already exists?
   nsCOMPtr<nsIMsgIncomingServer> in;
-  nsresult rv = pMgr->FindServer(
-      NS_ConvertUTF16toUTF8(userName), NS_ConvertUTF16toUTF8(serverName),
-      NS_LITERAL_CSTRING("pop3"), getter_AddRefs(in));
+  nsresult rv = pMgr->FindServer(NS_ConvertUTF16toUTF8(userName),
+                                 NS_ConvertUTF16toUTF8(serverName), "pop3"_ns,
+                                 getter_AddRefs(in));
   if (NS_FAILED(rv) || (in == nullptr)) {
     // Create the incoming server and an account for it?
-    rv = pMgr->CreateIncomingServer(
-        NS_ConvertUTF16toUTF8(userName), NS_ConvertUTF16toUTF8(serverName),
-        NS_LITERAL_CSTRING("pop3"), getter_AddRefs(in));
+    rv = pMgr->CreateIncomingServer(NS_ConvertUTF16toUTF8(userName),
+                                    NS_ConvertUTF16toUTF8(serverName),
+                                    "pop3"_ns, getter_AddRefs(in));
     if (NS_SUCCEEDED(rv) && in) {
       nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(in);
       if (!pop3Server) {
         IMPORT_LOG1("*** Failed to create nsIPop3IncomingServer for %S!\n",
                     serverName.get());
         return false;
       }
 
@@ -451,22 +451,22 @@ bool WMSettings::DoNNTPServer(nsIMsgAcco
   nsWMUtils::GetValueForTag(xmlDoc, "NNTP_User_Name", userName);
   bool result = false;
 
   // I now have a user name/server name pair, find out if it already exists?
   // NNTP can have empty user name.  This is wild card in findserver
   nsCOMPtr<nsIMsgIncomingServer> in;
   nsresult rv =
       pMgr->FindServer(EmptyCString(), NS_ConvertUTF16toUTF8(serverName),
-                       NS_LITERAL_CSTRING("nntp"), getter_AddRefs(in));
+                       "nntp"_ns, getter_AddRefs(in));
   if (NS_FAILED(rv) || (in == nullptr)) {
     // Create the incoming server and an account for it?
-    rv = pMgr->CreateIncomingServer(
-        nsDependentCString(""), NS_ConvertUTF16toUTF8(serverName),
-        NS_LITERAL_CSTRING("nntp"), getter_AddRefs(in));
+    rv = pMgr->CreateIncomingServer(nsDependentCString(""),
+                                    NS_ConvertUTF16toUTF8(serverName),
+                                    "nntp"_ns, getter_AddRefs(in));
     if (NS_SUCCEEDED(rv) && in) {
       nsCOMPtr<nsINntpIncomingServer> nntpServer = do_QueryInterface(in);
       if (!nntpServer) {
         IMPORT_LOG1("*** Failed to create nsINnntpIncomingServer for %S!\n",
                     serverName.get());
         return false;
       }
       if (!userName.IsEmpty()) {  // if username req'd then auth req'd
--- a/mailnews/import/winlivemail/nsWMUtils.cpp
+++ b/mailnews/import/winlivemail/nsWMUtils.cpp
@@ -22,42 +22,41 @@
 
 nsresult nsWMUtils::FindWMKey(nsIWindowsRegKey** aKey) {
   nsresult rv;
   nsCOMPtr<nsIWindowsRegKey> key =
       do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = key->Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
-                 NS_LITERAL_STRING("Software\\Microsoft\\Windows Live Mail"),
+                 u"Software\\Microsoft\\Windows Live Mail"_ns),
                  nsIWindowsRegKey::ACCESS_QUERY_VALUE);
   if (NS_SUCCEEDED(rv)) {
     key.forget(aKey);
     return rv;
   }
 
   rv = key->Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
-                 NS_LITERAL_STRING("Software\\Microsoft\\Windows Mail"),
+                 u"Software\\Microsoft\\Windows Mail"_ns,
                  nsIWindowsRegKey::ACCESS_QUERY_VALUE);
   key.forget(aKey);
   return rv;
 }
 
 nsresult nsWMUtils::GetRootFolder(nsIFile** aRootFolder) {
   nsCOMPtr<nsIWindowsRegKey> key;
   if (NS_FAILED(nsWMUtils::FindWMKey(getter_AddRefs(key)))) {
     IMPORT_LOG0("*** Error finding Windows Live Mail registry account keys\n");
     return NS_ERROR_NOT_AVAILABLE;
   }
   // This is essential to proceed; it is the location on disk of xml-type
   // account files; it is in reg_expand_sz so it will need expanding to absolute
   // path.
   nsString storeRoot;
-  nsresult rv =
-      key->ReadStringValue(NS_LITERAL_STRING("Store Root"), storeRoot);
+  nsresult rv = key->ReadStringValue(u"Store Root"_ns, storeRoot);
   key->Close();  // Finished with windows registry key. We do not want to return
                  // before this closing
   if (NS_FAILED(rv) || storeRoot.IsEmpty()) {
     IMPORT_LOG0("*** Error finding Windows Live Mail Store Root\n");
     return rv;
   }
 
   uint32_t size =
@@ -107,18 +106,17 @@ nsresult nsWMUtils::GetOEAccountFilesInF
     NS_ENSURE_SUCCESS(rv, rv);
 
     if (isDirectory) {
       GetOEAccountFilesInFolder(file, aFileArray);
     } else {
       nsString name;
       rv = file->GetLeafName(name);
       NS_ENSURE_SUCCESS(rv, rv);
-      if (StringEndsWith(name, NS_LITERAL_STRING(".oeaccount")))
-        aFileArray.AppendObject(file);
+      if (StringEndsWith(name, u".oeaccount"_ns)) aFileArray.AppendObject(file);
     }
   }
   return NS_OK;
 }
 
 nsresult nsWMUtils::MakeXMLdoc(mozilla::dom::Document** aXmlDoc,
                                nsIFile* aFile) {
   nsresult rv;
--- a/mailnews/intl/nsCharsetConverterManager.cpp
+++ b/mailnews/intl/nsCharsetConverterManager.cpp
@@ -120,18 +120,17 @@ nsCharsetConverterManager::GetCharsetTit
 
   if (!sTitleBundle) {
     nsresult rv =
         LoadBundle("chrome://messenger/locale/charsetTitles.properties",
                    getter_AddRefs(sTitleBundle));
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  return GetBundleValue(sTitleBundle, aCharset, NS_LITERAL_STRING(".title"),
-                        aResult);
+  return GetBundleValue(sTitleBundle, aCharset, u".title"_ns, aResult);
 }
 
 NS_IMETHODIMP
 nsCharsetConverterManager::GetCharsetData(const char* aCharset,
                                           const char16_t* aProp,
                                           nsAString& aResult) {
   return GetCharsetDataImpl(aCharset, aProp, aResult);
 }
--- a/mailnews/jsaccount/src/JaUrl.cpp
+++ b/mailnews/jsaccount/src/JaUrl.cpp
@@ -105,17 +105,17 @@ NS_IMETHODIMP JaBaseCppUrl::GetNormalize
   nsAutoCString spec;
   mailnewsURL->GetSpecIgnoringRef(spec);
 
   nsCString queryPart = MsgExtractQueryPart(spec, "number=");
 
   // Strip any query part beginning with ? or /;
   MsgRemoveQueryPart(spec);
 
-  if (!queryPart.IsEmpty()) spec += NS_LITERAL_CSTRING("?") + queryPart;
+  if (!queryPart.IsEmpty()) spec += "?"_ns + queryPart;
 
   aPrincipalSpec.Assign(spec);
   return NS_OK;
 }
 
 NS_IMETHODIMP JaBaseCppUrl::GetMessageHeader(nsIMsgDBHdr** aMessageHeader) {
   // This routine does a lookup using messenger, assuming that the message URI
   // has been set in mUri.
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -561,17 +561,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Empt
     }
     nsCOMPtr<nsIMsgFolder> parentFolder;
     rv = trashFolder->GetParent(getter_AddRefs(parentFolder));
     if (NS_SUCCEEDED(rv) && parentFolder) {
       nsCOMPtr<nsIDBFolderInfo> transferInfo;
       trashFolder->GetDBTransferInfo(getter_AddRefs(transferInfo));
       trashFolder->SetParent(nullptr);
       parentFolder->PropagateDelete(trashFolder, true, msgWindow);
-      parentFolder->CreateSubfolder(NS_LITERAL_STRING("Trash"), nullptr);
+      parentFolder->CreateSubfolder(u"Trash"_ns, nullptr);
       nsCOMPtr<nsIMsgFolder> newTrashFolder;
       rv = GetTrashFolder(getter_AddRefs(newTrashFolder));
       if (NS_SUCCEEDED(rv) && newTrashFolder) {
         nsCOMPtr<nsIMsgLocalMailFolder> localTrash =
             do_QueryInterface(newTrashFolder);
         newTrashFolder->SetDBTransferInfo(transferInfo);
         if (localTrash) localTrash->RefreshSizeOnDisk();
         // update the summary totals so the front end will
@@ -2042,26 +2042,26 @@ void nsMsgLocalMailFolder::CopyPropertie
 void nsMsgLocalMailFolder::CopyHdrPropertiesWithSkipList(
     nsIMsgDBHdr* destHdr, nsIMsgDBHdr* srcHdr, const nsCString& skipList) {
   nsCOMPtr<nsIUTF8StringEnumerator> propertyEnumerator;
   nsresult rv =
       srcHdr->GetPropertyEnumerator(getter_AddRefs(propertyEnumerator));
   NS_ENSURE_SUCCESS_VOID(rv);
 
   // We'll add spaces at beginning and end so we can search for space-name-space
-  nsCString dontPreserveEx(NS_LITERAL_CSTRING(" "));
+  nsCString dontPreserveEx(" "_ns);
   dontPreserveEx.Append(skipList);
   dontPreserveEx.Append(' ');
 
   nsAutoCString property;
   nsCString sourceString;
   bool hasMore;
   while (NS_SUCCEEDED(propertyEnumerator->HasMore(&hasMore)) && hasMore) {
     propertyEnumerator->GetNext(property);
-    nsAutoCString propertyEx(NS_LITERAL_CSTRING(" "));
+    nsAutoCString propertyEx(" "_ns);
     propertyEx.Append(property);
     propertyEx.Append(' ');
     if (dontPreserveEx.Find(propertyEx) != -1)  // -1 is not found
       continue;
 
     srcHdr->GetStringProperty(property.get(), getter_Copies(sourceString));
     destHdr->SetStringProperty(property.get(), sourceString.get());
   }
@@ -2138,19 +2138,18 @@ nsMsgLocalMailFolder::EndCopy(bool aCopy
   // Copy the header to the new database
   if (mCopyState->m_message) {
     //  CopyMessages() goes here, and CopyFileMessages() with metadata to save;
     nsCOMPtr<nsIMsgDBHdr> newHdr;
     if (!mCopyState->m_parseMsgState) {
       if (mCopyState->m_destDB) {
         if (mCopyState->m_newHdr) {
           newHdr = mCopyState->m_newHdr;
-          CopyHdrPropertiesWithSkipList(
-              newHdr, mCopyState->m_message,
-              NS_LITERAL_CSTRING("storeToken msgOffset"));
+          CopyHdrPropertiesWithSkipList(newHdr, mCopyState->m_message,
+                                        "storeToken msgOffset"_ns);
           //          UpdateNewMsgHdr(mCopyState->m_message, newHdr);
           // We need to copy more than just what UpdateNewMsgHdr does. In fact,
           // I think we want to copy almost every property other than
           // storeToken and msgOffset.
           mCopyState->m_destDB->AddNewHdrToDB(newHdr, true);
         } else {
           rv = mCopyState->m_destDB->CopyHdrFromExistingHdr(
               mCopyState->m_curDstKey, mCopyState->m_message, true,
@@ -2827,45 +2826,40 @@ nsMsgLocalMailFolder::GetIncomingServerT
     if (NS_FAILED(rv)) return rv;
 
     nsCOMPtr<nsIMsgAccountManager> accountManager =
         do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
     if (NS_FAILED(rv)) return rv;
 
     nsCOMPtr<nsIMsgIncomingServer> server;
     // try "none" first
-    rv = NS_MutateURI(url).SetScheme(NS_LITERAL_CSTRING("none")).Finalize(url);
+    rv = NS_MutateURI(url).SetScheme("none"_ns).Finalize(url);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = accountManager->FindServerByURI(url, false, getter_AddRefs(server));
     if (NS_SUCCEEDED(rv) && server)
       mType.AssignLiteral("none");
     else {
       // next try "pop3"
-      rv =
-          NS_MutateURI(url).SetScheme(NS_LITERAL_CSTRING("pop3")).Finalize(url);
+      rv = NS_MutateURI(url).SetScheme("pop3"_ns).Finalize(url);
       NS_ENSURE_SUCCESS(rv, rv);
       rv = accountManager->FindServerByURI(url, false, getter_AddRefs(server));
       if (NS_SUCCEEDED(rv) && server)
         mType.AssignLiteral("pop3");
       else {
         // next try "rss"
-        rv = NS_MutateURI(url)
-                 .SetScheme(NS_LITERAL_CSTRING("rss"))
-                 .Finalize(url);
+        rv = NS_MutateURI(url).SetScheme("rss"_ns).Finalize(url);
         NS_ENSURE_SUCCESS(rv, rv);
         rv =
             accountManager->FindServerByURI(url, false, getter_AddRefs(server));
         if (NS_SUCCEEDED(rv) && server)
           mType.AssignLiteral("rss");
         else {
 #ifdef HAVE_MOVEMAIL
           // next try "movemail"
-          rv = NS_MutateURI(url)
-                   .SetScheme(NS_LITERAL_CSTRING("movemail"))
-                   .Finalize(url);
+          rv = NS_MutateURI(url).SetScheme("movemail"_ns).Finalize(url);
           NS_ENSURE_SUCCESS(rv, rv);
           rv = accountManager->FindServerByURI(url, false,
                                                getter_AddRefs(server));
           if (NS_SUCCEEDED(rv) && server) mType.AssignLiteral("movemail");
 #endif /* HAVE_MOVEMAIL */
         }
       }
     }
@@ -3053,40 +3047,38 @@ nsresult nsMsgLocalMailFolder::DisplayMo
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgLocalMailFolder::SetFlagsOnDefaultMailboxes(uint32_t flags) {
   if (flags & nsMsgFolderFlags::Inbox)
-    setSubfolderFlag(NS_LITERAL_STRING("Inbox"), nsMsgFolderFlags::Inbox);
+    setSubfolderFlag(u"Inbox"_ns, nsMsgFolderFlags::Inbox);
 
   if (flags & nsMsgFolderFlags::SentMail)
-    setSubfolderFlag(NS_LITERAL_STRING("Sent"), nsMsgFolderFlags::SentMail);
+    setSubfolderFlag(u"Sent"_ns, nsMsgFolderFlags::SentMail);
 
   if (flags & nsMsgFolderFlags::Drafts)
-    setSubfolderFlag(NS_LITERAL_STRING("Drafts"), nsMsgFolderFlags::Drafts);
+    setSubfolderFlag(u"Drafts"_ns, nsMsgFolderFlags::Drafts);
 
   if (flags & nsMsgFolderFlags::Templates)
-    setSubfolderFlag(NS_LITERAL_STRING("Templates"),
-                     nsMsgFolderFlags::Templates);
+    setSubfolderFlag(u"Templates"_ns, nsMsgFolderFlags::Templates);
 
   if (flags & nsMsgFolderFlags::Trash)
-    setSubfolderFlag(NS_LITERAL_STRING("Trash"), nsMsgFolderFlags::Trash);
+    setSubfolderFlag(u"Trash"_ns, nsMsgFolderFlags::Trash);
 
   if (flags & nsMsgFolderFlags::Queue)
-    setSubfolderFlag(NS_LITERAL_STRING("Unsent Messages"),
-                     nsMsgFolderFlags::Queue);
+    setSubfolderFlag(u"Unsent Messages"_ns, nsMsgFolderFlags::Queue);
 
   if (flags & nsMsgFolderFlags::Junk)
-    setSubfolderFlag(NS_LITERAL_STRING("Junk"), nsMsgFolderFlags::Junk);
+    setSubfolderFlag(u"Junk"_ns, nsMsgFolderFlags::Junk);
 
   if (flags & nsMsgFolderFlags::Archive)
-    setSubfolderFlag(NS_LITERAL_STRING("Archives"), nsMsgFolderFlags::Archive);
+    setSubfolderFlag(u"Archives"_ns, nsMsgFolderFlags::Archive);
 
   return NS_OK;
 }
 
 nsresult nsMsgLocalMailFolder::setSubfolderFlag(const nsAString& aFolderName,
                                                 uint32_t flags) {
   // FindSubFolder() expects the folder name to be escaped
   // see bug #192043
--- a/mailnews/local/src/nsLocalUtils.cpp
+++ b/mailnews/local/src/nsLocalUtils.cpp
@@ -34,61 +34,59 @@ static nsresult nsGetMailboxServer(const
 
   // retrieve the AccountManager
   nsCOMPtr<nsIMsgAccountManager> accountManager =
       do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   if (NS_FAILED(rv)) return rv;
 
   // find all local mail "no servers" matching the given hostname
   nsCOMPtr<nsIMsgIncomingServer> none_server;
-  rv = NS_MutateURI(url).SetScheme(NS_LITERAL_CSTRING("none")).Finalize(url);
+  rv = NS_MutateURI(url).SetScheme("none"_ns).Finalize(url);
   NS_ENSURE_SUCCESS(rv, rv);
   // No unescaping of username or hostname done here.
   // The unescaping is done inside of FindServerByURI
   rv = accountManager->FindServerByURI(url, false, getter_AddRefs(none_server));
   if (NS_SUCCEEDED(rv)) {
     none_server.forget(aResult);
     return rv;
   }
 
   // if that fails, look for the rss hosts matching the given hostname
   nsCOMPtr<nsIMsgIncomingServer> rss_server;
-  rv = NS_MutateURI(url).SetScheme(NS_LITERAL_CSTRING("rss")).Finalize(url);
+  rv = NS_MutateURI(url).SetScheme("rss"_ns).Finalize(url);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = accountManager->FindServerByURI(url, false, getter_AddRefs(rss_server));
   if (NS_SUCCEEDED(rv)) {
     rss_server.forget(aResult);
     return rv;
   }
 #ifdef HAVE_MOVEMAIL
   // find all movemail "servers" matching the given hostname
   nsCOMPtr<nsIMsgIncomingServer> movemail_server;
-  rv =
-      NS_MutateURI(url).SetScheme(NS_LITERAL_CSTRING("movemail")).Finalize(url);
+  rv = NS_MutateURI(url).SetScheme("movemail"_ns).Finalize(url);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = accountManager->FindServerByURI(url, false,
                                        getter_AddRefs(movemail_server));
   if (NS_SUCCEEDED(rv)) {
     movemail_server.forget(aResult);
     return rv;
   }
 #endif /* HAVE_MOVEMAIL */
 
   // if that fails, look for the pop hosts matching the given hostname
   nsCOMPtr<nsIMsgIncomingServer> server;
   if (NS_FAILED(rv)) {
-    rv = NS_MutateURI(url).SetScheme(NS_LITERAL_CSTRING("pop3")).Finalize(url);
+    rv = NS_MutateURI(url).SetScheme("pop3"_ns).Finalize(url);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = accountManager->FindServerByURI(url, false, getter_AddRefs(server));
 
     // if we can't find a pop server, maybe it's a local message
     // in an imap hierarchy. look for an imap server.
     if (NS_FAILED(rv)) {
-      rv =
-          NS_MutateURI(url).SetScheme(NS_LITERAL_CSTRING("imap")).Finalize(url);
+      rv = NS_MutateURI(url).SetScheme("imap"_ns).Finalize(url);
       NS_ENSURE_SUCCESS(rv, rv);
       rv = accountManager->FindServerByURI(url, false, getter_AddRefs(server));
     }
   }
   if (NS_SUCCEEDED(rv)) {
     server.forget(aResult);
     return rv;
   }
@@ -150,20 +148,19 @@ nsresult nsLocalURI2Path(const char* roo
 
     nsAutoCString newPath("");
 
     // Unescape folder name
     if (curPos) {
       nsCString unescapedStr;
       MsgUnescapeString(nsDependentCString(curPos), 0, unescapedStr);
       NS_MsgCreatePathStringFromFolderURI(unescapedStr.get(), newPath,
-                                          NS_LITERAL_CSTRING("none"));
+                                          "none"_ns);
     } else
-      NS_MsgCreatePathStringFromFolderURI(curPos, newPath,
-                                          NS_LITERAL_CSTRING("none"));
+      NS_MsgCreatePathStringFromFolderURI(curPos, newPath, "none"_ns);
 
     pathResult.Append('/');
     pathResult.Append(newPath);
   }
 
   return NS_OK;
 }
 
--- a/mailnews/local/src/nsMailboxService.cpp
+++ b/mailnews/local/src/nsMailboxService.cpp
@@ -153,17 +153,17 @@ nsresult nsMailboxService::FetchMessage(
     rv = NS_NewURI(getter_AddRefs(fileUri), aMessageURI);
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIFileURL> fileUrl = do_QueryInterface(fileUri, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr<nsIFile> file;
     rv = fileUrl->GetFile(getter_AddRefs(file));
     NS_ENSURE_SUCCESS(rv, rv);
     file->GetFileSize(&fileSize);
-    uriString.Replace(0, 5, NS_LITERAL_CSTRING("mailbox:"));
+    uriString.Replace(0, 5, "mailbox:"_ns);
     uriString.AppendLiteral("&number=0");
     rv = NS_NewURI(getter_AddRefs(url), uriString);
     NS_ENSURE_SUCCESS(rv, rv);
 
     msgUrl = do_QueryInterface(url);
     if (msgUrl) {
       msgUrl->SetMsgWindow(aMsgWindow);
       nsCOMPtr<nsIMailboxUrl> mailboxUrl = do_QueryInterface(msgUrl, &rv);
--- a/mailnews/local/src/nsMailboxUrl.cpp
+++ b/mailnews/local/src/nsMailboxUrl.cpp
@@ -133,22 +133,22 @@ NS_IMETHODIMP nsMailboxUrl::GetNormalize
     nsCString folderPath;
     nsresult rv = nsLocalURI2Path(kMailboxRootURI, spec.get(), folderPath);
     if (NS_SUCCEEDED(rv)) {
       nsAutoCString buf;
       MsgEscapeURL(
           folderPath,
           nsINetUtil::ESCAPE_URL_DIRECTORY | nsINetUtil::ESCAPE_URL_FORCED,
           buf);
-      spec = NS_LITERAL_CSTRING("mailbox://") + buf;
+      spec = "mailbox://"_ns + buf;
     }
   }
 
   if (messageKey) {
-    spec += NS_LITERAL_CSTRING("?number=");
+    spec += "?number="_ns;
     spec.Append(messageKey);
     PR_Free(messageKey);
   }
 
   aPrincipalSpec.Assign(spec);
   return NS_OK;
 }
 
--- a/mailnews/local/src/nsMovemailIncomingServer.cpp
+++ b/mailnews/local/src/nsMovemailIncomingServer.cpp
@@ -83,20 +83,20 @@ nsMovemailIncomingServer::SetFlagsOnDefa
   nsCOMPtr<nsIMsgLocalMailFolder> localFolder =
       do_QueryInterface(rootFolder, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return localFolder->SetFlagsOnDefaultMailboxes(nsMsgFolderFlags::SpecialUse);
 }
 
 NS_IMETHODIMP nsMovemailIncomingServer::CreateDefaultMailboxes() {
-  nsresult rv = CreateLocalFolder(NS_LITERAL_STRING("Inbox"));
+  nsresult rv = CreateLocalFolder(u"Inbox"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return CreateLocalFolder(NS_LITERAL_STRING("Trash"));
+  return CreateLocalFolder(u"Trash"_ns);
 }
 
 NS_IMETHODIMP
 nsMovemailIncomingServer::GetNewMail(nsIMsgWindow* aMsgWindow,
                                      nsIUrlListener* aUrlListener,
                                      nsIMsgFolder* aMsgFolder,
                                      nsIURI** aResult) {
   nsresult rv;
--- a/mailnews/local/src/nsMovemailService.cpp
+++ b/mailnews/local/src/nsMovemailService.cpp
@@ -431,17 +431,17 @@ nsresult nsMovemailService::GetNewMail(
     // If first string is empty and we're now at EOF then abort parsing.
     if (buffer.IsEmpty() && !isMore && !bytesWritten) {
       LOG(("Empty spool file"));
       break;
     }
 
     buffer.AppendLiteral(MSG_LINEBREAK);
 
-    if (isMore && StringBeginsWith(buffer, NS_LITERAL_CSTRING("From "))) {
+    if (isMore && StringBeginsWith(buffer, "From "_ns)) {
       // Finish previous header and message, if any.
       if (newHdr) {
         outputStream->Flush();
         newMailParser->PublishMsgHeader(nullptr);
         rv = msgStore->FinishNewMessage(outputStream, newHdr);
         NS_ENSURE_SUCCESS(rv, rv);
         newMailParser->Clear();
       }
@@ -464,17 +464,17 @@ nsresult nsMovemailService::GetNewMail(
     }
 
     newMailParser->HandleLine(buffer.BeginWriting(), buffer.Length());
     rv = outputStream->Write(buffer.get(), buffer.Length(), &bytesWritten);
     NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && (bytesWritten == buffer.Length()),
                    NS_ERROR_FAILURE);
 
     // "From " lines delimit messages, start a new one here.
-    if (isMore && StringBeginsWith(buffer, NS_LITERAL_CSTRING("From "))) {
+    if (isMore && StringBeginsWith(buffer, "From "_ns)) {
       buffer.AssignLiteral("X-Mozilla-Status: 8000" MSG_LINEBREAK);
       newMailParser->HandleLine(buffer.BeginWriting(), buffer.Length());
       rv = outputStream->Write(buffer.get(), buffer.Length(), &bytesWritten);
       NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && (bytesWritten == buffer.Length()),
                      NS_ERROR_FAILURE);
 
       buffer.AssignLiteral("X-Mozilla-Status2: 00000000" MSG_LINEBREAK);
       newMailParser->HandleLine(buffer.BeginWriting(), buffer.Length());
--- a/mailnews/local/src/nsMsgLocalStoreUtils.cpp
+++ b/mailnews/local/src/nsMsgLocalStoreUtils.cpp
@@ -33,42 +33,42 @@ bool nsMsgLocalStoreUtils::nsShouldIgnor
       name.LowerCaseEqualsLiteral("rules.dat") ||
       name.LowerCaseEqualsLiteral("filterlog.html") ||
       name.LowerCaseEqualsLiteral("junklog.html") ||
       name.LowerCaseEqualsLiteral("rulesbackup.dat"))
     return true;
 
   // don't add summary files to the list of folders;
   // don't add popstate files to the list either, or rules (sort.dat).
-  if (StringEndsWith(name, NS_LITERAL_STRING(".snm")) ||
+  if (StringEndsWith(name, u".snm"_ns) ||
       name.LowerCaseEqualsLiteral("popstate.dat") ||
       name.LowerCaseEqualsLiteral("sort.dat") ||
       name.LowerCaseEqualsLiteral("mailfilt.log") ||
       name.LowerCaseEqualsLiteral("filters.js") ||
-      StringEndsWith(name, NS_LITERAL_STRING(".toc")))
+      StringEndsWith(name, u".toc"_ns))
     return true;
 
   // ignore RSS data source files (see FeedUtils.jsm)
   if (name.LowerCaseEqualsLiteral("feeds.json") ||
       name.LowerCaseEqualsLiteral("feeditems.json") ||
       name.LowerCaseEqualsLiteral("feeds.rdf") ||
       name.LowerCaseEqualsLiteral("feeditems.rdf") ||
-      StringBeginsWith(name, NS_LITERAL_STRING("feeditems_error")))
+      StringBeginsWith(name, u"feeditems_error"_ns))
     return true;
 
   // Ignore hidden and other special system files.
   bool specialFile = false;
   path->IsHidden(&specialFile);
   if (specialFile) return true;
   specialFile = false;
   path->IsSpecial(&specialFile);
   if (specialFile) return true;
 
   // The .mozmsgs dir is for spotlight support
-  return (StringEndsWith(name, NS_LITERAL_STRING(".mozmsgs")) ||
+  return (StringEndsWith(name, u".mozmsgs"_ns) ||
           StringEndsWith(name, NS_LITERAL_STRING(FOLDER_SUFFIX)) ||
           StringEndsWith(name, NS_LITERAL_STRING(SUMMARY_SUFFIX)));
 }
 
 /**
  * We're passed a stream positioned at the start of the message.
  * We start reading lines, looking for x-mozilla-keys: headers; If we're
  * adding the keyword and we find a header with the desired keyword already
--- a/mailnews/local/src/nsMsgMaildirStore.cpp
+++ b/mailnews/local/src/nsMsgMaildirStore.cpp
@@ -165,24 +165,24 @@ nsresult nsMsgMaildirStore::CreateMaildi
   }
 
   // Create tmp, cur leaves
   nsCOMPtr<nsIFile> leaf(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   leaf->InitWithFile(path);
 
-  leaf->AppendNative(NS_LITERAL_CSTRING("tmp"));
+  leaf->AppendNative("tmp"_ns);
   rv = leaf->Create(nsIFile::DIRECTORY_TYPE, 0700);
   if (NS_FAILED(rv) && rv != NS_ERROR_FILE_ALREADY_EXISTS) {
     NS_WARNING("Could not create tmp directory for message folder");
     return rv;
   }
 
-  leaf->SetNativeLeafName(NS_LITERAL_CSTRING("cur"));
+  leaf->SetNativeLeafName("cur"_ns);
   rv = leaf->Create(nsIFile::DIRECTORY_TYPE, 0700);
   if (NS_FAILED(rv) && rv != NS_ERROR_FILE_ALREADY_EXISTS) {
     NS_WARNING("Could not create cur directory for message folder");
     return rv;
   }
 
   return NS_OK;
 }
@@ -283,17 +283,17 @@ NS_IMETHODIMP nsMsgMaildirStore::IsSumma
   nsCOMPtr<nsIDBFolderInfo> dbFolderInfo;
   aDB->GetDBFolderInfo(getter_AddRefs(dbFolderInfo));
   nsresult rv =
       dbFolderInfo->GetBooleanProperty("maildirValid", false, aResult);
   if (!*aResult) {
     nsCOMPtr<nsIFile> newFile;
     rv = aFolder->GetFilePath(getter_AddRefs(newFile));
     NS_ENSURE_SUCCESS(rv, rv);
-    newFile->Append(NS_LITERAL_STRING("cur"));
+    newFile->Append(u"cur"_ns);
 
     // If the "cur" sub-dir doesn't exist, and there are no messages
     // in the db, then the folder is probably new and the db is valid.
     bool exists;
     newFile->Exists(&exists);
     if (!exists) {
       int32_t numMessages;
       dbFolderInfo->GetNumMessages(&numMessages);
@@ -580,17 +580,17 @@ nsMsgMaildirStore::GetNewMsgOutputStream
   // With maildir, messages have whole file to themselves.
   (*aNewMsgHdr)->SetMessageOffset(0);
 
   // We're going to save the new message into the maildir 'tmp' folder.
   // When the message is completed, it can be moved to 'cur'.
   nsCOMPtr<nsIFile> newFile;
   rv = aFolder->GetFilePath(getter_AddRefs(newFile));
   NS_ENSURE_SUCCESS(rv, rv);
-  newFile->Append(NS_LITERAL_STRING("tmp"));
+  newFile->Append(u"tmp"_ns);
 
   // let's check if the folder exists
   // XXX TODO: kill this and make sure maildir creation includes cur/tmp
   bool exists;
   newFile->Exists(&exists);
   if (!exists) {
     MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
             ("GetNewMsgOutputStream - tmp subfolder does not exist!!"));
@@ -630,17 +630,17 @@ nsMsgMaildirStore::DiscardNewMessage(nsI
   nsCOMPtr<nsIFile> path;
   nsCOMPtr<nsIMsgFolder> folder;
   nsresult rv = aNewHdr->GetFolder(getter_AddRefs(folder));
   NS_ENSURE_SUCCESS(rv, rv);
   rv = folder->GetFilePath(getter_AddRefs(path));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // path to the message download folder
-  path->Append(NS_LITERAL_STRING("tmp"));
+  path->Append(u"tmp"_ns);
   path->AppendNative(fileName);
 
   return path->Remove(false);
 }
 
 NS_IMETHODIMP
 nsMsgMaildirStore::FinishNewMessage(nsIOutputStream* aOutputStream,
                                     nsIMsgDBHdr* aNewHdr) {
@@ -663,31 +663,31 @@ nsMsgMaildirStore::FinishNewMessage(nsIO
   if (tmpName.IsEmpty()) {
     NS_ERROR("FinishNewMessage - no storeToken in msg hdr!!");
     return NS_ERROR_FAILURE;
   }
 
   // path to the new destination
   nsCOMPtr<nsIFile> curPath;
   folderPath->Clone(getter_AddRefs(curPath));
-  curPath->Append(NS_LITERAL_STRING("cur"));
+  curPath->Append(u"cur"_ns);
 
   // let's check if the folder exists
   // XXX TODO: kill this and make sure maildir creation includes cur/tmp
   bool exists;
   curPath->Exists(&exists);
   if (!exists) {
     rv = curPath->Create(nsIFile::DIRECTORY_TYPE, 0755);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   // path to the downloaded message
   nsCOMPtr<nsIFile> fromPath;
   folderPath->Clone(getter_AddRefs(fromPath));
-  fromPath->Append(NS_LITERAL_STRING("tmp"));
+  fromPath->Append(u"tmp"_ns);
   fromPath->AppendNative(tmpName);
 
   // Check that the message is still in tmp.
   // XXX TODO: revisit this. I think it's needed because the
   // pairing rules for:
   // GetNewMsgOutputStream(), FinishNewMessage(),
   // MoveNewlyDownloadedMessage() and DiscardNewMessage()
   // are not well defined.
@@ -778,32 +778,32 @@ nsMsgMaildirStore::MoveNewlyDownloadedMe
   if (fileName.IsEmpty()) {
     NS_ERROR("FinishNewMessage - no storeToken in msg hdr!!");
     return NS_ERROR_FAILURE;
   }
 
   // path to the downloaded message
   nsCOMPtr<nsIFile> fromPath;
   folderPath->Clone(getter_AddRefs(fromPath));
-  fromPath->Append(NS_LITERAL_STRING("cur"));
+  fromPath->Append(u"cur"_ns);
   fromPath->AppendNative(fileName);
 
   // let's check if the tmp file exists
   bool exists;
   fromPath->Exists(&exists);
   if (!exists) {
     NS_ERROR("FinishNewMessage - oops! file does not exist!");
     return NS_ERROR_FAILURE;
   }
 
   // move to the "cur" subfolder
   nsCOMPtr<nsIFile> toPath;
   aDestFolder->GetFilePath(getter_AddRefs(folderPath));
   folderPath->Clone(getter_AddRefs(toPath));
-  toPath->Append(NS_LITERAL_STRING("cur"));
+  toPath->Append(u"cur"_ns);
 
   // let's check if the folder exists
   // XXX TODO: kill this and make sure maildir creation includes cur/tmp
   toPath->Exists(&exists);
   if (!exists) {
     rv = toPath->Create(nsIFile::DIRECTORY_TYPE, 0755);
     NS_ENSURE_SUCCESS(rv, rv);
   }
@@ -869,19 +869,18 @@ nsMsgMaildirStore::MoveNewlyDownloadedMe
       do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
   if (notifier) notifier->NotifyMsgAdded(newHdr);
 
   if (movedMsgIsNew) {
     aDestFolder->SetHasNewMessages(true);
 
     // Notify the message was moved.
     if (notifier) {
-      notifier->NotifyItemEvent(
-          folder, NS_LITERAL_CSTRING("UnincorporatedMessageMoved"), newHdr,
-          EmptyCString());
+      notifier->NotifyItemEvent(folder, "UnincorporatedMessageMoved"_ns, newHdr,
+                                EmptyCString());
     }
   }
 
   nsCOMPtr<nsIMsgDatabase> sourceDB;
   rv = folder->GetMsgDatabase(getter_AddRefs(sourceDB));
 
   if (NS_SUCCEEDED(rv) && sourceDB) sourceDB->RemoveHeaderMdbRow(aHdr);
 
@@ -910,17 +909,17 @@ nsMsgMaildirStore::GetMsgInputStream(nsI
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aMsgToken.IsEmpty()) {
     MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
             ("GetMsgInputStream - empty storeToken!!"));
     return NS_ERROR_FAILURE;
   }
 
-  path->Append(NS_LITERAL_STRING("cur"));
+  path->Append(u"cur"_ns);
 
   // let's check if the folder exists
   // XXX TODO: kill this and make sure maildir creation includes cur/tmp
   bool exists;
   path->Exists(&exists);
   if (!exists) {
     MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
             ("GetMsgInputStream - oops! cur subfolder does not exist!"));
@@ -946,17 +945,17 @@ NS_IMETHODIMP nsMsgMaildirStore::DeleteM
 
     if (fileName.IsEmpty()) {
       MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
               ("DeleteMessages - empty storeToken!!"));
       // Perhaps an offline store has not downloaded this particular message.
       continue;
     }
 
-    path->Append(NS_LITERAL_STRING("cur"));
+    path->Append(u"cur"_ns);
     path->AppendNative(fileName);
 
     // Let's check if the message exists.
     bool exists;
     path->Exists(&exists);
     if (!exists) {
       MOZ_LOG(MailDirLog, mozilla::LogLevel::Info,
               ("DeleteMessages - file does not exist !!"));
@@ -1013,22 +1012,22 @@ nsMsgMaildirStore::CopyMessages(bool aIs
 
   // We should be able to use a file move for an efficient copy.
 
   nsCOMPtr<nsIFile> destFolderPath;
   nsCOMPtr<nsIMsgDatabase> destDB;
   aDstFolder->GetMsgDatabase(getter_AddRefs(destDB));
   rv = aDstFolder->GetFilePath(getter_AddRefs(destFolderPath));
   NS_ENSURE_SUCCESS(rv, rv);
-  destFolderPath->Append(NS_LITERAL_STRING("cur"));
+  destFolderPath->Append(u"cur"_ns);
 
   nsCOMPtr<nsIFile> srcFolderPath;
   rv = srcFolder->GetFilePath(getter_AddRefs(srcFolderPath));
   NS_ENSURE_SUCCESS(rv, rv);
-  srcFolderPath->Append(NS_LITERAL_STRING("cur"));
+  srcFolderPath->Append(u"cur"_ns);
 
   nsCOMPtr<nsIMsgDatabase> srcDB;
   srcFolder->GetMsgDatabase(getter_AddRefs(srcDB));
   RefPtr<nsLocalMoveCopyMsgTxn> msgTxn = new nsLocalMoveCopyMsgTxn;
   NS_ENSURE_TRUE(msgTxn, NS_ERROR_OUT_OF_MEMORY);
   if (NS_SUCCEEDED(msgTxn->Init(srcFolder, aDstFolder, aIsMove))) {
     if (aIsMove)
       msgTxn->SetTransactionType(nsIMessenger::eMoveMsg);
@@ -1253,17 +1252,17 @@ NS_IMETHODIMP nsMsgMaildirStore::Rebuild
                                               nsIMsgWindow* aMsgWindow,
                                               nsIUrlListener* aListener) {
   NS_ENSURE_ARG_POINTER(aFolder);
   // This code needs to iterate over the maildir files, and parse each
   // file and add a msg hdr to the db for the file.
   nsCOMPtr<nsIFile> path;
   nsresult rv = aFolder->GetFilePath(getter_AddRefs(path));
   NS_ENSURE_SUCCESS(rv, rv);
-  path->Append(NS_LITERAL_STRING("cur"));
+  path->Append(u"cur"_ns);
 
   nsCOMPtr<nsIDirectoryEnumerator> directoryEnumerator;
   rv = path->GetDirectoryEntries(getter_AddRefs(directoryEnumerator));
   NS_ENSURE_SUCCESS(rv, rv);
 
   MaildirStoreParser* fileParser =
       new MaildirStoreParser(aFolder, aMsgDB, directoryEnumerator, aListener);
   NS_ENSURE_TRUE(fileParser, NS_ERROR_OUT_OF_MEMORY);
@@ -1300,17 +1299,17 @@ nsresult nsMsgMaildirStore::GetOutputStr
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIFile> folderPath;
   rv = folder->GetFilePath(getter_AddRefs(folderPath));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIFile> maildirFile;
   folderPath->Clone(getter_AddRefs(maildirFile));
-  maildirFile->Append(NS_LITERAL_STRING("cur"));
+  maildirFile->Append(u"cur"_ns);
   maildirFile->AppendNative(fileName);
 
   return MsgGetFileStream(maildirFile, getter_AddRefs(aOutputStream));
 }
 
 NS_IMETHODIMP nsMsgMaildirStore::ChangeKeywords(
     const nsTArray<RefPtr<nsIMsgDBHdr>>& aHdrArray, const nsACString& aKeywords,
     bool aAdd) {
--- a/mailnews/local/src/nsNoIncomingServer.cpp
+++ b/mailnews/local/src/nsNoIncomingServer.cpp
@@ -128,28 +128,28 @@ NS_IMETHODIMP nsNoIncomingServer::Create
   nsresult rv;
   bool isHidden = false;
   GetHidden(&isHidden);
   if (isHidden) return NS_OK;
 
   // notice, no Inbox, unless we're deferred to...
   bool isDeferredTo;
   if (NS_SUCCEEDED(GetIsDeferredTo(&isDeferredTo)) && isDeferredTo) {
-    rv = CreateLocalFolder(NS_LITERAL_STRING("Inbox"));
+    rv = CreateLocalFolder(u"Inbox"_ns);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  rv = CreateLocalFolder(NS_LITERAL_STRING("Trash"));
+  rv = CreateLocalFolder(u"Trash"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // copy the default templates into the Templates folder
   rv = CopyDefaultMessages("Templates");
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return CreateLocalFolder(NS_LITERAL_STRING("Unsent Messages"));
+  return CreateLocalFolder(u"Unsent Messages"_ns);
 }
 
 NS_IMETHODIMP
 nsNoIncomingServer::GetNewMail(nsIMsgWindow* aMsgWindow,
                                nsIUrlListener* aUrlListener,
                                nsIMsgFolder* aInbox, nsIURI** aResult) {
   nsTArray<RefPtr<nsIPop3IncomingServer>> deferredServers;
   nsresult rv = GetDeferredServers(this, deferredServers);
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -1062,17 +1062,17 @@ nsresult nsParseMailMessageState::ParseH
                 PR_SUCCESS)
               m_receivedTime = resultTime;
             else
               NS_WARNING("PR_ParseTimeString failed in ParseHeaders().");
           }
         }
         // Someone might want the received header saved.
         if (m_customDBHeaders.Length()) {
-          if (m_customDBHeaders.Contains(NS_LITERAL_CSTRING("received"))) {
+          if (m_customDBHeaders.Contains("received"_ns)) {
             if (!m_receivedValue.IsEmpty()) m_receivedValue.Append(' ');
             m_receivedValue.Append(header->value, header->length);
           }
         }
       }
 
       MOZ_ASSERT(header->value[header->length] == 0,
                  "Non-null-terminated strings cause very, very bad problems");
@@ -1921,18 +1921,17 @@ NS_IMETHODIMP nsParseNewMailState::Apply
                       ("(Local) Target Folder for Move action does not exist"));
               break;
             }
             bool msgMoved = false;
             // If we're moving to an imap folder, or this message has already
             // has a pending copy action, use the imap coalescer so that
             // we won't truncate the inbox before the copy fires.
             if (m_msgCopiedByFilter ||
-                StringBeginsWith(actionTargetFolderUri,
-                                 NS_LITERAL_CSTRING("imap:"))) {
+                StringBeginsWith(actionTargetFolderUri, "imap:"_ns)) {
               if (!m_moveCoalescer)
                 m_moveCoalescer =
                     new nsImapMoveCoalescer(m_downloadFolder, m_msgWindow);
               NS_ENSURE_TRUE(m_moveCoalescer, NS_ERROR_OUT_OF_MEMORY);
               rv = m_moveCoalescer->AddMove(destIFolder, msgKey);
               msgIsNew = false;
               if (NS_FAILED(rv)) break;
             } else {
@@ -1943,19 +1942,18 @@ NS_IMETHODIMP nsParseNewMailState::Apply
                                                           &msgMoved);
               if (NS_SUCCEEDED(rv) && !msgMoved)
                 rv = MoveIncorporatedMessage(msgHdr, m_mailDB, destIFolder,
                                              filter, msgWindow);
               m_msgMovedByFilter = NS_SUCCEEDED(rv);
               if (!m_msgMovedByFilter /* == NS_FAILED(err) */) {
                 // XXX: Invoke MSG_LOG_TO_CONSOLE once bug 1135265 lands.
                 if (loggingEnabled) {
-                  (void)filter->LogRuleHitFail(
-                      filterAction, msgHdr, rv,
-                      NS_LITERAL_CSTRING("filterFailureMoveFailed"));
+                  (void)filter->LogRuleHitFail(filterAction, msgHdr, rv,
+                                               "filterFailureMoveFailed"_ns);
                 }
               }
             }
           } else {
             MOZ_LOG(FILTERLOGMODULE, LogLevel::Warning,
                     ("(Local) Target folder is the same as source folder"));
             rv = NS_OK;
           }
@@ -1988,19 +1986,18 @@ NS_IMETHODIMP nsParseNewMailState::Apply
             if (NS_SUCCEEDED(rv))
               rv = copyService->CopyMessages(m_downloadFolder, messageArray,
                                              dstFolder, false, nullptr,
                                              msgWindow, false);
 
             if (NS_FAILED(rv)) {
               // XXX: Invoke MSG_LOG_TO_CONSOLE once bug 1135265 lands.
               if (loggingEnabled) {
-                (void)filter->LogRuleHitFail(
-                    filterAction, msgHdr, rv,
-                    NS_LITERAL_CSTRING("filterFailureCopyFailed"));
+                (void)filter->LogRuleHitFail(filterAction, msgHdr, rv,
+                                             "filterFailureCopyFailed"_ns);
               }
             } else
               m_msgCopiedByFilter = true;
           } else {
             MOZ_LOG(FILTERLOGMODULE, LogLevel::Warning,
                     ("(Local) Target folder is the same as source folder"));
             break;
           }
@@ -2152,17 +2149,17 @@ NS_IMETHODIMP nsParseNewMailState::Apply
     }
     if (NS_FAILED(rv)) {
       finalResult = rv;
       MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
               ("(Local) Action execution failed with error: %" PRIx32,
                static_cast<uint32_t>(rv)));
       if (loggingEnabled) {
         (void)filter->LogRuleHitFail(filterAction, msgHdr, rv,
-                                     NS_LITERAL_CSTRING("filterFailureAction"));
+                                     "filterFailureAction"_ns);
       }
     } else {
       MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
               ("(Local) Action execution succeeded"));
     }
   }
   if (!msgIsNew) {
     int32_t numNewMessages;
@@ -2238,21 +2235,21 @@ nsresult nsParseNewMailState::ApplyForwa
                                               msgWindow, server);
           if (NS_FAILED(rv)) {
             NS_WARNING("ReplyWithTemplate failed");
             MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
                     ("(Local) Replying failed"));
             if (rv == NS_ERROR_ABORT) {
               (void)m_filter->LogRuleHitFail(
                   m_ruleAction, m_msgToForwardOrReply, rv,
-                  NS_LITERAL_CSTRING("filterFailureSendingReplyAborted"));
+                  "filterFailureSendingReplyAborted"_ns);
             } else {
               (void)m_filter->LogRuleHitFail(
                   m_ruleAction, m_msgToForwardOrReply, rv,
-                  NS_LITERAL_CSTRING("filterFailureSendingReplyError"));
+                  "filterFailureSendingReplyError"_ns);
             }
           }
         }
       }
     }
   }
   m_replyTemplateUri.Clear();
   m_msgToForwardOrReply = nullptr;
@@ -2476,19 +2473,18 @@ nsresult nsParseNewMailState::MoveIncorp
 
   (void)localFolder->RefreshSizeOnDisk();
 
   // Notify the message was moved.
   if (notifier) {
     nsCOMPtr<nsIMsgFolder> folder;
     nsresult rv = mailHdr->GetFolder(getter_AddRefs(folder));
     if (NS_SUCCEEDED(rv)) {
-      notifier->NotifyItemEvent(
-          folder, NS_LITERAL_CSTRING("UnincorporatedMessageMoved"), newHdr,
-          EmptyCString());
+      notifier->NotifyItemEvent(folder, "UnincorporatedMessageMoved"_ns, newHdr,
+                                EmptyCString());
     } else {
       NS_WARNING("Can't get folder for message that was moved.");
     }
   }
 
   nsCOMPtr<nsIMsgPluggableStore> store;
   rv = m_downloadFolder->GetMsgStore(getter_AddRefs(store));
   if (store) store->DiscardNewMessage(m_outputStream, mailHdr);
--- a/mailnews/local/src/nsPop3IncomingServer.cpp
+++ b/mailnews/local/src/nsPop3IncomingServer.cpp
@@ -215,18 +215,17 @@ NS_IMETHODIMP nsPop3IncomingServer::SetD
               if (server) {
                 nsCOMPtr<nsILocalMailIncomingServer> incomingLocalServer =
                     do_QueryInterface(server);
                 if (incomingLocalServer) {
                   nsCOMPtr<nsIMsgFolder> rootFolder;
                   rv = server->GetRootFolder(getter_AddRefs(rootFolder));
                   NS_ENSURE_SUCCESS(rv, rv);
                   // this will fail if it already exists, which is fine.
-                  rootFolder->CreateSubfolder(NS_LITERAL_STRING("Inbox"),
-                                              nullptr);
+                  rootFolder->CreateSubfolder(u"Inbox"_ns, nullptr);
                 }
               }
             }
           }
         }
       }
     }
   }
@@ -379,20 +378,20 @@ nsPop3IncomingServer::SetFlagsOnDefaultM
 
   // pop3 gets an inbox, but no queue (unsent messages)
   localFolder->SetFlagsOnDefaultMailboxes(nsMsgFolderFlags::SpecialUse &
                                           ~nsMsgFolderFlags::Queue);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsPop3IncomingServer::CreateDefaultMailboxes() {
-  nsresult rv = CreateLocalFolder(NS_LITERAL_STRING("Inbox"));
+  nsresult rv = CreateLocalFolder(u"Inbox"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return CreateLocalFolder(NS_LITERAL_STRING("Trash"));
+  return CreateLocalFolder(u"Trash"_ns);
 }
 
 // override this so we can say that deferred accounts can't have messages
 // filed to them, which will remove them as targets of all the move/copy
 // menu items.
 NS_IMETHODIMP
 nsPop3IncomingServer::GetCanFileMessagesOnServer(
     bool* aCanFileMessagesOnServer) {
--- a/mailnews/local/src/nsPop3Protocol.cpp
+++ b/mailnews/local/src/nsPop3Protocol.cpp
@@ -135,17 +135,17 @@ static Pop3UidlHost* net_pop3_load_state
     if (result->hash) PL_HashTableDestroy(result->hash);
     PR_Free(result);
     return nullptr;
   }
 
   nsCOMPtr<nsIFile> popState;
   mailDirectory->Clone(getter_AddRefs(popState));
   if (!popState) return nullptr;
-  popState->AppendNative(NS_LITERAL_CSTRING("popstate.dat"));
+  popState->AppendNative("popstate.dat"_ns);
 
   nsCOMPtr<nsIInputStream> fileStream;
   nsresult rv =
       NS_NewLocalFileInputStream(getter_AddRefs(fileStream), popState);
   // It is OK if the file doesn't exist. No state is stored yet.
   // Return empty list without warning.
   if (rv == NS_ERROR_FILE_NOT_FOUND) return result;
   // Warn for other errors.
@@ -276,17 +276,17 @@ static int net_pop3_delete_old_msgs_mapp
 }
 
 static void net_pop3_write_state(Pop3UidlHost* host, nsIFile* mailDirectory) {
   int32_t len = 0;
   nsCOMPtr<nsIFile> popState;
 
   mailDirectory->Clone(getter_AddRefs(popState));
   if (!popState) return;
-  popState->AppendNative(NS_LITERAL_CSTRING("popstate.dat"));
+  popState->AppendNative("popstate.dat"_ns);
 
   nsCOMPtr<nsIOutputStream> fileOutputStream;
   nsresult rv = MsgNewSafeBufferedFileOutputStream(
       getter_AddRefs(fileOutputStream), popState, -1, 00600);
   if (NS_FAILED(rv)) return;
 
   const char tmpBuffer[] =
       "# POP3 State File" MSG_LINEBREAK
@@ -2172,17 +2172,17 @@ int32_t nsPop3Protocol::SendPassword() {
 
     if (NS_FAILED(rv)) cmd = "*";
   } else if (m_currentAuthMethod == POP3_HAS_AUTH_PLAIN) {
     MOZ_LOG(POP3LOGMODULE, LogLevel::Debug, (POP3LOG("PLAIN login")));
     // workaround for IPswitch's IMail server software
     // this server goes into LOGIN mode even if we send "AUTH PLAIN"
     // "VXNlc" is the beginning of the base64 encoded prompt ("Username:") for
     // LOGIN
-    if (StringBeginsWith(m_commandResponse, NS_LITERAL_CSTRING("VXNlc"))) {
+    if (StringBeginsWith(m_commandResponse, "VXNlc"_ns)) {
       // disable PLAIN and enable LOGIN (in case it's not already enabled)
       ClearCapFlag(POP3_HAS_AUTH_PLAIN);
       SetCapFlag(POP3_HAS_AUTH_LOGIN);
       m_pop3Server->SetPop3CapabilityFlags(m_pop3ConData->capability_flags);
 
       // reenter authentication again at LOGIN response handler
       m_pop3ConData->next_state = POP3_AUTH_LOGIN_RESPONSE;
       m_pop3ConData->pause_for_read = false;
@@ -3029,20 +3029,19 @@ int32_t nsPop3Protocol::SendRetr() {
 
     if (m_pop3ConData->only_uidl) {
       /* Display bytes if we're only downloading one message. */
       PR_ASSERT(!m_pop3ConData->graph_progress_bytes_p);
       UpdateProgressPercent(0, m_totalDownloadSize);
       m_pop3ConData->graph_progress_bytes_p = true;
     } else {
       nsString finalString;
-      mozilla::DebugOnly<nsresult> rv =
-          FormatCounterString(NS_LITERAL_STRING("receivingMessages"),
-                              m_pop3ConData->real_new_counter,
-                              m_pop3ConData->really_new_messages, finalString);
+      mozilla::DebugOnly<nsresult> rv = FormatCounterString(
+          u"receivingMessages"_ns, m_pop3ConData->real_new_counter,
+          m_pop3ConData->really_new_messages, finalString);
       NS_ASSERTION(NS_SUCCEEDED(rv), "couldn't format string");
       if (mProgressEventSink) {
         rv = mProgressEventSink->OnStatus(this, NS_OK, finalString.get());
         NS_ASSERTION(NS_SUCCEEDED(rv), "dropping error result");
       }
     }
 
     status = Pop3SendData(cmd);
@@ -3771,18 +3770,17 @@ nsresult nsPop3Protocol::ProcessProtocol
               show the message there. */
 
             if (m_totalDownloadSize <= 0) {
               UpdateStatus("noNewMessages");
               /* There are no new messages.  */
             } else {
               nsString statusString;
               nsresult rv = FormatCounterString(
-                  NS_LITERAL_STRING("receivedMsgs"),
-                  m_pop3ConData->real_new_counter - 1,
+                  u"receivedMsgs"_ns, m_pop3ConData->real_new_counter - 1,
                   m_pop3ConData->really_new_messages, statusString);
               if (NS_SUCCEEDED(rv)) UpdateStatusWithString(statusString.get());
             }
           }
         }
 
         status = Pop3SendData("QUIT" CRLF);
         m_pop3ConData->next_state = POP3_WAIT_FOR_RESPONSE;
@@ -3820,20 +3818,19 @@ nsresult nsPop3Protocol::ProcessProtocol
         if (m_pop3ConData->msg_closure) {
           m_nsIPop3Sink->IncorporateAbort(m_pop3ConData->only_uidl != nullptr);
           m_pop3ConData->msg_closure = NULL;
           m_nsIPop3Sink->AbortMailDelivery(this);
         }
 
         if (m_pop3ConData->msg_del_started) {
           nsString statusString;
-          nsresult rv = FormatCounterString(NS_LITERAL_STRING("receivedMsgs"),
-                                            m_pop3ConData->real_new_counter - 1,
-                                            m_pop3ConData->really_new_messages,
-                                            statusString);
+          nsresult rv = FormatCounterString(
+              u"receivedMsgs"_ns, m_pop3ConData->real_new_counter - 1,
+              m_pop3ConData->really_new_messages, statusString);
           if (NS_SUCCEEDED(rv)) UpdateStatusWithString(statusString.get());
 
           NS_ASSERTION(!TestFlag(POP3_PASSWORD_FAILED),
                        "POP3_PASSWORD_FAILED set when del_started");
           m_nsIPop3Sink->AbortMailDelivery(this);
         }
         {  // this brace is to avoid compiler error about vars in switch case.
           nsCOMPtr<nsIMsgWindow> msgWindow;
--- a/mailnews/local/src/nsPop3Sink.cpp
+++ b/mailnews/local/src/nsPop3Sink.cpp
@@ -389,18 +389,17 @@ nsPop3Sink::IncorporateBegin(const char*
   if (pPrefBranch) {
     nsCOMPtr<nsIMsgIncomingServer> server;
     m_folder->GetServer(getter_AddRefs(server));
     nsCString plugStoreContract;
     server->GetCharValue("storeContractID", plugStoreContract);
     // Maildir doesn't care about quaranting, but other stores besides berkeley
     // mailbox might. We should probably make this an attribute on the pluggable
     // store, though.
-    if (plugStoreContract.Equals(
-            NS_LITERAL_CSTRING("@mozilla.org/msgstore/berkeleystore;1")))
+    if (plugStoreContract.Equals("@mozilla.org/msgstore/berkeleystore;1"_ns))
       pPrefBranch->GetBoolPref("mailnews.downloadToTempFile",
                                &m_downloadingToTempFile);
   }
 
   nsCOMPtr<nsIMsgDBHdr> newHdr;
 
   nsCOMPtr<nsIMsgIncomingServer> server = do_QueryInterface(m_popServer);
   if (!server) return NS_ERROR_UNEXPECTED;
@@ -519,18 +518,17 @@ nsPop3Sink::IncorporateBegin(const char*
 
   // WriteLineToMailbox("X-Mozilla-Status: 8000" MSG_LINEBREAK);
   char* statusLine = PR_smprintf(X_MOZILLA_STATUS_FORMAT MSG_LINEBREAK, flags);
   outputString.Assign(statusLine);
   rv = WriteLineToMailbox(outputString);
   PR_smprintf_free(statusLine);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = WriteLineToMailbox(
-      NS_LITERAL_CSTRING("X-Mozilla-Status2: 00000000" MSG_LINEBREAK));
+  rv = WriteLineToMailbox("X-Mozilla-Status2: 00000000"_ns MSG_LINEBREAK);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // leave space for 60 bytes worth of keys/tags
   rv = WriteLineToMailbox(NS_LITERAL_CSTRING(X_MOZILLA_KEYWORDS));
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -635,19 +633,18 @@ nsresult nsPop3Sink::WriteLineToMailbox(
                "seekableOutStream->Tell(&after_seek_pos) failed");
 
     if (NS_SUCCEEDED(rv2) && NS_SUCCEEDED(rv3)) {
       if (before_seek_pos != after_seek_pos) {
         nsString folderName;
         if (m_folder) m_folder->GetPrettyName(folderName);
         // This merits a console message, it's poor man's telemetry.
         MsgLogToConsole4(
-            NS_LITERAL_STRING("Unexpected file position change detected") +
-                (folderName.IsEmpty() ? EmptyString()
-                                      : NS_LITERAL_STRING(" in folder ")) +
+            u"Unexpected file position change detected"_ns +
+                (folderName.IsEmpty() ? EmptyString() : u" in folder "_ns) +
                 (folderName.IsEmpty() ? EmptyString() : folderName) +
                 NS_LITERAL_STRING(
                     ". "
                     "If you can reliably reproduce this, please report the "
                     "steps you used to dev-apps-thunderbird@lists.mozilla.org "
                     "or to bug 1308335 at bugzilla.mozilla.org. "
                     "Resolving this problem will allow speeding up message "
                     "downloads."),
--- a/mailnews/local/src/nsRssIncomingServer.cpp
+++ b/mailnews/local/src/nsRssIncomingServer.cpp
@@ -61,26 +61,26 @@ nsresult nsRssIncomingServer::FillInData
   // Append the name of the subscriptions data source.
   rv = localFile->Append(aDataSourceName);
   localFile.forget(aLocation);
   return rv;
 }
 
 // nsIRSSIncomingServer methods
 NS_IMETHODIMP nsRssIncomingServer::GetSubscriptionsPath(nsIFile** aLocation) {
-  return FillInDataSourcePath(NS_LITERAL_STRING("feeds.json"), aLocation);
+  return FillInDataSourcePath(u"feeds.json"_ns, aLocation);
 }
 
 NS_IMETHODIMP nsRssIncomingServer::GetFeedItemsPath(nsIFile** aLocation) {
-  return FillInDataSourcePath(NS_LITERAL_STRING("feeditems.json"), aLocation);
+  return FillInDataSourcePath(u"feeditems.json"_ns, aLocation);
 }
 
 NS_IMETHODIMP nsRssIncomingServer::CreateDefaultMailboxes() {
   // For Feeds, all we have is Trash.
-  return CreateLocalFolder(NS_LITERAL_STRING("Trash"));
+  return CreateLocalFolder(u"Trash"_ns);
 }
 
 NS_IMETHODIMP nsRssIncomingServer::SetFlagsOnDefaultMailboxes() {
   nsCOMPtr<nsIMsgFolder> rootFolder;
   nsresult rv = GetRootFolder(getter_AddRefs(rootFolder));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgLocalMailFolder> localFolder =
--- a/mailnews/mapi/mapihook/src/msgMapiHook.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiHook.cpp
@@ -381,17 +381,17 @@ nsresult nsMapiHook::HandleAttachments(n
         return NS_ERROR_FILE_TARGET_DOES_NOT_EXIST;
 
       // Temp Directory
       nsCOMPtr<nsIFile> pTempDir;
       NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(pTempDir));
 
       // create a new sub directory called moz_mapi underneath the temp
       // directory
-      pTempDir->AppendRelativePath(NS_LITERAL_STRING("moz_mapi"));
+      pTempDir->AppendRelativePath(u"moz_mapi"_ns);
       pTempDir->Exists(&bExist);
       if (!bExist) {
         rv = pTempDir->Create(nsIFile::DIRECTORY_TYPE, 777);
         if (NS_FAILED(rv)) return rv;
       }
 
       // rename or copy the existing temp file with the real file name
 
@@ -496,17 +496,17 @@ nsresult nsMapiHook::HandleAttachmentsW(
         return NS_ERROR_FILE_TARGET_DOES_NOT_EXIST;
 
       // Temp Directory.
       nsCOMPtr<nsIFile> pTempDir;
       NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(pTempDir));
 
       // Create a new sub directory called moz_mapi underneath the temp
       // directory.
-      pTempDir->AppendRelativePath(NS_LITERAL_STRING("moz_mapi"));
+      pTempDir->AppendRelativePath(u"moz_mapi"_ns);
       pTempDir->Exists(&bExist);
       if (!bExist) {
         rv = pTempDir->Create(nsIFile::DIRECTORY_TYPE, 777);
         if (NS_FAILED(rv)) return rv;
       }
 
       // Rename or copy the existing temp file with the real file name.
 
@@ -805,17 +805,17 @@ nsresult nsMapiHook::PopulateCompFieldsF
     char* newFilePaths = (char*)strFilePaths.get();
     while (offset != kNotFound) {
       // Temp Directory
       nsCOMPtr<nsIFile> pTempDir;
       NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(pTempDir));
 
       // if not already existing, create another temp dir for mapi within Win
       // temp dir this is windows only so we can do "\\"
-      pTempDir->AppendRelativePath(NS_LITERAL_STRING("moz_mapi"));
+      pTempDir->AppendRelativePath(u"moz_mapi"_ns);
       pTempDir->Exists(&bExist);
       if (!bExist) {
         rv = pTempDir->Create(nsIFile::DIRECTORY_TYPE, 777);
         if (NS_FAILED(rv)) return rv;
       }
 
       nsAutoCString RemainingPaths;
       RemainingPaths.Assign(newFilePaths);
--- a/mailnews/mime/emitters/nsMimeBaseEmitter.cpp
+++ b/mailnews/mime/emitters/nsMimeBaseEmitter.cpp
@@ -515,17 +515,17 @@ nsMimeBaseEmitter::UpdateCharacterSet(co
 
           ++ptr;
         }
       }
 
       // have to set content-type since it could have an embedded null byte
       mChannel->SetContentType(nsDependentCString(cBegin));
       if (PL_strcasecmp(aCharset, "US-ASCII") == 0) {
-        mChannel->SetContentCharset(NS_LITERAL_CSTRING("ISO-8859-1"));
+        mChannel->SetContentCharset("ISO-8859-1"_ns);
       } else {
         mChannel->SetContentCharset(nsDependentCString(aCharset));
       }
     }
   }
 
   return NS_OK;
 }
--- a/mailnews/mime/src/mimeTextHTMLParsed.cpp
+++ b/mailnews/mime/src/mimeTextHTMLParsed.cpp
@@ -88,17 +88,17 @@ static int MimeInlineTextHTMLParsed_pars
       rawHTML, mozilla::dom::SupportedType::Text_html, rv2);
   if (rv2.Failed()) return -1;
 
   // Serialize it back to HTML source again.
   nsCOMPtr<nsIDocumentEncoder> encoder = do_createDocumentEncoder("text/html");
   NS_ENSURE_TRUE(encoder, -1);
   uint32_t aFlags = nsIDocumentEncoder::OutputRaw |
                     nsIDocumentEncoder::OutputDisallowLineBreaking;
-  rv = encoder->Init(document, NS_LITERAL_STRING("text/html"), aFlags);
+  rv = encoder->Init(document, u"text/html"_ns, aFlags);
   NS_ENSURE_SUCCESS(rv, -1);
   rv = encoder->EncodeToString(parsed);
   NS_ENSURE_SUCCESS(rv, -1);
 
   bool stripConditionalCSS = mozilla::Preferences::GetBool(
       "mail.html_sanitize.drop_conditional_css", true);
 
   nsCString resultCStr;
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -179,18 +179,18 @@ nsresult CreateComposeParams(nsCOMPtr<ns
 
     while (curAttachment && curAttachment->m_url) {
       rv = curAttachment->m_url->GetSpec(spec);
       if (NS_SUCCEEDED(rv)) {
         nsCOMPtr<nsIMsgAttachment> attachment =
             do_CreateInstance(NS_MSGATTACHMENT_CONTRACTID, &rv);
         if (NS_SUCCEEDED(rv) && attachment) {
           nsAutoString nameStr;
-          rv = nsMsgI18NConvertToUnicode(NS_LITERAL_CSTRING("UTF-8"),
-                                         curAttachment->m_realName, nameStr);
+          rv = nsMsgI18NConvertToUnicode("UTF-8"_ns, curAttachment->m_realName,
+                                         nameStr);
           if (NS_FAILED(rv))
             CopyASCIItoUTF16(curAttachment->m_realName, nameStr);
           attachment->SetName(nameStr);
           attachment->SetUrl(spec);
           attachment->SetTemporary(true);
           attachment->SetContentType(curAttachment->m_realType.get());
           attachment->SetMacType(curAttachment->m_xMacType.get());
           attachment->SetMacCreator(curAttachment->m_xMacCreator.get());
--- a/mailnews/mime/src/mimeebod.cpp
+++ b/mailnews/mime/src/mimeebod.cpp
@@ -150,17 +150,17 @@ char* MimeExternalBody_make_url(const ch
     if (!name) return 0;
 
 #ifdef XP_UNIX
     if (!PL_strcasecmp(at, "afs")) /* only if there is a /afs/ directory */
     {
       nsCOMPtr<nsIFile> fs = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
       bool exists = false;
       if (fs) {
-        fs->InitWithNativePath(NS_LITERAL_CSTRING("/afs/."));
+        fs->InitWithNativePath("/afs/."_ns);
         fs->Exists(&exists);
       }
       if (!exists) return 0;
     }
 #else  /* !XP_UNIX */
     return 0; /* never, if not Unix. */
 #endif /* !XP_UNIX */
 
@@ -421,17 +421,17 @@ static bool MimeExternalBody_displayable
            !PL_strcasecmp(at, "mail-server") || !PL_strcasecmp(at, "url"))
     inline_p = true;
 #ifdef XP_UNIX
   else if (!PL_strcasecmp(at, "afs")) /* only if there is a /afs/ directory */
   {
     nsCOMPtr<nsIFile> fs = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
     bool exists = false;
     if (fs) {
-      fs->InitWithNativePath(NS_LITERAL_CSTRING("/afs/."));
+      fs->InitWithNativePath("/afs/."_ns);
       fs->Exists(&exists);
     }
     if (!exists) return 0;
 
     inline_p = true;
   }
 #endif /* XP_UNIX */
 
--- a/mailnews/mime/src/mimemoz2.cpp
+++ b/mailnews/mime/src/mimemoz2.cpp
@@ -132,17 +132,17 @@ nsresult ProcessBodyAsAttachment(MimeObj
       // generic name.
       tmp->m_realName = "AttachedMessage.eml";
     }
   }
 
   tmp->m_hasFilename = !tmp->m_realName.IsEmpty();
 
   if (tmp->m_realName.IsEmpty() &&
-      StringBeginsWith(tmp->m_realType, NS_LITERAL_CSTRING("text"),
+      StringBeginsWith(tmp->m_realType, "text"_ns,
                        nsCaseInsensitiveCStringComparator))
     ValidateRealName(tmp, child->headers);
 
   tmp->m_displayableInline =
       obj->clazz->displayable_inline_p(obj->clazz, obj->headers);
 
   char* tmpURL = nullptr;
   char* id = nullptr;
@@ -212,17 +212,17 @@ void ValidateRealName(nsMsgAttachmentDat
   // Sanity.
   if (!aAttach) return;
 
   // Do we need to validate?
   if (!aAttach->m_realName.IsEmpty()) return;
 
   // Internal MIME structures need not be named!
   if (aAttach->m_realType.IsEmpty() ||
-      StringBeginsWith(aAttach->m_realType, NS_LITERAL_CSTRING("multipart"),
+      StringBeginsWith(aAttach->m_realType, "multipart"_ns,
                        nsCaseInsensitiveCStringComparator))
     return;
 
   //
   // Now validate any other name we have for the attachment!
   //
   if (aAttach->m_realName.IsEmpty()) {
     aAttach->m_realName = "attachment";
@@ -295,17 +295,17 @@ nsresult GenerateAttachmentData(MimeObje
 
   nsMsgAttachmentData* tmp = &(aAttachData[attIndex++]);
 
   tmp->m_realType = object->content_type;
   tmp->m_realEncoding = object->encoding;
   tmp->m_isExternalAttachment = isExternalAttachment;
   tmp->m_isExternalLinkAttachment =
       (isExternalAttachment &&
-       StringBeginsWith(urlString, NS_LITERAL_CSTRING("http"),
+       StringBeginsWith(urlString, "http"_ns,
                         nsCaseInsensitiveCStringComparator));
   tmp->m_size = attSize;
   tmp->m_sizeExternalStr = "-1";
   tmp->m_disposition.Adopt(MimeHeaders_get(
       object->headers, HEADER_CONTENT_DISPOSITION, true, false));
   tmp->m_displayableInline =
       object->clazz->displayable_inline_p(object->clazz, object->headers);
 
@@ -423,17 +423,17 @@ nsresult GenerateAttachmentData(MimeObje
     urlString.AppendLiteral("&filename=");
     nsAutoCString aResult;
     if (NS_SUCCEEDED(MsgEscapeString(tmp->m_realName,
                                      nsINetUtil::ESCAPE_XALPHAS, aResult)))
       urlString.Append(aResult);
     else
       urlString.Append(tmp->m_realName);
     if (tmp->m_realType.EqualsLiteral("message/rfc822") &&
-        !StringEndsWith(urlString, NS_LITERAL_CSTRING(".eml"),
+        !StringEndsWith(urlString, ".eml"_ns,
                         nsCaseInsensitiveCStringComparator))
       urlString.AppendLiteral(".eml");
   } else if (tmp->m_isExternalAttachment) {
     // Allows the JS mime emitter to figure out the part information.
     urlString.AppendLiteral("?part=");
     urlString.Append(part);
   } else if (tmp->m_realType.LowerCaseEqualsLiteral(MESSAGE_RFC822)) {
     // Special case...if this is a enclosed RFC822 message, give it a nice
@@ -703,18 +703,17 @@ extern "C" nsresult SetMailCharacterSetT
         if (uri) {
           nsCOMPtr<nsIMsgMailNewsUrl> msgurl(do_QueryInterface(uri));
           if (msgurl) {
             nsCOMPtr<nsIMsgWindow> msgWindow;
             msgurl->GetMsgWindow(getter_AddRefs(msgWindow));
             if (msgWindow)
               rv = msgWindow->SetMailCharacterSet(
                   !PL_strcasecmp(aCharacterSet, "us-ascii")
-                      ? static_cast<const nsCString&>(
-                            NS_LITERAL_CSTRING("ISO-8859-1"))
+                      ? static_cast<const nsCString&>("ISO-8859-1"_ns)
                       : static_cast<const nsCString&>(
                             nsDependentCString(aCharacterSet)));
           }
         }
       }
     }
   }
 
--- a/mailnews/mime/src/mimemult.cpp
+++ b/mailnews/mime/src/mimemult.cpp
@@ -219,52 +219,52 @@ static int MimeMultipart_parse_line(cons
 
             nsAutoCString fileName;
             fileName.Adopt(MimeHeaders_get_name(mult->hdrs, obj->options));
             // clang-format off
             if (detachingPart) {
               char *contentType =
                   MimeHeaders_get(mult->hdrs, "Content-Type", false, false);
               if (contentType) {
-                MimeWriteAString(obj, NS_LITERAL_CSTRING("Content-Type: "));
+                MimeWriteAString(obj, "Content-Type: "_ns);
                 MimeWriteAString(obj, nsDependentCString(contentType));
                 PR_Free(contentType);
               }
               MimeWriteAString(obj, NS_LITERAL_CSTRING(MSG_LINEBREAK));
-              MimeWriteAString(obj, NS_LITERAL_CSTRING("Content-Disposition: attachment; filename=\""));
+              MimeWriteAString(obj, "Content-Disposition: attachment; filename=\""_ns);
               MimeWriteAString(obj, fileName);
-              MimeWriteAString(obj, NS_LITERAL_CSTRING("\"" MSG_LINEBREAK));
-              MimeWriteAString(obj, NS_LITERAL_CSTRING("X-Mozilla-External-Attachment-URL: "));
+              MimeWriteAString(obj, "\""_ns MSG_LINEBREAK);
+              MimeWriteAString(obj, "X-Mozilla-External-Attachment-URL: "_ns);
               MimeWriteAString(obj, obj->options->state->detachedFilePath);
               MimeWriteAString(obj, NS_LITERAL_CSTRING(MSG_LINEBREAK));
-              MimeWriteAString(obj, NS_LITERAL_CSTRING("X-Mozilla-Altered: AttachmentDetached; date=\""));
+              MimeWriteAString(obj, "X-Mozilla-Altered: AttachmentDetached; date=\""_ns);
             } else {
               nsAutoCString header("Content-Type: text/x-moz-deleted; name=\"Deleted: ");
               header.Append(fileName);
               status = MimeWriteAString(obj, header);
               if (status < 0) return status;
-              status = MimeWriteAString(obj, NS_LITERAL_CSTRING("\"" MSG_LINEBREAK
-                                                 "Content-Transfer-Encoding: 8bit" MSG_LINEBREAK));
+              status = MimeWriteAString(obj, "\""_ns MSG_LINEBREAK
+                                                 "Content-Transfer-Encoding: 8bit"_ns MSG_LINEBREAK);
               MimeWriteAString(obj, NS_LITERAL_CSTRING(
                                         "Content-Disposition: inline; filename=\"Deleted: "));
               MimeWriteAString(obj, fileName);
-              MimeWriteAString(obj, NS_LITERAL_CSTRING("\"" MSG_LINEBREAK
-                                        "X-Mozilla-Altered: AttachmentDeleted; date=\""));
+              MimeWriteAString(obj, "\""_ns MSG_LINEBREAK
+                                        "X-Mozilla-Altered: AttachmentDeleted; date=\""_ns);
             }
             nsCString result;
             char timeBuffer[128];
             PRExplodedTime now;
             PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &now);
             PR_FormatTimeUSEnglish(timeBuffer, sizeof(timeBuffer),
                                    "%a %b %d %H:%M:%S %Y", &now);
             MimeWriteAString(obj, nsDependentCString(timeBuffer));
-            MimeWriteAString(obj, NS_LITERAL_CSTRING("\"" MSG_LINEBREAK));
-            MimeWriteAString(obj, NS_LITERAL_CSTRING(MSG_LINEBREAK
-                                      "You deleted an attachment from this message. The original "
-                                      "MIME headers for the attachment were:" MSG_LINEBREAK));
+            MimeWriteAString(obj, "\""_ns MSG_LINEBREAK);
+            MimeWriteAString(obj, MSG_LINEBREAK
+                                      "You deleted an attachment from this message. The original "_ns
+                                      "MIME headers for the attachment were:"_ns MSG_LINEBREAK);
             MimeHeaders_write_raw_headers(mult->hdrs, obj->options, false);
             // clang-format on
           }
           int32_t old_nchildren = container->nchildren;
           status = ((MimeMultipartClass*)obj->clazz)->create_child(obj);
           if (status < 0) return status;
           NS_ASSERTION(mult->state != MimeMultipartHeaders,
                        "mult->state shouldn't be MimeMultipartHeaders");
--- a/mailnews/mime/src/mimethtm.cpp
+++ b/mailnews/mime/src/mimethtm.cpp
@@ -177,25 +177,24 @@ void MimeInlineTextHTML_insert_lang_div(
   // 1) Users can configure their HTML display via CSS for .moz-text-html.
   // 2) The language group in the 'lang' attribure is used by Gecko to determine
   //    which font to use.
   int32_t fontSize;            // default font size
   int32_t fontSizePercentage;  // size percentage
   nsAutoCString fontLang;      // langgroup of the font.
   if (NS_SUCCEEDED(GetMailNewsFont(obj, false, &fontSize, &fontSizePercentage,
                                    fontLang))) {
-    message.Insert(NS_LITERAL_CSTRING("<div class=\"moz-text-html\" lang=\"") +
-                       fontLang + NS_LITERAL_CSTRING("\">"),
-                   index);
+    message.Insert(
+        "<div class=\"moz-text-html\" lang=\""_ns + fontLang + "\">"_ns, index);
   } else {
-    message.Insert(NS_LITERAL_CSTRING("<div class=\"moz-text-html\">"), index);
+    message.Insert("<div class=\"moz-text-html\">"_ns, index);
   }
 
   index = message.RFind("</body>", /* ignoreCase = */ true);
-  if (index != kNotFound) message.Insert(NS_LITERAL_CSTRING("</div>"), index);
+  if (index != kNotFound) message.Insert("</div>"_ns, index);
 }
 
 /*
  * The following function replaces <plaintext> tags with <x-plaintext>.
  * <plaintext> is a funny beast: It leads to everything following it
  * being displayed verbatim, even a </plaintext> tag is ignored.
  */
 void MimeInlineTextHTML_remove_plaintext_tag(MimeObject* obj,
--- a/mailnews/news/src/nsNNTPNewsgroupList.cpp
+++ b/mailnews/news/src/nsNNTPNewsgroupList.cpp
@@ -212,20 +212,19 @@ static nsresult openWindow(nsIMsgWindow*
   nsCOMPtr<nsISupportsInterfacePointer> ifptr =
       do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   ifptr->SetData(param);
   ifptr->SetDataIID(&NS_GET_IID(nsINewsDownloadDialogArgs));
 
   RefPtr<mozilla::dom::BrowsingContext> dialogWindow;
-  rv = parentWindow->OpenDialog(
-      NS_ConvertASCIItoUTF16(chromeURL), NS_LITERAL_STRING("_blank"),
-      NS_LITERAL_STRING("centerscreen,chrome,modal,titlebar"), ifptr,
-      getter_AddRefs(dialogWindow));
+  rv = parentWindow->OpenDialog(NS_ConvertASCIItoUTF16(chromeURL), u"_blank"_ns,
+                                u"centerscreen,chrome,modal,titlebar"_ns, ifptr,
+                                getter_AddRefs(dialogWindow));
 
   return rv;
 }
 
 nsresult nsNNTPNewsgroupList::GetRangeOfArtsToDownload(
     nsIMsgWindow* aMsgWindow, int32_t first_possible, int32_t last_possible,
     int32_t maxextra, int32_t* first, int32_t* last, int32_t* status) {
   nsresult rv = NS_OK;
@@ -697,17 +696,17 @@ NS_IMETHODIMP nsNNTPNewsgroupList::Apply
 
     if (NS_FAILED(rv)) {
       finalResult = rv;
       MOZ_LOG(FILTERLOGMODULE, LogLevel::Error,
               ("(News) Action execution failed with error: %" PRIx32,
                static_cast<uint32_t>(rv)));
       if (loggingEnabled) {
         (void)aFilter->LogRuleHitFail(filterAction, m_newMsgHdr, rv,
-                                      NS_LITERAL_CSTRING("filterActionFailed"));
+                                      "filterActionFailed"_ns);
       }
     } else {
       MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
               ("(News) Action execution succeeded"));
     }
   }
   MOZ_LOG(FILTERLOGMODULE, LogLevel::Info,
           ("(News) Finished executing actions"));
--- a/mailnews/news/src/nsNNTPProtocol.cpp
+++ b/mailnews/news/src/nsNNTPProtocol.cpp
@@ -1811,17 +1811,17 @@ nsresult nsNNTPProtocol::SendFirstNNTPCo
       m_nextState = NNTP_ERROR;
     // if we have no channel listener, then we're likely downloading
     // the message for offline use (or at least not displaying it)
     bool savingArticleOffline = (m_channelListener == nullptr);
 
     if (m_runningURL) FinishMemCacheEntry(false);  // cleanup mem cache entry
 
     if (NS_SUCCEEDED(rv) && !group_name.IsEmpty() && !savingArticleOffline) {
-      nsCString uri(NS_LITERAL_CSTRING("about:newserror?r="));
+      nsCString uri("about:newserror?r="_ns);
       nsCString escapedResponse;
       MsgEscapeURL(nsDependentCString(m_responseText),
                    nsINetUtil::ESCAPE_URL_QUERY, escapedResponse);
       uri.Append(escapedResponse);
 
       if ((m_key != nsMsgKey_None) && m_newsFolder) {
         nsCString messageID;
         nsCString escapedMessageID;
@@ -3141,17 +3141,17 @@ nsresult nsNNTPProtocol::ReadNewsgroupBo
   rv = m_newsgroupList->ProcessHEADLine(safe_line);
   PR_Free(lineToFree);
   return rv;
 }
 
 nsresult nsNNTPProtocol::GetNewsStringByID(int32_t stringID,
                                            char16_t** aString) {
   nsresult rv;
-  nsAutoString resultString(NS_LITERAL_STRING("???"));
+  nsAutoString resultString(u"???"_ns);
 
   if (!m_stringBundle) {
     nsCOMPtr<nsIStringBundleService> bundleService =
         mozilla::services::GetStringBundleService();
     NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
 
     rv = bundleService->CreateBundle(NEWS_MSGS_URL,
                                      getter_AddRefs(m_stringBundle));
@@ -3175,17 +3175,17 @@ nsresult nsNNTPProtocol::GetNewsStringBy
     *aString = ToNewUnicode(resultString);
   }
   return rv;
 }
 
 nsresult nsNNTPProtocol::GetNewsStringByName(const char* aName,
                                              char16_t** aString) {
   nsresult rv;
-  nsAutoString resultString(NS_LITERAL_STRING("???"));
+  nsAutoString resultString(u"???"_ns);
   if (!m_stringBundle) {
     nsCOMPtr<nsIStringBundleService> bundleService =
         mozilla::services::GetStringBundleService();
     NS_ENSURE_TRUE(bundleService, NS_ERROR_UNEXPECTED);
 
     rv = bundleService->CreateBundle(NEWS_MSGS_URL,
                                      getter_AddRefs(m_stringBundle));
     NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/news/src/nsNntpIncomingServer.cpp
+++ b/mailnews/news/src/nsNntpIncomingServer.cpp
@@ -265,18 +265,18 @@ nsNntpIncomingServer::GetCharset(nsACStr
   nsresult rv = GetCharValue("charset", aCharset);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // if the per-server setting is empty,we get the default charset from
   // mailnews.view_default_charset setting and set it as per-server preference.
   if (aCharset.IsEmpty()) {
     nsString defaultCharset;
     rv = NS_GetLocalizedUnicharPreferenceWithDefault(
-        nullptr, PREF_MAILNEWS_VIEW_DEFAULT_CHARSET,
-        NS_LITERAL_STRING("ISO-8859-1"), defaultCharset);
+        nullptr, PREF_MAILNEWS_VIEW_DEFAULT_CHARSET, u"ISO-8859-1"_ns,
+        defaultCharset);
     NS_ENSURE_SUCCESS(rv, rv);
     LossyCopyUTF16toASCII(defaultCharset, aCharset);
     SetCharset(aCharset);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -1732,17 +1732,17 @@ nsNntpIncomingServer::SetTree(mozilla::d
 
   RefPtr<nsTreeColumn> col = cols->GetKeyColumn();
   if (!col) return NS_OK;
 
   RefPtr<mozilla::dom::Element> element = col->Element();
   if (!element) return NS_OK;
 
   nsAutoString dir;
-  element->GetAttribute(NS_LITERAL_STRING("sortDirection"), dir);
+  element->GetAttribute(u"sortDirection"_ns, dir);
   mSearchResultSortDescending = dir.EqualsLiteral("descending");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::ToggleOpenState(int32_t index) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
@@ -1752,21 +1752,19 @@ nsNntpIncomingServer::CycleHeader(nsTree
   NS_ENSURE_ARG_POINTER(col);
 
   bool cycler = col->Cycler();
   if (!cycler) {
     constexpr auto dir = u"sortDirection"_ns;
     RefPtr<mozilla::dom::Element> element = col->Element();
     mSearchResultSortDescending = !mSearchResultSortDescending;
     mozilla::IgnoredErrorResult rv2;
-    element->SetAttribute(dir,
-                          mSearchResultSortDescending
-                              ? NS_LITERAL_STRING("descending")
-                              : NS_LITERAL_STRING("ascending"),
-                          rv2);
+    element->SetAttribute(
+        dir, mSearchResultSortDescending ? u"descending"_ns : u"ascending"_ns,
+        rv2);
     mTree->Invalidate();
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNntpIncomingServer::SelectionChangedXPCOM() {
   return NS_ERROR_NOT_IMPLEMENTED;
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -773,18 +773,18 @@ nsresult nsNntpService::GetNntpServerByA
     rv = accountManager->GetAccount(nsDependentCString(aAccountKey),
                                     getter_AddRefs(account));
     if (NS_SUCCEEDED(rv) && account)
       rv = account->GetIncomingServer(aNntpServer);
   }
 
   // if we don't have a news host, find the first news server and use it
   if (NS_FAILED(rv) || !*aNntpServer)
-    rv = accountManager->FindServer(EmptyCString(), EmptyCString(),
-                                    NS_LITERAL_CSTRING("nntp"), aNntpServer);
+    rv = accountManager->FindServer(EmptyCString(), EmptyCString(), "nntp"_ns,
+                                    aNntpServer);
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsNntpService::PostMessage(nsIFile* aFileToPost, const char* newsgroupsNames,
                            const char* aAccountKey,
                            nsIUrlListener* aUrlListener,
@@ -877,18 +877,17 @@ nsresult nsNntpService::CreateNewsAccoun
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgAccount> account;
   rv = accountManager->CreateAccount(getter_AddRefs(account));
   if (NS_FAILED(rv)) return rv;
 
   // for news, username is always null
   rv = accountManager->CreateIncomingServer(
-      EmptyCString(), nsDependentCString(aHostname), NS_LITERAL_CSTRING("nntp"),
-      aServer);
+      EmptyCString(), nsDependentCString(aHostname), "nntp"_ns, aServer);
   if (NS_FAILED(rv)) return rv;
 
   if (aUseSSL) {
     rv = (*aServer)->SetSocketType(nsMsgSocketType::SSL);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   rv = (*aServer)->SetPort(aPort);
@@ -1514,17 +1513,17 @@ nsNntpService::GetListOfGroupsOnServer(n
 
 NS_IMETHODIMP
 nsNntpService::Handle(nsICommandLine* aCmdLine) {
   NS_ENSURE_ARG_POINTER(aCmdLine);
 
   nsresult rv;
   bool found;
 
-  rv = aCmdLine->HandleFlag(NS_LITERAL_STRING("news"), false, &found);
+  rv = aCmdLine->HandleFlag(u"news"_ns, false, &found);
   if (NS_SUCCEEDED(rv) && found) {
     nsCOMPtr<nsIWindowWatcher> wwatch(
         do_GetService(NS_WINDOWWATCHER_CONTRACTID));
     NS_ENSURE_TRUE(wwatch, NS_ERROR_FAILURE);
 
     nsCOMPtr<mozIDOMWindowProxy> opened;
     wwatch->OpenWindow(
         nullptr, "chrome://messenger/content/messenger.xhtml", "_blank",
--- a/mailnews/news/src/nsNntpUrl.cpp
+++ b/mailnews/news/src/nsNntpUrl.cpp
@@ -187,22 +187,21 @@ nsresult nsNntpUrl::DetermineNewsAction(
   if (query.EqualsLiteral("list-ids")) {
     m_newsAction = nsINntpUrl::ActionListIds;
     return NS_OK;
   }
   if (query.EqualsLiteral("newgroups")) {
     m_newsAction = nsINntpUrl::ActionListNewGroups;
     return NS_OK;
   }
-  if (StringBeginsWith(query, NS_LITERAL_CSTRING("search"))) {
+  if (StringBeginsWith(query, "search"_ns)) {
     m_newsAction = nsINntpUrl::ActionSearch;
     return NS_OK;
   }
-  if (StringBeginsWith(query, NS_LITERAL_CSTRING("part=")) ||
-      query.Find("&part=") > 0) {
+  if (StringBeginsWith(query, "part="_ns) || query.Find("&part=") > 0) {
     // news://news.mozilla.org:119/3B98D201.3020100%40cs.com?part=1
     // news://news.mozilla.org:119/b58dme%24aia2%40ripley.netscape.com?header=print&part=1.2&type=image/jpeg&filename=Pole.jpg
     m_newsAction = nsINntpUrl::ActionFetchPart;
     return NS_OK;
   }
 
   if (!m_messageID.IsEmpty() || m_key != nsMsgKey_None) {
     m_newsAction = nsINntpUrl::ActionFetchArticle;
@@ -404,28 +403,25 @@ nsNntpUrl::GetServer(nsIMsgIncomingServe
       do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Ignoring return results: it is perfectly acceptable for the server to not
   // exist, but FindServer (and not FindRealServer) throws NS_ERROR_UNEXPECTED
   // in this case.
   *aServer = nullptr;
   if (tryReal)
-    accountManager->FindRealServer(user, host, NS_LITERAL_CSTRING("nntp"), 0,
-                                   aServer);
+    accountManager->FindRealServer(user, host, "nntp"_ns, 0, aServer);
   else
-    accountManager->FindServer(user, host, NS_LITERAL_CSTRING("nntp"), aServer);
+    accountManager->FindServer(user, host, "nntp"_ns, aServer);
   if (!*aServer && (isNews || isNntp)) {
     // Didn't find it, try the other option
     if (tryReal)
-      accountManager->FindServer(user, host, NS_LITERAL_CSTRING("nntp"),
-                                 aServer);
+      accountManager->FindServer(user, host, "nntp"_ns, aServer);
     else
-      accountManager->FindRealServer(user, host, NS_LITERAL_CSTRING("nntp"), 0,
-                                     aServer);
+      accountManager->FindRealServer(user, host, "nntp"_ns, 0, aServer);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsNntpUrl::GetFolder(nsIMsgFolder** msgFolder) {
   NS_ENSURE_ARG_POINTER(msgFolder);
 
   nsresult rv;
--- a/suite/components/feeds/nsFeedSniffer.cpp
+++ b/suite/components/feeds/nsFeedSniffer.cpp
@@ -52,17 +52,17 @@ nsFeedSniffer::ConvertEncodedData(nsIReq
 
   mDecodedData = "";
   nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(request));
   if (!httpChannel)
     return NS_ERROR_NO_INTERFACE;
 
   nsAutoCString contentEncoding;
 
-  mozilla::Unused << httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Encoding"),
+  mozilla::Unused << httpChannel->GetResponseHeader("Content-Encoding"_ns,
                                       contentEncoding);
   if (!contentEncoding.IsEmpty()) {
     nsCOMPtr<nsIStreamConverterService> converterService(do_GetService(NS_STREAMCONVERTERSERVICE_CONTRACTID));
     if (converterService) {
       ToLowerCase(contentEncoding);
 
       nsCOMPtr<nsIStreamListener> converter;
       rv = converterService->AsyncConvertData(contentEncoding.get(),
@@ -247,18 +247,18 @@ nsFeedSniffer::GetMIMETypeFromContent(ns
     if(HasAttachmentDisposition(channel)) {
       sniffedType.Truncate();
       return NS_OK;
     }
 
     // set the feed header as a response header, since we have good metadata
     // telling us that the feed is supposed to be RSS or Atom
     mozilla::DebugOnly<nsresult> rv = 
-      channel->SetResponseHeader(NS_LITERAL_CSTRING("X-Moz-Is-Feed"),
-                                 NS_LITERAL_CSTRING("1"), false);
+      channel->SetResponseHeader("X-Moz-Is-Feed"_ns,
+                                 "1"_ns, false);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
     sniffedType.AssignLiteral(TYPE_MAYBE_FEED);
     return NS_OK;
   }
 
   // Don't sniff arbitrary types.  Limit sniffing to situations that
   // we think can reasonably arise.
   if (!contentType.EqualsLiteral(TEXT_HTML) &&
--- a/suite/components/migration/src/nsSuiteProfileMigratorBase.cpp
+++ b/suite/components/migration/src/nsSuiteProfileMigratorBase.cpp
@@ -19,20 +19,20 @@
 #include "nsNetUtil.h"
 #include "nsIDirectoryEnumerator.h"
 #include "nsIFileProtocolHandler.h"
 #include "nsServiceManagerUtils.h"
 #include "prtime.h"
 #include "nsINIParser.h"
 #include "nsArrayUtils.h"
 
-#define MAIL_DIR_50_NAME             NS_LITERAL_STRING("Mail")
-#define IMAP_MAIL_DIR_50_NAME        NS_LITERAL_STRING("ImapMail")
-#define NEWS_DIR_50_NAME             NS_LITERAL_STRING("News")
-#define DIR_NAME_CHROME              NS_LITERAL_STRING("chrome")
+#define MAIL_DIR_50_NAME             u"Mail"_ns
+#define IMAP_MAIL_DIR_50_NAME        u"ImapMail"_ns
+#define NEWS_DIR_50_NAME             u"News"_ns
+#define DIR_NAME_CHROME              u"chrome"_ns
 
 NS_IMPL_ISUPPORTS(nsSuiteProfileMigratorBase, nsISuiteProfileMigrator,
                   nsITimerCallback)
 
 using namespace mozilla;
 
 ///////////////////////////////////////////////////////////////////////////////
 // nsITimerCallback
@@ -254,17 +254,17 @@ nsresult
 nsSuiteProfileMigratorBase::GetProfileDataFromProfilesIni(nsIFile* aDataDir,
                                                           nsIMutableArray* aProfileNames,
                                                           nsIMutableArray* aProfileLocations) {
   nsresult rv;
   nsCOMPtr<nsIFile> profileIni;
   rv = aDataDir->Clone(getter_AddRefs(profileIni));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  profileIni->Append(NS_LITERAL_STRING("profiles.ini"));
+  profileIni->Append(u"profiles.ini"_ns);
 
   // Does it exist?
   bool profileFileExists = false;
   rv = profileIni->Exists(&profileFileExists);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!profileFileExists)
     return NS_ERROR_FILE_NOT_FOUND;
@@ -518,17 +518,17 @@ nsSuiteProfileMigratorBase::GetFileValue
                                          const char* aRelPrefName,
                                          const char* aPrefName,
                                          nsIFile** aReturnFile) {
   nsCString prefValue;
   nsCOMPtr<nsIFile> theFile;
   nsresult rv = aPrefBranch->GetCharPref(aRelPrefName, prefValue);
   if (NS_SUCCEEDED(rv)) {
     // The pref has the format: [ProfD]a/b/c
-    if (!StringBeginsWith(prefValue, NS_LITERAL_CSTRING("[ProfD]")))
+    if (!StringBeginsWith(prefValue, "[ProfD]"_ns))
       return NS_ERROR_FILE_NOT_FOUND;
 
     rv = NS_NewNativeLocalFile(EmptyCString(), true, getter_AddRefs(theFile));
     if (NS_FAILED(rv))
       return rv;
 
     rv = theFile->SetRelativeDescriptor(mSourceProfile, Substring(prefValue, 7));
     if (NS_FAILED(rv))
@@ -555,17 +555,17 @@ nsSuiteProfileMigratorBase::CopyAddressB
   index.AppendInt(nsISuiteProfileMigrator::ADDRESSBOOK_DATA);
   NOTIFY_OBSERVERS(MIGRATION_ITEMBEFOREMIGRATE, index.get());
 
   uint32_t count = aLdapServers.Length();
   for (uint32_t i = 0; i < count; ++i) {
     PrefBranchStruct* pref = aLdapServers.ElementAt(i);
     nsDependentCString prefName(pref->prefName);
 
-    if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".filename"))) {
+    if (StringEndsWith(prefName, ".filename"_ns)) {
       CopyFile(pref->stringValue, pref->stringValue);
     }
 
     // we don't need to do anything to the fileName pref itself
   }
 
   NOTIFY_OBSERVERS(MIGRATION_ITEMAFTERMIGRATE, index.get());
 
@@ -583,17 +583,17 @@ nsSuiteProfileMigratorBase::CopySignatur
     PrefBranchStruct* pref = aIdentities.ElementAt(i);
     nsDependentCString prefName(pref->prefName);
 
     // a partial fix for bug #255043
     // if the user's signature file from seamonkey lives in the
     // old profile root, we'll copy it over to the new profile root and
     // then set the pref to the new value. Note, this doesn't work for
     // multiple signatures that live below the seamonkey profile root
-    if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".sig_file")))
+    if (StringEndsWith(prefName, ".sig_file"_ns))
     {
       // turn the pref into a nsIFile
       nsCOMPtr<nsIFile> srcSigFile =
         do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
       rv = srcSigFile->SetPersistentDescriptor(nsDependentCString(pref->stringValue));
       NS_ENSURE_SUCCESS(rv, rv);
 
       nsCOMPtr<nsIFile> targetSigFile;
@@ -641,17 +641,17 @@ nsSuiteProfileMigratorBase::CopyMailFold
   //     destination directory pref
   CopyFile(FILE_NAME_VIRTUALFOLDERS, FILE_NAME_VIRTUALFOLDERS);
 
   int32_t count = aMailServers.Length();
   for (int32_t i = 0; i < count; ++i) {
     PrefBranchStruct* pref = aMailServers.ElementAt(i);
     nsDependentCString prefName(pref->prefName);
 
-    if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".directory"))) {
+    if (StringEndsWith(prefName, ".directory"_ns)) {
       // let's try to get a branch for this particular server to simplify things
       prefName.Cut(prefName.Length() - strlen("directory"),
                    strlen("directory"));
       prefName.Insert("mail.server.", 0);
 
       nsCOMPtr<nsIPrefBranch> serverBranch;
       aPrefService->GetBranch(prefName.get(), getter_AddRefs(serverBranch));
 
@@ -704,17 +704,17 @@ nsSuiteProfileMigratorBase::CopyMailFold
         nsAutoCString descriptorString;
         rv = targetMailFolder->GetPersistentDescriptor(descriptorString);
         NS_ENSURE_SUCCESS(rv, rv);
 
         free(pref->stringValue);
         pref->stringValue = ToNewCString(descriptorString);
       }
     }
-    else if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".newsrc.file"))) {
+    else if (StringEndsWith(prefName, ".newsrc.file"_ns)) {
       // copy the news RC file into \News. this won't work if the user has
       // different newsrc files for each account I don't know what to do in
       // that situation.
       nsCOMPtr<nsIFile> targetNewsRCFile;
       mTargetProfile->Clone(getter_AddRefs(targetNewsRCFile));
       targetNewsRCFile->Append(NEWS_DIR_50_NAME);
 
       // turn the pref into a nsIFile
@@ -746,17 +746,17 @@ nsSuiteProfileMigratorBase::CopyMailFold
   }
 
   // Remove all .directory-rel prefs as those might have changed; MailNews
   // will create those prefs again on first use
   for (int32_t i = count; i-- > 0; ) {
     PrefBranchStruct* pref = aMailServers.ElementAt(i);
     nsDependentCString prefName(pref->prefName);
 
-    if (StringEndsWith(prefName, NS_LITERAL_CSTRING(".directory-rel"))) {
+    if (StringEndsWith(prefName, ".directory-rel"_ns)) {
       if (pref->type == nsIPrefBranch::PREF_STRING)
         free(pref->stringValue);
 
       aMailServers.RemoveElementAt(i);
     }
   }
 
   return NS_OK;
--- a/suite/components/migration/src/nsThunderbirdProfileMigrator.cpp
+++ b/suite/components/migration/src/nsThunderbirdProfileMigrator.cpp
@@ -176,29 +176,29 @@ nsThunderbirdProfileMigrator::FillProfil
   // Find the Thunderbird Registry
   nsCOMPtr<nsIProperties> fileLocator(
     do_GetService("@mozilla.org/file/directory_service;1"));
   nsCOMPtr<nsIFile> thunderbirdData;
 #ifdef XP_WIN
   fileLocator->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsIFile),
                    getter_AddRefs(thunderbirdData));
 
-  thunderbirdData->Append(NS_LITERAL_STRING("Thunderbird"));
+  thunderbirdData->Append(u"Thunderbird"_ns);
 
 #elif defined(XP_MACOSX)
   fileLocator->Get(NS_MAC_USER_LIB_DIR, NS_GET_IID(nsIFile),
                    getter_AddRefs(thunderbirdData));
 
-  thunderbirdData->Append(NS_LITERAL_STRING("Thunderbird"));
+  thunderbirdData->Append(u"Thunderbird"_ns);
 
 #elif defined(XP_UNIX)
   fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsIFile),
                    getter_AddRefs(thunderbirdData));
 
-  thunderbirdData->Append(NS_LITERAL_STRING(".thunderbird"));
+  thunderbirdData->Append(u".thunderbird"_ns);
 
 #else
   // On other OS just abort
   return NS_ERROR_FILE_NOT_FOUND;
 #endif
 
   // Try profiles.ini first
   return GetProfileDataFromProfilesIni(thunderbirdData,
--- a/suite/components/profile/nsSuiteDirectoryProvider.cpp
+++ b/suite/components/profile/nsSuiteDirectoryProvider.cpp
@@ -88,17 +88,17 @@ nsSuiteDirectoryProvider::EnsureProfileF
 {
   nsCOMPtr<nsIFile> defaultsDir;
 
   NS_GetSpecialDirectory(NS_APP_DEFAULTS_50_DIR,
                         getter_AddRefs(defaultsDir));
   if (!defaultsDir)
     return;
 
-  nsresult rv = defaultsDir->AppendNative(NS_LITERAL_CSTRING("profile"));
+  nsresult rv = defaultsDir->AppendNative("profile"_ns);
   NS_ENSURE_SUCCESS_VOID(rv);
 
   defaultsDir->AppendNative(aLeafName);
 
   defaultsDir->CopyToNative(aParentDir, aLeafName);
 }
 
 NS_IMPL_ISUPPORTS(nsSuiteDirectoryProvider::AppendingEnumerator,
@@ -182,41 +182,41 @@ nsSuiteDirectoryProvider::AppendDistroSe
                                                  nsCOMArray<nsIFile> &array)
 {
   nsCOMPtr<nsIFile> searchPlugins;
   nsresult rv = aDirSvc->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
                              NS_GET_IID(nsIFile),
                              getter_AddRefs(searchPlugins));
   if (NS_FAILED(rv))
     return;
-  searchPlugins->AppendNative(NS_LITERAL_CSTRING("distribution"));
-  searchPlugins->AppendNative(NS_LITERAL_CSTRING("searchplugins"));
+  searchPlugins->AppendNative("distribution"_ns);
+  searchPlugins->AppendNative("searchplugins"_ns);
 
   bool exists;
   rv = searchPlugins->Exists(&exists);
   if (NS_FAILED(rv) || !exists)
     return;
 
   nsCOMPtr<nsIFile> commonPlugins;
   rv = searchPlugins->Clone(getter_AddRefs(commonPlugins));
   if (NS_SUCCEEDED(rv)) {
-    commonPlugins->AppendNative(NS_LITERAL_CSTRING("common"));
+    commonPlugins->AppendNative("common"_ns);
     rv = commonPlugins->Exists(&exists);
     if (NS_SUCCEEDED(rv) && exists)
         array.AppendObject(commonPlugins);
   }
 
   nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
   if (prefs) {
     nsCOMPtr<nsIFile> localePlugins;
     rv = searchPlugins->Clone(getter_AddRefs(localePlugins));
     if (NS_FAILED(rv))
       return;
 
-    localePlugins->AppendNative(NS_LITERAL_CSTRING("locale"));
+    localePlugins->AppendNative("locale"_ns);
 
     // we didn't append the locale dir - try the default one
     nsCString defLocale;
     rv = prefs->GetCharPref("distribution.searchplugins.defaultLocale",
                             defLocale);
     if (NS_SUCCEEDED(rv)) {
       nsCOMPtr<nsIFile> defLocalePlugins;
       rv = localePlugins->Clone(getter_AddRefs(defLocalePlugins));
--- a/suite/components/shell/nsWindowsShellService.cpp
+++ b/suite/components/shell/nsWindowsShellService.cpp
@@ -312,20 +312,20 @@ GetHelperPath(nsString& aPath)
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIFile> appHelper;
   rv = directoryService->Get(XRE_EXECUTABLE_FILE,
                              NS_GET_IID(nsIFile),
                              getter_AddRefs(appHelper));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = appHelper->SetNativeLeafName(NS_LITERAL_CSTRING("uninstall"));
+  rv = appHelper->SetNativeLeafName("uninstall"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = appHelper->AppendNative(NS_LITERAL_CSTRING("helper.exe"));
+  rv = appHelper->AppendNative("helper.exe"_ns);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = appHelper->GetPath(aPath);
 
   aPath.Insert('"', 0);
   aPath.Append('"');
 
   return rv;
@@ -651,17 +651,17 @@ nsWindowsShellService::SetDesktopBackgro
   rv = WriteBitmap(file, container);
 
   // if the file was written successfully, set it as the system wallpaper
   if (NS_SUCCEEDED(rv)) {
     nsCOMPtr<nsIWindowsRegKey> key(do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv));
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = key->Create(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
-                     NS_LITERAL_STRING("Control Panel\\Desktop"),
+                     u"Control Panel\\Desktop"_ns,
                      nsIWindowsRegKey::ACCESS_SET_VALUE);
     NS_ENSURE_SUCCESS(rv, rv);
 
     int style = 0;
     switch (aPosition) {
       case BACKGROUND_STRETCH:
         style = 2;
         break;
@@ -670,21 +670,21 @@ nsWindowsShellService::SetDesktopBackgro
         break;
       case BACKGROUND_FIT:
         style = 6;
         break;
     }
 
     nsString value;
     value.AppendInt(style);
-    rv = key->WriteStringValue(NS_LITERAL_STRING("WallpaperStyle"), value);
+    rv = key->WriteStringValue(u"WallpaperStyle"_ns, value);
     NS_ENSURE_SUCCESS(rv, rv);
 
     value.Assign(aPosition == BACKGROUND_TILE ? '1' : '0');
-    rv = key->WriteStringValue(NS_LITERAL_STRING("TileWallpaper"), value);
+    rv = key->WriteStringValue(u"TileWallpaper"_ns, value);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = key->Close();
     NS_ENSURE_SUCCESS(rv, rv);
 
     ::SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, (PVOID)path.get(),
                             SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE);
   }
@@ -710,23 +710,23 @@ nsWindowsShellService::SetDesktopBackgro
 
   ::SetSysColors(1, &parameter, &color);
 
   nsresult rv;
   nsCOMPtr<nsIWindowsRegKey> key(do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = key->Create(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
-                   NS_LITERAL_STRING("Control Panel\\Colors"),
+                   u"Control Panel\\Colors"_ns,
                    nsIWindowsRegKey::ACCESS_SET_VALUE);
   NS_ENSURE_SUCCESS(rv, rv);
 
   wchar_t rgb[12];
   _snwprintf(rgb, 12, L"%u %u %u", r, g, b);
-  rv = key->WriteStringValue(NS_LITERAL_STRING("Background"),
+  rv = key->WriteStringValue(u"Background"_ns,
                              nsDependentString(rgb));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return key->Close();
 }
 
 NS_IMETHODIMP
 nsWindowsShellService::OpenApplicationWithURI(nsIFile* aApplication,
@@ -752,17 +752,17 @@ nsWindowsShellService::GetDefaultFeedRea
 {
   *_retval = nullptr;
 
   nsresult rv;
   nsCOMPtr<nsIWindowsRegKey> key(do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = key->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT,
-                 NS_LITERAL_STRING("feed\\shell\\open\\command"),
+                 u"feed\\shell\\open\\command"_ns,
                  nsIWindowsRegKey::ACCESS_READ);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsString path;
   rv = key->ReadStringValue(EmptyString(), path);
   NS_ENSURE_SUCCESS(rv, rv);
   if (path.IsEmpty())
     return NS_ERROR_FAILURE;