Bug 869836 - Part 12: Use `Assign('c')` instead of `AssignLiteral("c")`. r=ehsan
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Mon, 26 May 2014 21:55:08 +0300
changeset 185143 cfaa8aa6237017044dc4fa3448194bcfad550722
parent 185142 64a0e8806b2226c1f638b5ad664a473b9709d5d4
child 185144 eb3b772bac41bcc5d684bdf10a12d12e5ccbf54f
push id26844
push userryanvm@gmail.com
push dateTue, 27 May 2014 20:23:53 +0000
treeherdermozilla-central@448f2153d6d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs869836
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 869836 - Part 12: Use `Assign('c')` instead of `AssignLiteral("c")`. r=ehsan
browser/components/shell/src/nsWindowsShellService.cpp
content/base/src/WebSocket.cpp
content/base/src/nsObjectLoadingContent.cpp
content/base/src/nsXMLContentSerializer.cpp
content/xul/document/src/XULDocument.cpp
content/xul/templates/src/nsXULContentUtils.cpp
content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp
docshell/base/nsDocShell.cpp
dom/bluetooth/BluetoothManager.cpp
dom/bluetooth2/BluetoothManager.cpp
dom/devicestorage/nsDeviceStorage.cpp
dom/workers/WorkerPrivate.cpp
dom/xslt/xslt/txEXSLTFunctions.cpp
dom/xslt/xslt/txXSLTNumber.cpp
editor/libeditor/html/nsHTMLEditor.cpp
editor/libeditor/html/nsHTMLObjectResizer.cpp
intl/locale/src/unix/nsCollationUnix.cpp
ipc/glue/GeckoChildProcessHost.cpp
layout/generic/nsFrameState.cpp
layout/style/nsComputedDOMStyle.cpp
parser/htmlparser/src/nsParser.cpp
widget/gtk/nsColorPicker.cpp
widget/windows/nsColorPicker.cpp
--- a/browser/components/shell/src/nsWindowsShellService.cpp
+++ b/browser/components/shell/src/nsWindowsShellService.cpp
@@ -910,34 +910,34 @@ nsWindowsShellService::SetDesktopBackgro
                         NS_LITERAL_STRING("Control Panel\\Desktop"),
                         nsIWindowsRegKey::ACCESS_SET_VALUE);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsAutoString tile;
     nsAutoString style;
     switch (aPosition) {
       case BACKGROUND_TILE:
-        style.AssignLiteral("0");
-        tile.AssignLiteral("1");
+        style.Assign('0');
+        tile.Assign('1');
         break;
       case BACKGROUND_CENTER:
-        style.AssignLiteral("0");
-        tile.AssignLiteral("0");
+        style.Assign('0');
+        tile.Assign('0');
         break;
       case BACKGROUND_STRETCH:
-        style.AssignLiteral("2");
-        tile.AssignLiteral("0");
+        style.Assign('2');
+        tile.Assign('0');
         break;
       case BACKGROUND_FILL:
         style.AssignLiteral("10");
-        tile.AssignLiteral("0");
+        tile.Assign('0');
         break;
       case BACKGROUND_FIT:
-        style.AssignLiteral("6");
-        tile.AssignLiteral("0");
+        style.Assign('6');
+        tile.Assign('0');
         break;
     }
 
     rv = regKey->WriteStringValue(NS_LITERAL_STRING("TileWallpaper"), tile);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = regKey->WriteStringValue(NS_LITERAL_STRING("WallpaperStyle"), style);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = regKey->Close();
--- a/content/base/src/WebSocket.cpp
+++ b/content/base/src/WebSocket.cpp
@@ -987,17 +987,17 @@ WebSocket::ParseURL(const nsString& aURL
   NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SYNTAX_ERR);
 
   rv = NS_CheckPortSafety(port, scheme.get());
   NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SYNTAX_ERR);
 
   nsAutoCString filePath;
   rv = parsedURL->GetFilePath(filePath);
   if (filePath.IsEmpty()) {
-    filePath.AssignLiteral("/");
+    filePath.Assign('/');
   }
   NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SYNTAX_ERR);
 
   nsAutoCString query;
   rv = parsedURL->GetQuery(query);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SYNTAX_ERR);
 
   if (scheme.LowerCaseEqualsLiteral("ws")) {
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -1527,24 +1527,24 @@ nsObjectLoadingContent::UpdateObjectPara
           }
         }
       }
     }
   }
 
   if (isJava && hasCodebase && codebaseStr.IsEmpty()) {
     // Java treats codebase="" as "/"
-    codebaseStr.AssignLiteral("/");
+    codebaseStr.Assign('/');
     // XXX(johns): This doesn't cover the case of "https:" which java would
     //             interpret as "https:///" but we interpret as this document's
     //             URI but with a changed scheme.
   } else if (isJava && !hasCodebase) {
     // Java expects a directory as the codebase, or else it will construct
     // relative URIs incorrectly :(
-    codebaseStr.AssignLiteral(".");
+    codebaseStr.Assign('.');
   }
 
   if (!codebaseStr.IsEmpty()) {
     rv = nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(newBaseURI),
                                                    codebaseStr,
                                                    thisContent->OwnerDoc(),
                                                    docBaseURI);
     if (NS_SUCCEEDED(rv)) {
--- a/content/base/src/nsXMLContentSerializer.cpp
+++ b/content/base/src/nsXMLContentSerializer.cpp
@@ -93,20 +93,20 @@ nsXMLContentSerializer::Init(uint32_t aF
   mFlags = aFlags;
 
   // Set the line break character:
   if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak)
       && (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) { // Windows
     mLineBreak.AssignLiteral("\r\n");
   }
   else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) { // Mac
-    mLineBreak.AssignLiteral("\r");
+    mLineBreak.Assign('\r');
   }
   else if (mFlags & nsIDocumentEncoder::OutputLFLineBreak) { // Unix/DOM
-    mLineBreak.AssignLiteral("\n");
+    mLineBreak.Assign('\n');
   }
   else {
     mLineBreak.AssignLiteral(NS_LINEBREAK);         // Platform/default
   }
 
   mDoRaw = !!(mFlags & nsIDocumentEncoder::OutputRaw);
 
   mDoFormat = (mFlags & nsIDocumentEncoder::OutputFormatted && !mDoRaw);
@@ -595,17 +595,17 @@ nsXMLContentSerializer::ConfirmPrefix(ns
   // Now just set aURI as the new default namespace URI.  Indicate that we need
   // to create a namespace decl for the final prefix
   return true;
 }
 
 void
 nsXMLContentSerializer::GenerateNewPrefix(nsAString& aPrefix)
 {
-  aPrefix.AssignLiteral("a");
+  aPrefix.Assign('a');
   char buf[128];
   PR_snprintf(buf, sizeof(buf), "%d", mPrefixIndex++);
   AppendASCIItoUTF16(buf, aPrefix);
 }
 
 void
 nsXMLContentSerializer::SerializeAttr(const nsAString& aPrefix,
                                       const nsAString& aName,
--- a/content/xul/document/src/XULDocument.cpp
+++ b/content/xul/document/src/XULDocument.cpp
@@ -4244,17 +4244,17 @@ XULDocument::BroadcasterHookup::~Broadca
         nsAutoString attribute;
 
         if (tag == nsGkAtoms::observes) {
             mObservesElement->GetAttr(kNameSpaceID_None, nsGkAtoms::element, broadcasterID);
             mObservesElement->GetAttr(kNameSpaceID_None, nsGkAtoms::attribute, attribute);
         }
         else {
             mObservesElement->GetAttr(kNameSpaceID_None, nsGkAtoms::observes, broadcasterID);
-            attribute.AssignLiteral("*");
+            attribute.Assign('*');
         }
 
         nsAutoCString attributeC,broadcasteridC;
         attributeC.AssignWithConversion(attribute);
         broadcasteridC.AssignWithConversion(broadcasterID);
         PR_LOG(gXULLog, PR_LOG_WARNING,
                ("xul: broadcaster hookup failed <%s attribute='%s'> to %s",
                 nsAtomCString(tag).get(),
@@ -4393,17 +4393,17 @@ XULDocument::FindBroadcaster(Element* aE
             else {
               return NS_FINDBROADCASTER_NOT_FOUND;
             }
         }
 
         *aListener = aElement;
         NS_ADDREF(*aListener);
 
-        aAttribute.AssignLiteral("*");
+        aAttribute.Assign('*');
     }
 
     // Make sure we got a valid listener.
     NS_ENSURE_TRUE(*aListener, NS_ERROR_UNEXPECTED);
 
     // Try to find the broadcaster element in the document.
     *aBroadcaster = GetElementById(aBroadcasterID);
 
--- a/content/xul/templates/src/nsXULContentUtils.cpp
+++ b/content/xul/templates/src/nsXULContentUtils.cpp
@@ -433,23 +433,23 @@ nsXULContentUtils::SetCommandUpdater(nsI
 
     NS_ASSERTION(dispatcher != nullptr, "no dispatcher");
     if (! dispatcher)
         return NS_ERROR_UNEXPECTED;
 
     nsAutoString events;
     aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::events, events);
     if (events.IsEmpty())
-        events.AssignLiteral("*");
+        events.Assign('*');
 
     nsAutoString targets;
     aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::targets, targets);
 
     if (targets.IsEmpty())
-        targets.AssignLiteral("*");
+        targets.Assign('*');
 
     nsCOMPtr<nsIDOMElement> domelement = do_QueryInterface(aElement);
     NS_ASSERTION(domelement != nullptr, "not a DOM element");
     if (! domelement)
         return NS_ERROR_UNEXPECTED;
 
     rv = dispatcher->AddCommandUpdater(domelement, events, targets);
     if (NS_FAILED(rv)) return rv;
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp
@@ -246,17 +246,17 @@ nsXULTemplateQueryProcessorXML::CompileQ
     nsCOMPtr<nsIContent> content = do_QueryInterface(aQueryNode);
 
     nsAutoString expr;
     content->GetAttr(kNameSpaceID_None, nsGkAtoms::expr, expr);
 
     // if an expression is not specified, then the default is to
     // just take all of the children
     if (expr.IsEmpty())
-        expr.AssignLiteral("*");
+        expr.Assign('*');
 
     nsCOMPtr<nsIDOMXPathExpression> compiledexpr;
     rv = CreateExpression(expr, aQueryNode, getter_AddRefs(compiledexpr));
     if (NS_FAILED(rv)) {
         nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_BAD_XPATH);
         return rv;
     }
 
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -4694,17 +4694,17 @@ nsDocShell::DisplayLoadError(nsresult aE
     }
     else {
         if (addHostPort) {
             // Build up the host:port string.
             nsAutoCString hostport;
             if (aURI) {
                 aURI->GetHostPort(hostport);
             } else {
-                hostport.AssignLiteral("?");
+                hostport.Assign('?');
             }
             CopyUTF8toUTF16(hostport, formatStrs[formatStrCount++]);
         }
 
         nsAutoCString spec;
         rv = NS_ERROR_NOT_AVAILABLE;
         if (aURI) {
             // displaying "file://" is aesthetically unpleasing and could even be
@@ -4720,17 +4720,17 @@ nsDocShell::DisplayLoadError(nsresult aE
             // unescape and convert from origin charset
             aURI->GetOriginCharset(charset);
             nsCOMPtr<nsITextToSubURI> textToSubURI(
                 do_GetService(NS_ITEXTTOSUBURI_CONTRACTID, &rv));
             if (NS_SUCCEEDED(rv)) {
                 rv = textToSubURI->UnEscapeURIForUI(charset, spec, formatStrs[formatStrCount]);
             }
         } else {
-            spec.AssignLiteral("?");
+            spec.Assign('?');
         }
         if (NS_FAILED(rv))
             CopyUTF8toUTF16(spec, formatStrs[formatStrCount]);
         rv = NS_OK;
         ++formatStrCount;
 
         const char16_t *strs[kMaxFormatStrArgs];
         for (uint32_t i = 0; i < formatStrCount; i++) {
--- a/dom/bluetooth/BluetoothManager.cpp
+++ b/dom/bluetooth/BluetoothManager.cpp
@@ -102,17 +102,17 @@ private:
 
 BluetoothManager::BluetoothManager(nsPIDOMWindow *aWindow)
   : DOMEventTargetHelper(aWindow)
   , BluetoothPropertyContainer(BluetoothObjectType::TYPE_MANAGER)
 {
   MOZ_ASSERT(aWindow);
   MOZ_ASSERT(IsDOMBinding());
 
-  mPath.AssignLiteral("/");
+  mPath.Assign('/');
 
   BluetoothService* bs = BluetoothService::Get();
   NS_ENSURE_TRUE_VOID(bs);
   bs->RegisterBluetoothSignalHandler(NS_LITERAL_STRING(KEY_MANAGER), this);
 }
 
 BluetoothManager::~BluetoothManager()
 {
--- a/dom/bluetooth2/BluetoothManager.cpp
+++ b/dom/bluetooth2/BluetoothManager.cpp
@@ -102,17 +102,17 @@ private:
 
 BluetoothManager::BluetoothManager(nsPIDOMWindow *aWindow)
   : DOMEventTargetHelper(aWindow)
   , BluetoothPropertyContainer(BluetoothObjectType::TYPE_MANAGER)
 {
   MOZ_ASSERT(aWindow);
   MOZ_ASSERT(IsDOMBinding());
 
-  mPath.AssignLiteral("/");
+  mPath.Assign('/');
 
   BluetoothService* bs = BluetoothService::Get();
   NS_ENSURE_TRUE_VOID(bs);
   bs->RegisterBluetoothSignalHandler(NS_LITERAL_STRING(KEY_MANAGER), this);
 }
 
 BluetoothManager::~BluetoothManager()
 {
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -310,17 +310,17 @@ DeviceStorageTypeChecker::Check(const ns
   aFile->GetPath(path);
 
   int32_t dotIdx = path.RFindChar(char16_t('.'));
   if (dotIdx == kNotFound) {
     return false;
   }
 
   nsAutoString extensionMatch;
-  extensionMatch.AssignLiteral("*");
+  extensionMatch.Assign('*');
   extensionMatch.Append(Substring(path, dotIdx));
   extensionMatch.Append(';');
 
   if (aType.EqualsLiteral(DEVICESTORAGE_PICTURES)) {
     return CaseInsensitiveFindInReadable(extensionMatch, mPicturesExtensions);
   }
 
   if (aType.EqualsLiteral(DEVICESTORAGE_VIDEOS)) {
@@ -353,17 +353,17 @@ DeviceStorageTypeChecker::GetTypeFromFil
 
   nsString fileName(aFileName);
   int32_t dotIdx = fileName.RFindChar(char16_t('.'));
   if (dotIdx == kNotFound) {
     return;
   }
 
   nsAutoString extensionMatch;
-  extensionMatch.AssignLiteral("*");
+  extensionMatch.Assign('*');
   extensionMatch.Append(Substring(aFileName, dotIdx));
   extensionMatch.Append(';');
 
   if (CaseInsensitiveFindInReadable(extensionMatch, mPicturesExtensions)) {
     aType.AssignLiteral(DEVICESTORAGE_PICTURES);
   }
   else if (CaseInsensitiveFindInReadable(extensionMatch, mVideosExtensions)) {
     aType.AssignLiteral(DEVICESTORAGE_VIDEOS);
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3360,36 +3360,36 @@ WorkerPrivateParent<Derived>::SetBaseURI
   if (NS_FAILED(aBaseURI->GetPath(mLocationInfo.mPathname))) {
     mLocationInfo.mPathname.Truncate();
   }
 
   nsCString temp;
 
   nsCOMPtr<nsIURL> url(do_QueryInterface(aBaseURI));
   if (url && NS_SUCCEEDED(url->GetQuery(temp)) && !temp.IsEmpty()) {
-    mLocationInfo.mSearch.AssignLiteral("?");
+    mLocationInfo.mSearch.Assign('?');
     mLocationInfo.mSearch.Append(temp);
   }
 
   if (NS_SUCCEEDED(aBaseURI->GetRef(temp)) && !temp.IsEmpty()) {
     nsCOMPtr<nsITextToSubURI> converter =
       do_GetService(NS_ITEXTTOSUBURI_CONTRACTID);
     if (converter) {
       nsCString charset;
       nsAutoString unicodeRef;
       if (NS_SUCCEEDED(aBaseURI->GetOriginCharset(charset)) &&
           NS_SUCCEEDED(converter->UnEscapeURIForUI(charset, temp,
                                                    unicodeRef))) {
-        mLocationInfo.mHash.AssignLiteral("#");
+        mLocationInfo.mHash.Assign('#');
         mLocationInfo.mHash.Append(NS_ConvertUTF16toUTF8(unicodeRef));
       }
     }
 
     if (mLocationInfo.mHash.IsEmpty()) {
-      mLocationInfo.mHash.AssignLiteral("#");
+      mLocationInfo.mHash.Assign('#');
       mLocationInfo.mHash.Append(temp);
     }
   }
 
   if (NS_SUCCEEDED(aBaseURI->GetScheme(mLocationInfo.mProtocol))) {
     mLocationInfo.mProtocol.Append(':');
   }
   else {
--- a/dom/xslt/xslt/txEXSLTFunctions.cpp
+++ b/dom/xslt/xslt/txEXSLTFunctions.cpp
@@ -476,17 +476,17 @@ txEXSLTFunctionCall::evaluate(txIEvalCon
             NS_ENSURE_SUCCESS(rv, rv);
 
             nsAutoString pattern;
             if (mParams.Length() == 2) {
                 rv = mParams[1]->evaluateToString(aContext, pattern);
                 NS_ENSURE_SUCCESS(rv, rv);
             }
             else if (mType == SPLIT) {
-                pattern.AssignLiteral(" ");
+                pattern.Assign(' ');
             }
             else {
                 pattern.AssignLiteral("\t\r\n ");
             }
 
             // Set up holders for the result
             nsRefPtr<DocumentFragment> docFrag = createDocFragment(aContext);
             NS_ENSURE_STATE(docFrag);
--- a/dom/xslt/xslt/txXSLTNumber.cpp
+++ b/dom/xslt/xslt/txXSLTNumber.cpp
@@ -319,17 +319,17 @@ txXSLTNumber::getCounters(Expr* aGroupSi
 
     // If there are no formatting tokens we need to create a default one.
     if (formatPos == formatLen) {
         txFormattedCounter* defaultCounter;
         rv = txFormattedCounter::getCounterFor(NS_LITERAL_STRING("1"), groupSize,
                                                groupSeparator, defaultCounter);
         NS_ENSURE_SUCCESS(rv, rv);
 
-        defaultCounter->mSeparator.AssignLiteral(".");
+        defaultCounter->mSeparator.Assign('.');
         rv = aCounters.add(defaultCounter);
         if (NS_FAILED(rv)) {
             // XXX ErrorReport: out of memory
             delete defaultCounter;
             return rv;
         }
 
         return NS_OK;
@@ -338,17 +338,17 @@ txXSLTNumber::getCounters(Expr* aGroupSi
     while (formatPos < formatLen) {
         nsAutoString sepToken;
         // parse separator token
         if (!aCounters.getLength()) {
             // Set the first counters separator to default value so that if
             // there is only one formatting token and we're formatting a
             // value-list longer then one we use the default separator. This
             // won't be used when formatting the first value anyway.
-            sepToken.AssignLiteral(".");
+            sepToken.Assign('.');
         }
         else {
             while (formatPos < formatLen &&
                    !isAlphaNumeric(ch = format.CharAt(formatPos))) {
                 sepToken.Append(ch);
                 ++formatPos;
             }
         }
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -2298,17 +2298,17 @@ nsHTMLEditor::GetElementOrParentByTagNam
     return nullptr;
   }
 
   nsAutoString tagName(aTagName);
   ToLowerCase(tagName);
   bool getLink = IsLinkTag(tagName);
   bool getNamedAnchor = IsNamedAnchorTag(tagName);
   if (getLink || getNamedAnchor) {
-    tagName.AssignLiteral("a");
+    tagName.Assign('a');
   }
   bool findTableCell = tagName.EqualsLiteral("td");
   bool findList = tagName.EqualsLiteral("list");
 
   for (; current; current = current->GetParentElement()) {
     // Test if we have a link (an anchor with href set)
     if ((getLink && nsHTMLEditUtils::IsLink(current)) ||
         (getNamedAnchor && nsHTMLEditUtils::IsNamedAnchor(current))) {
@@ -2572,17 +2572,17 @@ nsHTMLEditor::CreateElementWithDefaults(
 {
   MOZ_ASSERT(!aTagName.IsEmpty());
 
   nsAutoString tagName(aTagName);
   ToLowerCase(tagName);
   nsAutoString realTagName;
 
   if (IsLinkTag(tagName) || IsNamedAnchorTag(tagName)) {
-    realTagName.AssignLiteral("a");
+    realTagName.Assign('a');
   } else {
     realTagName = tagName;
   }
   // We don't use editor's CreateElement because we don't want to go through
   // the transaction system
 
   // New call to use instead to get proper HTML element, bug 39919
   ErrorResult rv;
--- a/editor/libeditor/html/nsHTMLObjectResizer.cpp
+++ b/editor/libeditor/html/nsHTMLObjectResizer.cpp
@@ -703,19 +703,19 @@ nsHTMLEditor::SetResizingInfoPosition(in
   }
 
   nsAutoString widthStr, heightStr, diffWidthStr, diffHeightStr;
   widthStr.AppendInt(aW);
   heightStr.AppendInt(aH);
   int32_t diffWidth  = aW - mResizedObjectWidth;
   int32_t diffHeight = aH - mResizedObjectHeight;
   if (diffWidth > 0)
-    diffWidthStr.AssignLiteral("+");
+    diffWidthStr.Assign('+');
   if (diffHeight > 0)
-    diffHeightStr.AssignLiteral("+");
+    diffHeightStr.Assign('+');
   diffWidthStr.AppendInt(diffWidth);
   diffHeightStr.AppendInt(diffHeight);
 
   nsAutoString info(widthStr + NS_LITERAL_STRING(" x ") + heightStr +
                     NS_LITERAL_STRING(" (") + diffWidthStr +
                     NS_LITERAL_STRING(", ") + diffHeightStr +
                     NS_LITERAL_STRING(")"));
 
--- a/intl/locale/src/unix/nsCollationUnix.cpp
+++ b/intl/locale/src/unix/nsCollationUnix.cpp
@@ -76,17 +76,17 @@ nsresult nsCollationUnix::Initialize(nsI
     res = locale->GetCategory(aCategory, localeStr);
     NS_ASSERTION(NS_SUCCEEDED(res), "failed to get locale info");
   }
 
   // Get platform locale and charset name from locale, if available
   if (NS_SUCCEEDED(res)) {
     // keep the same behavior as 4.x as well as avoiding Linux collation key problem
     if (localeStr.LowerCaseEqualsLiteral("en_us")) { // note: locale is in platform format
-      localeStr.AssignLiteral("C");
+      localeStr.Assign('C');
     }
 
     nsPosixLocale::GetPlatformLocale(localeStr, mLocale);
 
     nsCOMPtr <nsIPlatformCharset> platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &res);
     if (NS_SUCCEEDED(res)) {
       nsAutoCString mappedCharset;
       res = platformCharset->GetDefaultCharsetForLocale(localeStr, mappedCharset);
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -305,17 +305,17 @@ void GeckoChildProcessHost::InitWindowsG
     do_GetService(NS_TASKBAR_CONTRACTID);
   if (taskbarInfo) {
     bool isSupported = false;
     taskbarInfo->GetAvailable(&isSupported);
     nsAutoString appId;
     if (isSupported && NS_SUCCEEDED(taskbarInfo->GetDefaultGroupId(appId))) {
       mGroupId.Append(appId);
     } else {
-      mGroupId.AssignLiteral("-");
+      mGroupId.Assign('-');
     }
   }
 }
 #endif
 
 bool
 GeckoChildProcessHost::SyncLaunch(std::vector<std::string> aExtraOpts, int aTimeoutMs, base::ProcessArchitecture arch)
 {
--- a/layout/generic/nsFrameState.cpp
+++ b/layout/generic/nsFrameState.cpp
@@ -30,17 +30,17 @@ nsCString
 GetFrameState(nsIFrame* aFrame)
 {
   nsCString result;
   nsAutoTArray<const char*,3> groups;
 
   nsFrameState state = aFrame->GetStateBits();
 
   if (state == nsFrameState(0)) {
-    result.AssignLiteral("0");
+    result.Assign('0');
     return result;
   }
 
 #define FRAME_STATE_GROUP(name_, class_)                                      \
   {                                                                           \
     class_* frame = do_QueryFrame(aFrame);                                    \
     if (frame && (groups.IsEmpty() || strcmp(groups.LastElement(), #name_))) {\
       groups.AppendElement(#name_);                                           \
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -2287,17 +2287,17 @@ nsComputedDOMStyle::DoGetGridTemplateAre
 
 // aLineNames must not be empty
 CSSValue*
 nsComputedDOMStyle::GetGridLineNames(const nsTArray<nsString>& aLineNames)
 {
   nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue;
   nsAutoString lineNamesString;
   uint32_t i_end = aLineNames.Length();
-  lineNamesString.AssignLiteral("(");
+  lineNamesString.Assign('(');
   if (i_end > 0) {
     for (uint32_t i = 0;;) {
       nsStyleUtil::AppendEscapedCSSIdent(aLineNames[i], lineNamesString);
       if (++i == i_end) {
         break;
       }
       lineNamesString.Append(' ');
     }
--- a/parser/htmlparser/src/nsParser.cpp
+++ b/parser/htmlparser/src/nsParser.cpp
@@ -1331,17 +1331,17 @@ nsParser::ParseFragment(const nsAString&
     theContext.Append('<');
     theContext.Append(aTagStack[theCount - theIndex - 1]);
     theContext.Append('>');
   }
 
   if (theCount == 0) {
     // Ensure that the buffer is not empty. Because none of the DTDs care
     // about leading whitespace, this doesn't change the result.
-    theContext.AssignLiteral(" ");
+    theContext.Assign(' ');
   }
 
   // First, parse the context to build up the DTD's tag stack. Note that we
   // pass false for the aLastCall parameter.
   result = Parse(theContext,
                  (void*)&theContext,
                  false);
   if (NS_FAILED(result)) {
--- a/widget/gtk/nsColorPicker.cpp
+++ b/widget/gtk/nsColorPicker.cpp
@@ -170,13 +170,13 @@ nsString nsColorPicker::ToHexString(int 
   return result;
 }
 
 void nsColorPicker::ReadValueFromColorSelection(GtkColorSelection* colorselection)
 {
   GdkColor rgba;
   gtk_color_selection_get_current_color(colorselection, &rgba);
 
-  mColor.AssignLiteral("#");
+  mColor.Assign('#');
   mColor += ToHexString(convertGdkColorComponent(rgba.red));
   mColor += ToHexString(convertGdkColorComponent(rgba.green));
   mColor += ToHexString(convertGdkColorComponent(rgba.blue));
 }
--- a/widget/windows/nsColorPicker.cpp
+++ b/widget/windows/nsColorPicker.cpp
@@ -78,17 +78,17 @@ static nsString ToHexString(BYTE n)
 
 static void
 BGRIntToRGBString(DWORD color, nsAString& aResult)
 {
   BYTE r = GetRValue(color);
   BYTE g = GetGValue(color);
   BYTE b = GetBValue(color);
 
-  aResult.AssignLiteral("#");
+  aResult.Assign('#');
   aResult.Append(ToHexString(r));
   aResult.Append(ToHexString(g));
   aResult.Append(ToHexString(b));
 }
 } // anonymous namespace
 
 AsyncColorChooser::AsyncColorChooser(const nsAString& aInitialColor,
                                      nsIWidget* aParentWidget,