diff --git a/browser/components/shell/src/nsGNOMEShellService.cpp b/browser/components/shell/src/nsGNOMEShellService.cpp index fe616628999..555ad81655e 100644 --- a/browser/components/shell/src/nsGNOMEShellService.cpp +++ b/browser/components/shell/src/nsGNOMEShellService.cpp @@ -408,15 +408,15 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement, // Set desktop wallpaper filling style nsAutoCString options; if (aPosition == BACKGROUND_TILE) - options.Assign("wallpaper"); + options.AssignLiteral("wallpaper"); else if (aPosition == BACKGROUND_STRETCH) - options.Assign("stretched"); + options.AssignLiteral("stretched"); else if (aPosition == BACKGROUND_FILL) - options.Assign("zoom"); + options.AssignLiteral("zoom"); else if (aPosition == BACKGROUND_FIT) - options.Assign("scaled"); + options.AssignLiteral("scaled"); else - options.Assign("centered"); + options.AssignLiteral("centered"); // Write the background file to the home directory. nsAutoCString filePath(PR_GetEnv("HOME")); @@ -581,9 +581,9 @@ nsGNOMEShellService::OpenApplication(int32_t aApplication) { nsAutoCString scheme; if (aApplication == APPLICATION_MAIL) - scheme.Assign("mailto"); + scheme.AssignLiteral("mailto"); else if (aApplication == APPLICATION_NEWS) - scheme.Assign("news"); + scheme.AssignLiteral("news"); else return NS_ERROR_NOT_AVAILABLE; diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index f8fce752811..7e9c2899983 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -1292,21 +1292,21 @@ DetectByteOrderMark(const unsigned char* aBytes, int32_t aLen, nsCString& oChars if (aLen >= 3 && 0xBB == aBytes[1] && 0xBF == aBytes[2]) { // EF BB BF // Win2K UTF-8 BOM - oCharset.Assign("UTF-8"); + oCharset.AssignLiteral("UTF-8"); } break; case 0xFE: if (0xFF == aBytes[1]) { // FE FF // UTF-16, big-endian - oCharset.Assign("UTF-16BE"); + oCharset.AssignLiteral("UTF-16BE"); } break; case 0xFF: if (0xFE == aBytes[1]) { // FF FE // UTF-16, little-endian - oCharset.Assign("UTF-16LE"); + oCharset.AssignLiteral("UTF-16LE"); } break; } diff --git a/content/html/content/src/HTMLInputElement.cpp b/content/html/content/src/HTMLInputElement.cpp index c5000e23002..1a348f9a81c 100644 --- a/content/html/content/src/HTMLInputElement.cpp +++ b/content/html/content/src/HTMLInputElement.cpp @@ -6733,16 +6733,16 @@ HTMLInputElement::GetValidationMessage(nsAString& aValidationMessage, switch (mType) { case NS_FORM_INPUT_FILE: - key.Assign("FormValidationFileMissing"); + key.AssignLiteral("FormValidationFileMissing"); break; case NS_FORM_INPUT_CHECKBOX: - key.Assign("FormValidationCheckboxMissing"); + key.AssignLiteral("FormValidationCheckboxMissing"); break; case NS_FORM_INPUT_RADIO: - key.Assign("FormValidationRadioMissing"); + key.AssignLiteral("FormValidationRadioMissing"); break; default: - key.Assign("FormValidationValueMissing"); + key.AssignLiteral("FormValidationValueMissing"); } rv = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES, key.get(), message); diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 1ea87cd235c..b168b4cce6d 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -2986,10 +2986,10 @@ ConvertToMidasInternalCommandInner(const nsAString& inCommandID, // Hack to support old boolean commands that were backwards (see bug 301490). bool invertBool = false; if (convertedCommandID.LowerCaseEqualsLiteral("usecss")) { - convertedCommandID.Assign("styleWithCSS"); + convertedCommandID.AssignLiteral("styleWithCSS"); invertBool = true; } else if (convertedCommandID.LowerCaseEqualsLiteral("readonly")) { - convertedCommandID.Assign("contentReadOnly"); + convertedCommandID.AssignLiteral("contentReadOnly"); invertBool = true; } diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 4c390b9e88c..6b52f1d01d2 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -603,7 +603,7 @@ NS_ScriptErrorReporter(JSContext *cx, // Print it to stderr as well, for the benefit of those invoking // mozilla with -console. nsAutoCString error; - error.Assign("JavaScript "); + error.AssignLiteral("JavaScript "); if (JSREPORT_IS_STRICT(report->flags)) error.Append("strict "); if (JSREPORT_IS_WARNING(report->flags)) diff --git a/dom/camera/GonkCameraManager.cpp b/dom/camera/GonkCameraManager.cpp index a10e47a6083..febb31a888a 100644 --- a/dom/camera/GonkCameraManager.cpp +++ b/dom/camera/GonkCameraManager.cpp @@ -54,15 +54,15 @@ ICameraControl::GetCameraName(uint32_t aDeviceNum, nsCString& aDeviceName) switch (info.facing) { case CAMERA_FACING_BACK: - aDeviceName.Assign("back"); + aDeviceName.AssignLiteral("back"); break; case CAMERA_FACING_FRONT: - aDeviceName.Assign("front"); + aDeviceName.AssignLiteral("front"); break; default: - aDeviceName.Assign("extra-camera-"); + aDeviceName.AssignLiteral("extra-camera-"); aDeviceName.AppendInt(deviceNum); break; } diff --git a/dom/indexedDB/ProfilerHelpers.h b/dom/indexedDB/ProfilerHelpers.h index 271a2f29e06..46752955d4d 100644 --- a/dom/indexedDB/ProfilerHelpers.h +++ b/dom/indexedDB/ProfilerHelpers.h @@ -118,7 +118,7 @@ public: ProfilerString(const Key& aKey) { if (aKey.IsUnset()) { - Assign("null"); + AssignLiteral("null"); } else if (aKey.IsFloat()) { AppendPrintf("%g", aKey.ToFloat()); diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index 3b78b99778f..a144da3c678 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -1415,7 +1415,7 @@ nsPluginHost::RegisterPlayPreviewMimeType(const nsACString& mimeType, nsAutoCString url(redirectURL); if (url.Length() == 0) { // using default play preview iframe URL, if redirectURL is not specified - url.Assign("data:application/x-moz-playpreview;,"); + url.AssignLiteral("data:application/x-moz-playpreview;,"); url.Append(mimeType); } diff --git a/embedding/tests/winEmbed/WebBrowserChrome.cpp b/embedding/tests/winEmbed/WebBrowserChrome.cpp index 8b18d7a75d4..7bd02b3080e 100644 --- a/embedding/tests/winEmbed/WebBrowserChrome.cpp +++ b/embedding/tests/winEmbed/WebBrowserChrome.cpp @@ -394,13 +394,13 @@ WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, int3 if(!(strcmp(operation, "back"))) { - status.Assign("Going back to url: "); + status.AssignLiteral("Going back to url: "); status.Append(uriSpec); } else if (!(strcmp(operation, "forward"))) { // Going forward. XXX Get string from a resource file - status.Assign("Going forward to url: "); + status.AssignLiteral("Going forward to url: "); status.Append(uriSpec); } else if (!(strcmp(operation, "reload"))) @@ -409,19 +409,19 @@ WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, int3 if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY && aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE) { - status.Assign("Reloading url, (bypassing proxy and cache): "); + status.AssignLiteral("Reloading url, (bypassing proxy and cache): "); } else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY) { - status.Assign("Reloading url, (bypassing proxy): "); + status.AssignLiteral("Reloading url, (bypassing proxy): "); } else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE) { - status.Assign("Reloading url, (bypassing cache): "); + status.AssignLiteral("Reloading url, (bypassing cache): "); } else { - status.Assign("Reloading url, (normal): "); + status.AssignLiteral("Reloading url, (normal): "); } status.Append(uriSpec); } @@ -432,7 +432,7 @@ WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, int3 } else if (!(strcmp(operation, "goto"))) { - status.Assign("Going to HistoryIndex: "); + status.AssignLiteral("Going to HistoryIndex: "); AppendIntToCString(info1, status); @@ -446,7 +446,7 @@ WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, int3 } else if (!(strcmp(operation, "replace"))) { - status.Assign("Replacing HistoryIndex: "); + status.AssignLiteral("Replacing HistoryIndex: "); AppendIntToCString(info1, status); } diff --git a/extensions/gio/nsGIOProtocolHandler.cpp b/extensions/gio/nsGIOProtocolHandler.cpp index acc7be41a9d..59a7a99b950 100644 --- a/extensions/gio/nsGIOProtocolHandler.cpp +++ b/extensions/gio/nsGIOProtocolHandler.cpp @@ -473,7 +473,7 @@ nsGIOInputStream::DoRead(char *aBuf, uint32_t aCount, uint32_t *aCountRead) continue; } - mDirBuf.Assign("201: "); + mDirBuf.AssignLiteral("201: "); // The "filename" field nsCString escName; @@ -932,7 +932,7 @@ nsGIOProtocolHandler::InitSupportedProtocolsPref(nsIPrefBranch *prefs) ToLowerCase(mSupportedProtocols); } else - mSupportedProtocols.Assign("smb:,sftp:"); // use defaults + mSupportedProtocols.AssignLiteral("smb:,sftp:"); // use defaults LOG(("gio: supported protocols \"%s\"\n", mSupportedProtocols.get())); } diff --git a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp index ad7e3db46e0..8fc6f1460f8 100644 --- a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp +++ b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp @@ -522,7 +522,7 @@ nsGnomeVFSInputStream::DoRead(char *aBuf, uint32_t aCount, uint32_t *aCountRead) continue; } - mDirBuf.Assign("201: "); + mDirBuf.AssignLiteral("201: "); // The "filename" field nsCString escName; @@ -794,7 +794,7 @@ nsGnomeVFSProtocolHandler::InitSupportedProtocolsPref(nsIPrefBranch *prefs) ToLowerCase(mSupportedProtocols); } else - mSupportedProtocols.Assign("smb:,sftp:"); // use defaults + mSupportedProtocols.AssignLiteral("smb:,sftp:"); // use defaults LOG(("gnomevfs: supported protocols \"%s\"\n", mSupportedProtocols.get())); } diff --git a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp index d0f33d1fd01..a70b54102c7 100644 --- a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp +++ b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp @@ -46,7 +46,7 @@ nsresult nsDateTimeFormatUnix::Initialize(nsILocale* locale) } mCharset.AssignLiteral("windows-1252"); - mPlatformLocale.Assign("en_US"); + mPlatformLocale.AssignLiteral("en_US"); // get locale name string, use app default if no locale specified if (!locale) { diff --git a/js/jsd/jsd_xpc.cpp b/js/jsd/jsd_xpc.cpp index ac5c5522af8..647233f476b 100644 --- a/js/jsd/jsd_xpc.cpp +++ b/js/jsd/jsd_xpc.cpp @@ -1911,7 +1911,7 @@ jsdStackFrame::GetFunctionName(nsACString &_rval) if (str) return AssignToJSString(mCx, &_rval, str); - _rval.Assign("anonymous"); + _rval.AssignLiteral("anonymous"); return NS_OK; } diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp index d1b69ee2596..bd49055c527 100644 --- a/js/xpconnect/src/Sandbox.cpp +++ b/js/xpconnect/src/Sandbox.cpp @@ -507,7 +507,7 @@ EvalInWindow(JSContext *cx, const nsAString &source, HandleObject scope, Mutable unsigned lineNo; if (!GetFilenameAndLineNumber(cx, filename, lineNo)) { // Default values for non-scripted callers. - filename.Assign("Unknown"); + filename.AssignLiteral("Unknown"); lineNo = 0; } diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp index 2ac5172b63b..f614b02a9ef 100644 --- a/netwerk/cache2/CacheFileIOManager.cpp +++ b/netwerk/cache2/CacheFileIOManager.cpp @@ -3298,7 +3298,7 @@ CacheFileIOManager::CreateFile(CacheFileHandle *aHandle) void CacheFileIOManager::HashToStr(const SHA1Sum::Hash *aHash, nsACString &_retval) { - _retval.Assign(""); + _retval.AssignLiteral(""); const char hexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; for (uint32_t i=0 ; iAssign("PING"); + buf->AssignLiteral("PING"); EnqueueOutgoingMessage(mOutgoingPingMessages, new OutboundMessage(kMsgTypePing, buf)); } diff --git a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp index 8aa1a491404..f39a4eb9441 100644 --- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp +++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp @@ -513,7 +513,7 @@ WyciwygChannelChild::SetContentType(const nsACString & aContentType) NS_IMETHODIMP WyciwygChannelChild::GetContentCharset(nsACString & aContentCharset) { - aContentCharset.Assign("UTF-16"); + aContentCharset.AssignLiteral("UTF-16"); return NS_OK; } NS_IMETHODIMP diff --git a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp index 95ccc2e0bc7..536dbae317f 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp +++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp @@ -336,7 +336,7 @@ nsWyciwygChannel::SetContentType(const nsACString &aContentType) NS_IMETHODIMP nsWyciwygChannel::GetContentCharset(nsACString &aContentCharset) { - aContentCharset.Assign("UTF-16"); + aContentCharset.AssignLiteral("UTF-16"); return NS_OK; } diff --git a/parser/html/nsHtml5MetaScannerCppSupplement.h b/parser/html/nsHtml5MetaScannerCppSupplement.h index b91a27475c0..5e70337771b 100644 --- a/parser/html/nsHtml5MetaScannerCppSupplement.h +++ b/parser/html/nsHtml5MetaScannerCppSupplement.h @@ -32,12 +32,12 @@ nsHtml5MetaScanner::tryCharset(nsString* charset) } if (encoding.EqualsLiteral("UTF-16BE") || encoding.EqualsLiteral("UTF-16LE")) { - mCharset.Assign("UTF-8"); + mCharset.AssignLiteral("UTF-8"); return true; } if (encoding.EqualsLiteral("x-user-defined")) { // WebKit/Blink hack for Indian and Armenian legacy sites - mCharset.Assign("windows-1252"); + mCharset.AssignLiteral("windows-1252"); return true; } mCharset.Assign(encoding); diff --git a/parser/html/nsHtml5Parser.cpp b/parser/html/nsHtml5Parser.cpp index b4d2385fd4c..5bb0c4ca790 100644 --- a/parser/html/nsHtml5Parser.cpp +++ b/parser/html/nsHtml5Parser.cpp @@ -70,7 +70,7 @@ nsHtml5Parser::GetContentSink() NS_IMETHODIMP_(void) nsHtml5Parser::GetCommand(nsCString& aCommand) { - aCommand.Assign("view"); + aCommand.AssignLiteral("view"); } NS_IMETHODIMP_(void) diff --git a/parser/html/nsHtml5StreamParser.cpp b/parser/html/nsHtml5StreamParser.cpp index 85b696b88a6..0b6c7cce973 100644 --- a/parser/html/nsHtml5StreamParser.cpp +++ b/parser/html/nsHtml5StreamParser.cpp @@ -373,9 +373,9 @@ nsHtml5StreamParser::SniffBOMlessUTF16BasicLatin(const uint8_t* aFromSegment, } if (byteNonZero[0]) { - mCharset.Assign("UTF-16LE"); + mCharset.AssignLiteral("UTF-16LE"); } else { - mCharset.Assign("UTF-16BE"); + mCharset.AssignLiteral("UTF-16BE"); } mCharsetSource = kCharsetFromIrreversibleAutoDetection; mTreeBuilder->SetDocumentCharset(mCharset, mCharsetSource); @@ -1201,7 +1201,7 @@ nsHtml5StreamParser::PreferredForInternalEncodingDecl(nsACString& aEncoding) mTreeBuilder->MaybeComplainAboutCharset("EncMetaUtf16", true, mTokenizer->getLineNumber()); - newEncoding.Assign("UTF-8"); + newEncoding.AssignLiteral("UTF-8"); } if (newEncoding.EqualsLiteral("x-user-defined")) { @@ -1209,7 +1209,7 @@ nsHtml5StreamParser::PreferredForInternalEncodingDecl(nsACString& aEncoding) mTreeBuilder->MaybeComplainAboutCharset("EncMetaUserDefined", true, mTokenizer->getLineNumber()); - newEncoding.Assign("windows-1252"); + newEncoding.AssignLiteral("windows-1252"); } if (newEncoding.Equals(mCharset)) { diff --git a/toolkit/components/satchel/nsFormFillController.cpp b/toolkit/components/satchel/nsFormFillController.cpp index 315fc68437f..cafdbb2a635 100644 --- a/toolkit/components/satchel/nsFormFillController.cpp +++ b/toolkit/components/satchel/nsFormFillController.cpp @@ -466,7 +466,7 @@ nsFormFillController::GetSearchCount(uint32_t *aSearchCount) NS_IMETHODIMP nsFormFillController::GetSearchAt(uint32_t index, nsACString & _retval) { - _retval.Assign("form-history"); + _retval.AssignLiteral("form-history"); return NS_OK; } diff --git a/xulrunner/app/nsXULRunnerApp.cpp b/xulrunner/app/nsXULRunnerApp.cpp index eb900e14667..015e8296b14 100644 --- a/xulrunner/app/nsXULRunnerApp.cpp +++ b/xulrunner/app/nsXULRunnerApp.cpp @@ -92,9 +92,9 @@ GetGREVersion(const char *argv0, nsACString *aVersion) { if (aMilestone) - aMilestone->Assign(""); + aMilestone->AssignLiteral(""); if (aVersion) - aVersion->Assign(""); + aVersion->AssignLiteral(""); nsCOMPtr iniFile; nsresult rv = BinaryPath::GetFile(argv0, getter_AddRefs(iniFile));