From aea8617b92f84bac83776b53af502d0a78db2a24 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Thu, 22 May 2014 06:48:51 +0300 Subject: [PATCH] Bug 869836 - Part 7: Use AppendLiteral instead of Append where possible. r=ehsan --- accessible/src/atk/Platform.cpp | 6 +- .../shell/src/nsGNOMEShellService.cpp | 2 +- content/base/src/nsXMLHttpRequest.cpp | 6 +- .../src/nsXULTemplateQueryProcessorRDF.cpp | 2 +- dom/base/nsJSEnvironment.cpp | 10 ++-- .../base/nsNPAPIPluginStreamListener.cpp | 2 +- dom/plugins/base/nsPluginHost.cpp | 2 +- dom/plugins/ipc/PluginModuleParent.cpp | 4 +- dom/xbl/nsXBLWindowKeyHandler.cpp | 2 +- embedding/tests/winEmbed/WebBrowserChrome.cpp | 6 +- extensions/gio/nsGIOProtocolHandler.cpp | 12 ++-- .../gnomevfs/nsGnomeVFSProtocolHandler.cpp | 12 ++-- gfx/gl/GLBlitTextureImageHelper.cpp | 2 +- gfx/layers/LayerScope.cpp | 10 ++-- gfx/thebes/gfxFT2FontList.cpp | 2 +- image/src/imgLoader.cpp | 2 +- intl/unicharutil/src/nsEntityConverter.cpp | 2 +- ipc/glue/WindowsMessageLoop.cpp | 2 +- layout/base/nsLayoutUtils.cpp | 2 +- layout/style/nsFontFaceLoader.cpp | 10 ++-- modules/libpref/src/prefapi.cpp | 8 +-- netwerk/protocol/http/Http2Compression.cpp | 2 +- rdf/base/src/nsRDFService.cpp | 2 +- rdf/base/src/rdfutil.cpp | 2 +- rdf/util/src/nsRDFResource.cpp | 2 +- .../boot/src/nsSecureBrowserUIImpl.cpp | 36 ++++++------ security/manager/ssl/src/nsNSSIOLayer.cpp | 4 +- startupcache/StartupCacheUtils.cpp | 2 +- storage/src/mozStorageConnection.cpp | 8 +-- storage/src/mozStoragePrivateHelpers.cpp | 8 +-- storage/test/storage_test_harness.h | 2 +- .../downloads/ApplicationReputation.cpp | 12 ++-- toolkit/components/places/Helpers.cpp | 2 +- toolkit/components/places/nsNavHistory.cpp | 2 +- .../components/url-classifier/Classifier.cpp | 4 +- toolkit/system/gnome/nsGConfService.cpp | 6 +- toolkit/xre/nsX11ErrorHandler.cpp | 14 ++--- .../exthandler/nsExternalHelperAppService.cpp | 2 +- widget/gtk/nsCUPSShim.cpp | 2 +- widget/tests/TestWinTSF.cpp | 2 +- widget/windows/GfxInfo.cpp | 14 ++--- widget/windows/WinUtils.cpp | 2 +- widget/windows/nsDataObj.cpp | 2 +- widget/windows/nsImageClipboard.cpp | 2 +- widget/xpwidgets/GfxInfoX11.cpp | 8 +-- xpcom/base/SystemMemoryReporter.cpp | 56 ++++++++++--------- xpcom/glue/BlockingResourceBase.cpp | 4 +- 47 files changed, 156 insertions(+), 152 deletions(-) diff --git a/accessible/src/atk/Platform.cpp b/accessible/src/atk/Platform.cpp index 7be743ca7fed..42f52becadda 100644 --- a/accessible/src/atk/Platform.cpp +++ b/accessible/src/atk/Platform.cpp @@ -79,9 +79,9 @@ LoadGtkModule(GnomeAccessibilityModule& aModule) char *curLibPath = PR_GetLibraryPath(); nsAutoCString libPath(curLibPath); #if defined(LINUX) && defined(__x86_64__) - libPath.Append(":/usr/lib64:/usr/lib"); + libPath.AppendLiteral(":/usr/lib64:/usr/lib"); #else - libPath.Append(":/usr/lib"); + libPath.AppendLiteral(":/usr/lib"); #endif PR_FreeLibraryName(curLibPath); @@ -94,7 +94,7 @@ LoadGtkModule(GnomeAccessibilityModule& aModule) else subLen = loc2 - loc1; nsAutoCString sub(Substring(libPath, loc1, subLen)); - sub.Append("/gtk-2.0/modules/"); + sub.AppendLiteral("/gtk-2.0/modules/"); sub.Append(aModule.libName); aModule.lib = PR_LoadLibrary(sub.get()); if (aModule.lib) diff --git a/browser/components/shell/src/nsGNOMEShellService.cpp b/browser/components/shell/src/nsGNOMEShellService.cpp index 555ad81655e4..2d6be344288a 100644 --- a/browser/components/shell/src/nsGNOMEShellService.cpp +++ b/browser/components/shell/src/nsGNOMEShellService.cpp @@ -439,7 +439,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement, // build the file name filePath.Append('/'); filePath.Append(NS_ConvertUTF16toUTF8(brandName)); - filePath.Append("_wallpaper.png"); + filePath.AppendLiteral("_wallpaper.png"); // write the image to a file in the home dir rv = WriteImage(filePath, container); diff --git a/content/base/src/nsXMLHttpRequest.cpp b/content/base/src/nsXMLHttpRequest.cpp index 78c573542ecb..067009020f4c 100644 --- a/content/base/src/nsXMLHttpRequest.cpp +++ b/content/base/src/nsXMLHttpRequest.cpp @@ -1379,7 +1379,7 @@ nsXMLHttpRequest::GetResponseHeader(const nsACString& header, nsCString value; if (NS_SUCCEEDED(mChannel->GetContentCharset(value)) && !value.IsEmpty()) { - _retval.Append(";charset="); + _retval.AppendLiteral(";charset="); _retval.Append(value); } } @@ -3877,9 +3877,9 @@ nsHeaderVisitor::VisitHeader(const nsACString &header, const nsACString &value) { if (mXHR->IsSafeHeader(header, mHttpChannel)) { mHeaders.Append(header); - mHeaders.Append(": "); + mHeaders.AppendLiteral(": "); mHeaders.Append(value); - mHeaders.Append("\r\n"); + mHeaders.AppendLiteral("\r\n"); } return NS_OK; } diff --git a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp index 59af1b08ac1c..9b7c2cca24b4 100644 --- a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp +++ b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp @@ -252,7 +252,7 @@ nsXULTemplateQueryProcessorRDF::GetDatasource(nsIArray* aDataSources, // security, a bad URL, etc. #ifdef DEBUG nsAutoCString msg; - msg.Append("unable to load datasource '"); + msg.AppendLiteral("unable to load datasource '"); msg.Append(uristrC); msg.Append('\''); NS_WARNING(msg.get()); diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 6b52f1d01d20..38c5270d9f6d 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -605,15 +605,15 @@ NS_ScriptErrorReporter(JSContext *cx, nsAutoCString error; error.AssignLiteral("JavaScript "); if (JSREPORT_IS_STRICT(report->flags)) - error.Append("strict "); + error.AppendLiteral("strict "); if (JSREPORT_IS_WARNING(report->flags)) - error.Append("warning: "); + error.AppendLiteral("warning: "); else - error.Append("error: "); + error.AppendLiteral("error: "); error.Append(report->filename); - error.Append(", line "); + error.AppendLiteral(", line "); error.AppendInt(report->lineno, 10); - error.Append(": "); + error.AppendLiteral(": "); if (report->ucmessage) { AppendUTF16toUTF8(reinterpret_cast(report->ucmessage), error); diff --git a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp index 312628cc9005..aa4bfbdeb156 100644 --- a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp +++ b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp @@ -822,7 +822,7 @@ nsNPAPIPluginStreamListener::NewResponseHeader(const char* headerName, const char* headerValue) { mResponseHeaders.Append(headerName); - mResponseHeaders.Append(": "); + mResponseHeaders.AppendLiteral(": "); mResponseHeaders.Append(headerValue); mResponseHeaders.Append('\n'); return NS_OK; diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index a144da3c678d..f6dab16edd26 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -2281,7 +2281,7 @@ nsPluginHost::WritePluginInfo() return rv; nsAutoCString filename(kPluginRegistryFilename); - filename.Append(".tmp"); + filename.AppendLiteral(".tmp"); rv = pluginReg->AppendNative(filename); if (NS_FAILED(rv)) return rv; diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp index edc88d12435c..06e01753a7a4 100755 --- a/dom/plugins/ipc/PluginModuleParent.cpp +++ b/dom/plugins/ipc/PluginModuleParent.cpp @@ -474,11 +474,11 @@ PluginModuleParent::TerminateChildProcess(MessageLoop* aMsgLoop) if (CreateFlashMinidump(mFlashProcess1, 0, pluginDumpFile, NS_LITERAL_CSTRING("flash1"))) { - additionalDumps.Append(",flash1"); + additionalDumps.AppendLiteral(",flash1"); } if (CreateFlashMinidump(mFlashProcess2, 0, pluginDumpFile, NS_LITERAL_CSTRING("flash2"))) { - additionalDumps.Append(",flash2"); + additionalDumps.AppendLiteral(",flash2"); } } #endif diff --git a/dom/xbl/nsXBLWindowKeyHandler.cpp b/dom/xbl/nsXBLWindowKeyHandler.cpp index 858f2ba72ab1..b298614238ab 100644 --- a/dom/xbl/nsXBLWindowKeyHandler.cpp +++ b/dom/xbl/nsXBLWindowKeyHandler.cpp @@ -149,7 +149,7 @@ nsXBLSpecialDocInfo::GetAllHandlers(const char* aType, { if (mUserHTMLBindings) { nsAutoCString type(aType); - type.Append("User"); + type.AppendLiteral("User"); GetHandlers(mUserHTMLBindings, type, aUserHandler); } if (mHTMLBindings) { diff --git a/embedding/tests/winEmbed/WebBrowserChrome.cpp b/embedding/tests/winEmbed/WebBrowserChrome.cpp index 7bd02b3080ec..07b4facd8e8c 100644 --- a/embedding/tests/winEmbed/WebBrowserChrome.cpp +++ b/embedding/tests/winEmbed/WebBrowserChrome.cpp @@ -428,7 +428,7 @@ WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, int3 else if (!(strcmp(operation, "add"))) { status.Assign(uriSpec); - status.Append(" added to session History"); + status.AppendLiteral(" added to session History"); } else if (!(strcmp(operation, "goto"))) { @@ -436,13 +436,13 @@ WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, int3 AppendIntToCString(info1, status); - status.Append(" Url: "); + status.AppendLiteral(" Url: "); status.Append(uriSpec); } else if (!(strcmp(operation, "purge"))) { AppendIntToCString(info1, status); - status.Append(" purged from Session History"); + status.AppendLiteral(" purged from Session History"); } else if (!(strcmp(operation, "replace"))) { diff --git a/extensions/gio/nsGIOProtocolHandler.cpp b/extensions/gio/nsGIOProtocolHandler.cpp index 59a7a99b950f..85232c370e45 100644 --- a/extensions/gio/nsGIOProtocolHandler.cpp +++ b/extensions/gio/nsGIOProtocolHandler.cpp @@ -285,18 +285,18 @@ nsGIOInputStream::DoOpenDirectory() mDirListPtr = mDirList; // Write base URL (make sure it ends with a '/') - mDirBuf.Append("300: "); + mDirBuf.AppendLiteral("300: "); mDirBuf.Append(mSpec); if (mSpec.get()[mSpec.Length() - 1] != '/') mDirBuf.Append('/'); mDirBuf.Append('\n'); // Write column names - mDirBuf.Append("200: filename content-length last-modified file-type\n"); + mDirBuf.AppendLiteral("200: filename content-length last-modified file-type\n"); // Write charset (assume UTF-8) // XXX is this correct? - mDirBuf.Append("301: UTF-8\n"); + mDirBuf.AppendLiteral("301: UTF-8\n"); SetContentTypeOfChannel(APPLICATION_HTTP_INDEX_FORMAT); return NS_OK; } @@ -512,13 +512,13 @@ nsGIOInputStream::DoRead(char *aBuf, uint32_t aCount, uint32_t *aCountRead) switch (g_file_info_get_file_type(info)) { case G_FILE_TYPE_REGULAR: - mDirBuf.Append("FILE "); + mDirBuf.AppendLiteral("FILE "); break; case G_FILE_TYPE_DIRECTORY: - mDirBuf.Append("DIRECTORY "); + mDirBuf.AppendLiteral("DIRECTORY "); break; case G_FILE_TYPE_SYMBOLIC_LINK: - mDirBuf.Append("SYMBOLIC-LINK "); + mDirBuf.AppendLiteral("SYMBOLIC-LINK "); break; default: break; diff --git a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp index 8fc6f1460f8d..b8d243f2a597 100644 --- a/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp +++ b/extensions/gnomevfs/nsGnomeVFSProtocolHandler.cpp @@ -450,18 +450,18 @@ nsGnomeVFSInputStream::DoOpen() mDirListPtr = mDirList; // Write base URL (make sure it ends with a '/') - mDirBuf.Append("300: "); + mDirBuf.AppendLiteral("300: "); mDirBuf.Append(mSpec); if (mSpec.get()[mSpec.Length() - 1] != '/') mDirBuf.Append('/'); mDirBuf.Append('\n'); // Write column names - mDirBuf.Append("200: filename content-length last-modified file-type\n"); + mDirBuf.AppendLiteral("200: filename content-length last-modified file-type\n"); // Write charset (assume UTF-8) // XXX is this correct? - mDirBuf.Append("301: UTF-8\n"); + mDirBuf.AppendLiteral("301: UTF-8\n"); SetContentTypeOfChannel(APPLICATION_HTTP_INDEX_FORMAT); } @@ -558,13 +558,13 @@ nsGnomeVFSInputStream::DoRead(char *aBuf, uint32_t aCount, uint32_t *aCountRead) switch (info->type) { case GNOME_VFS_FILE_TYPE_REGULAR: - mDirBuf.Append("FILE "); + mDirBuf.AppendLiteral("FILE "); break; case GNOME_VFS_FILE_TYPE_DIRECTORY: - mDirBuf.Append("DIRECTORY "); + mDirBuf.AppendLiteral("DIRECTORY "); break; case GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK: - mDirBuf.Append("SYMBOLIC-LINK "); + mDirBuf.AppendLiteral("SYMBOLIC-LINK "); break; default: break; diff --git a/gfx/gl/GLBlitTextureImageHelper.cpp b/gfx/gl/GLBlitTextureImageHelper.cpp index d4557e2069e5..1c7884927e66 100644 --- a/gfx/gl/GLBlitTextureImageHelper.cpp +++ b/gfx/gl/GLBlitTextureImageHelper.cpp @@ -189,7 +189,7 @@ GLBlitTextureImageHelper::SetBlitFramebufferForDestTexture(GLuint aTexture) GLenum result = mGL->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER); if (aTexture && (result != LOCAL_GL_FRAMEBUFFER_COMPLETE)) { nsAutoCString msg; - msg.Append("Framebuffer not complete -- error 0x"); + msg.AppendLiteral("Framebuffer not complete -- error 0x"); msg.AppendInt(result, 16); // Note: if you are hitting this, it is likely that // your texture is not texture complete -- that is, you diff --git a/gfx/layers/LayerScope.cpp b/gfx/layers/LayerScope.cpp index f43bef66c153..648eb467d467 100644 --- a/gfx/layers/LayerScope.cpp +++ b/gfx/layers/LayerScope.cpp @@ -223,7 +223,9 @@ private: return false; } - if (!(version.EqualsLiteral("7") || version.EqualsLiteral("8") || version.EqualsLiteral("13"))) { + if (!(version.EqualsLiteral("7") || + version.EqualsLiteral("8") || + version.EqualsLiteral("13"))) { return false; } @@ -243,10 +245,10 @@ private: Base64Encode(newString, res); nsCString response("HTTP/1.1 101 Switching Protocols\r\n"); - response.Append("Upgrade: websocket\r\n"); - response.Append("Connection: Upgrade\r\n"); + response.AppendLiteral("Upgrade: websocket\r\n"); + response.AppendLiteral("Connection: Upgrade\r\n"); response.Append(nsCString("Sec-WebSocket-Accept: ") + res + nsCString("\r\n")); - response.Append("Sec-WebSocket-Protocol: binary\r\n\r\n"); + response.AppendLiteral("Sec-WebSocket-Protocol: binary\r\n\r\n"); uint32_t written = 0; uint32_t size = response.Length(); while (written < size) { diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index d2e3ee082b17..536d6042ba2a 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -1242,7 +1242,7 @@ gfxFT2FontList::FindFonts() } else { root = NS_LITERAL_CSTRING("/system"); } - root.Append("/fonts"); + root.AppendLiteral("/fonts"); FindFontsInDir(root, &fnc); diff --git a/image/src/imgLoader.cpp b/image/src/imgLoader.cpp index 171d7bec0693..e5fd747e9f78 100644 --- a/image/src/imgLoader.cpp +++ b/image/src/imgLoader.cpp @@ -128,7 +128,7 @@ public: #define REPORT_VECTOR(_path, _uri, _amount, _desc) \ do { \ nsAutoCString path(NS_LITERAL_CSTRING(_path)); \ - path.Append("/("); \ + path.AppendLiteral("/("); \ path.Append(_uri); \ path.Append(")"); \ nsresult rv; \ diff --git a/intl/unicharutil/src/nsEntityConverter.cpp b/intl/unicharutil/src/nsEntityConverter.cpp index d918d31e5edf..ad3aaa0f2236 100644 --- a/intl/unicharutil/src/nsEntityConverter.cpp +++ b/intl/unicharutil/src/nsEntityConverter.cpp @@ -85,7 +85,7 @@ nsEntityConverter::LoadEntityBundle(uint32_t version) // all property file names are ASCII, like "html40Latin1" so this is safe LossyAppendUTF16toASCII(versionName, url); - url.Append(".properties"); + url.AppendLiteral(".properties"); nsCOMPtr bundle; rv = bundleService->CreateBundle(url.get(), getter_AddRefs(bundle)); diff --git a/ipc/glue/WindowsMessageLoop.cpp b/ipc/glue/WindowsMessageLoop.cpp index 5970133c1adc..3f7a676b1c04 100644 --- a/ipc/glue/WindowsMessageLoop.cpp +++ b/ipc/glue/WindowsMessageLoop.cpp @@ -419,7 +419,7 @@ WindowIsDeferredWindow(HWND hWnd) if (appInfo) { nsAutoCString appName; if (NS_SUCCEEDED(appInfo->GetName(appName))) { - appName.Append("MessageWindow"); + appName.AppendLiteral("MessageWindow"); nsDependentString windowName(gAppMessageWindowName); CopyUTF8toUTF16(appName, windowName); gAppMessageWindowNameLength = windowName.Length(); diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index a79ab33b97a6..935132cbe02b 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -2823,7 +2823,7 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram if (gfxUtils::sDumpPaintingToFile) { nsCString string("dump-"); string.AppendInt(gPaintCount); - string.Append(".html"); + string.AppendLiteral(".html"); gfxUtils::sDumpPaintFile = fopen(string.BeginReading(), "w"); } else { gfxUtils::sDumpPaintFile = stderr; diff --git a/layout/style/nsFontFaceLoader.cpp b/layout/style/nsFontFaceLoader.cpp index 4fdd56762b05..3116f099751b 100644 --- a/layout/style/nsFontFaceLoader.cpp +++ b/layout/style/nsFontFaceLoader.cpp @@ -804,21 +804,21 @@ nsUserFontSet::LogMessage(gfxMixedFontFamily* aFamily, aProxy->mSrcIndex); if (NS_FAILED(aStatus)) { - message.Append(": "); + message.AppendLiteral(": "); switch (aStatus) { case NS_ERROR_DOM_BAD_URI: - message.Append("bad URI or cross-site access not allowed"); + message.AppendLiteral("bad URI or cross-site access not allowed"); break; case NS_ERROR_CONTENT_BLOCKED: - message.Append("content blocked"); + message.AppendLiteral("content blocked"); break; default: - message.Append("status="); + message.AppendLiteral("status="); message.AppendInt(static_cast(aStatus)); break; } } - message.Append("\nsource: "); + message.AppendLiteral("\nsource: "); message.Append(fontURI); #ifdef PR_LOGGING diff --git a/modules/libpref/src/prefapi.cpp b/modules/libpref/src/prefapi.cpp index 50a8988f8cf9..5a31907e39a9 100644 --- a/modules/libpref/src/prefapi.cpp +++ b/modules/libpref/src/prefapi.cpp @@ -217,19 +217,19 @@ static void str_escape(const char * original, nsAFlatCString& aResult) switch (*p) { case '\n': - aResult.Append("\\n"); + aResult.AppendLiteral("\\n"); break; case '\r': - aResult.Append("\\r"); + aResult.AppendLiteral("\\r"); break; case '\\': - aResult.Append("\\\\"); + aResult.AppendLiteral("\\\\"); break; case '\"': - aResult.Append("\\\""); + aResult.AppendLiteral("\\\""); break; default: diff --git a/netwerk/protocol/http/Http2Compression.cpp b/netwerk/protocol/http/Http2Compression.cpp index fdc44bbc2551..c3e8d3c45f4b 100644 --- a/netwerk/protocol/http/Http2Compression.cpp +++ b/netwerk/protocol/http/Http2Compression.cpp @@ -1019,7 +1019,7 @@ Http2Compressor::EncodeHeaderBlock(const nsCString &nvInput, nextCookie = semiSpaceIndex + 2; } } else { - ProcessHeader(nvPair(name, value), name.EqualsLiteral("authorization") ? true : false); + ProcessHeader(nvPair(name, value), name.EqualsLiteral("authorization")); } } diff --git a/rdf/base/src/nsRDFService.cpp b/rdf/base/src/nsRDFService.cpp index bcfdce3f20a8..936d0037a3c9 100644 --- a/rdf/base/src/nsRDFService.cpp +++ b/rdf/base/src/nsRDFService.cpp @@ -1009,7 +1009,7 @@ static int32_t kShift = 6; // service. Now that it's a member we can be more cleverer. s.Truncate(); - s.Append("rdf:#$"); + s.AppendLiteral("rdf:#$"); uint32_t id = ++gCounter; while (id) { diff --git a/rdf/base/src/rdfutil.cpp b/rdf/base/src/rdfutil.cpp index b4af38f77253..9a3f794b06a7 100644 --- a/rdf/base/src/rdfutil.cpp +++ b/rdf/base/src/rdfutil.cpp @@ -67,7 +67,7 @@ rdf_FormatDate(PRTime aTime, nsACString &aResult) aResult.Append(buf); // usecs - aResult.Append(" +"); + aResult.AppendLiteral(" +"); int32_t usec = t.tm_usec; for (int32_t digit = 100000; digit > 1; digit /= 10) { aResult.Append(char('0' + (usec / digit))); diff --git a/rdf/util/src/nsRDFResource.cpp b/rdf/util/src/nsRDFResource.cpp index 008138bd67d0..f7920667b1de 100644 --- a/rdf/util/src/nsRDFResource.cpp +++ b/rdf/util/src/nsRDFResource.cpp @@ -155,7 +155,7 @@ nsRDFResource::GetDelegate(const char* aKey, REFNSIID aIID, void** aResult) // Construct a ContractID of the form "@mozilla.org/rdf/delegate/[key]/[scheme];1 nsAutoCString contractID(NS_RDF_DELEGATEFACTORY_CONTRACTID_PREFIX); contractID.Append(aKey); - contractID.Append("&scheme="); + contractID.AppendLiteral("&scheme="); int32_t i = mURI.FindChar(':'); contractID += StringHead(mURI, i); diff --git a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp index 6845c3a03f05..2a2f78afc369 100644 --- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp +++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp @@ -814,17 +814,17 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, if (testFlags & nsIChannel::LOAD_DOCUMENT_URI) { testFlags -= nsIChannel::LOAD_DOCUMENT_URI; - info2.Append("LOAD_DOCUMENT_URI "); + info2.AppendLiteral("LOAD_DOCUMENT_URI "); } if (testFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) { testFlags -= nsIChannel::LOAD_RETARGETED_DOCUMENT_URI; - info2.Append("LOAD_RETARGETED_DOCUMENT_URI "); + info2.AppendLiteral("LOAD_RETARGETED_DOCUMENT_URI "); } if (testFlags & nsIChannel::LOAD_REPLACE) { testFlags -= nsIChannel::LOAD_REPLACE; - info2.Append("LOAD_REPLACE "); + info2.AppendLiteral("LOAD_REPLACE "); } const char *_status = NS_SUCCEEDED(aStatus) ? "1" : "0"; @@ -834,77 +834,77 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress, if (f & nsIWebProgressListener::STATE_START) { f -= nsIWebProgressListener::STATE_START; - info.Append("START "); + info.AppendLiteral("START "); } if (f & nsIWebProgressListener::STATE_REDIRECTING) { f -= nsIWebProgressListener::STATE_REDIRECTING; - info.Append("REDIRECTING "); + info.AppendLiteral("REDIRECTING "); } if (f & nsIWebProgressListener::STATE_TRANSFERRING) { f -= nsIWebProgressListener::STATE_TRANSFERRING; - info.Append("TRANSFERRING "); + info.AppendLiteral("TRANSFERRING "); } if (f & nsIWebProgressListener::STATE_NEGOTIATING) { f -= nsIWebProgressListener::STATE_NEGOTIATING; - info.Append("NEGOTIATING "); + info.AppendLiteral("NEGOTIATING "); } if (f & nsIWebProgressListener::STATE_STOP) { f -= nsIWebProgressListener::STATE_STOP; - info.Append("STOP "); + info.AppendLiteral("STOP "); } if (f & nsIWebProgressListener::STATE_IS_REQUEST) { f -= nsIWebProgressListener::STATE_IS_REQUEST; - info.Append("IS_REQUEST "); + info.AppendLiteral("IS_REQUEST "); } if (f & nsIWebProgressListener::STATE_IS_DOCUMENT) { f -= nsIWebProgressListener::STATE_IS_DOCUMENT; - info.Append("IS_DOCUMENT "); + info.AppendLiteral("IS_DOCUMENT "); } if (f & nsIWebProgressListener::STATE_IS_NETWORK) { f -= nsIWebProgressListener::STATE_IS_NETWORK; - info.Append("IS_NETWORK "); + info.AppendLiteral("IS_NETWORK "); } if (f & nsIWebProgressListener::STATE_IS_WINDOW) { f -= nsIWebProgressListener::STATE_IS_WINDOW; - info.Append("IS_WINDOW "); + info.AppendLiteral("IS_WINDOW "); } if (f & nsIWebProgressListener::STATE_IS_INSECURE) { f -= nsIWebProgressListener::STATE_IS_INSECURE; - info.Append("IS_INSECURE "); + info.AppendLiteral("IS_INSECURE "); } if (f & nsIWebProgressListener::STATE_IS_BROKEN) { f -= nsIWebProgressListener::STATE_IS_BROKEN; - info.Append("IS_BROKEN "); + info.AppendLiteral("IS_BROKEN "); } if (f & nsIWebProgressListener::STATE_IS_SECURE) { f -= nsIWebProgressListener::STATE_IS_SECURE; - info.Append("IS_SECURE "); + info.AppendLiteral("IS_SECURE "); } if (f & nsIWebProgressListener::STATE_SECURE_HIGH) { f -= nsIWebProgressListener::STATE_SECURE_HIGH; - info.Append("SECURE_HIGH "); + info.AppendLiteral("SECURE_HIGH "); } if (f & nsIWebProgressListener::STATE_RESTORING) { f -= nsIWebProgressListener::STATE_RESTORING; - info.Append("STATE_RESTORING "); + info.AppendLiteral("STATE_RESTORING "); } if (f > 0) { - info.Append("f contains unknown flag!"); + info.AppendLiteral("f contains unknown flag!"); } PR_LOG(gSecureDocLog, PR_LOG_DEBUG, diff --git a/security/manager/ssl/src/nsNSSIOLayer.cpp b/security/manager/ssl/src/nsNSSIOLayer.cpp index dcbb6584a552..a64a97375112 100644 --- a/security/manager/ssl/src/nsNSSIOLayer.cpp +++ b/security/manager/ssl/src/nsNSSIOLayer.cpp @@ -2339,10 +2339,10 @@ nsSSLIOLayerSetOptions(PRFileDesc* fd, bool forSTARTTLS, uint32_t flags = infoObject->GetProviderFlags(); nsAutoCString peerId; if (flags & nsISocketProvider::ANONYMOUS_CONNECT) { // See bug 466080 - peerId.Append("anon:"); + peerId.AppendLiteral("anon:"); } if (flags & nsISocketProvider::NO_PERMANENT_STORAGE) { - peerId.Append("private:"); + peerId.AppendLiteral("private:"); } peerId.Append(host); peerId.Append(':'); diff --git a/startupcache/StartupCacheUtils.cpp b/startupcache/StartupCacheUtils.cpp index 3f032e933223..a02452ae8cc8 100644 --- a/startupcache/StartupCacheUtils.cpp +++ b/startupcache/StartupCacheUtils.cpp @@ -135,7 +135,7 @@ canonicalizeBase(nsAutoCString &spec, if (underGre && underApp && greBase.Length() < appBase.Length()) underGre = false; - out.Append("/resource/"); + out.AppendLiteral("/resource/"); out.Append(baseName[underGre ? mozilla::Omnijar::GRE : mozilla::Omnijar::APP]); out.Append(Substring(spec, underGre ? greBase.Length() : appBase.Length())); return true; diff --git a/storage/src/mozStorageConnection.cpp b/storage/src/mozStorageConnection.cpp index a89054c0fc10..c1a20874588c 100644 --- a/storage/src/mozStorageConnection.cpp +++ b/storage/src/mozStorageConnection.cpp @@ -733,17 +733,17 @@ Connection::databaseElementExists(enum DatabaseElementType aElementType, element.Assign(Substring(aElementName, ind + 1, aElementName.Length())); query.Append(db); } - query.Append("sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE type = '"); + query.AppendLiteral("sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE type = '"); switch (aElementType) { case INDEX: - query.Append("index"); + query.AppendLiteral("index"); break; case TABLE: - query.Append("table"); + query.AppendLiteral("table"); break; } - query.Append("' AND name ='"); + query.AppendLiteral("' AND name ='"); query.Append(element); query.Append("'"); diff --git a/storage/src/mozStoragePrivateHelpers.cpp b/storage/src/mozStoragePrivateHelpers.cpp index 085bb4ff2067..038976d2aa60 100644 --- a/storage/src/mozStoragePrivateHelpers.cpp +++ b/storage/src/mozStoragePrivateHelpers.cpp @@ -98,12 +98,12 @@ checkAndLogStatementPerformance(sqlite3_stmt *aStatement) nsAutoCString message; message.AppendInt(count); if (count == 1) - message.Append(" sort operation has "); + message.AppendLiteral(" sort operation has "); else - message.Append(" sort operations have "); - message.Append("occurred for the SQL statement '"); + message.AppendLiteral(" sort operations have "); + message.AppendLiteral("occurred for the SQL statement '"); #ifdef MOZ_STORAGE_SORTWARNING_SQL_DUMP - message.Append("SQL command: "); + message.AppendLiteral("SQL command: "); message.Append(sql); #else nsPrintfCString address("0x%p", aStatement); diff --git a/storage/test/storage_test_harness.h b/storage/test/storage_test_harness.h index dcfdfe7a9f65..fa2585e8ce4f 100644 --- a/storage/test/storage_test_harness.h +++ b/storage/test/storage_test_harness.h @@ -158,7 +158,7 @@ AsyncStatementSpinner::HandleError(mozIStorageError *aError) NS_ENSURE_SUCCESS(rv, rv); nsAutoCString warnMsg; - warnMsg.Append("An error occurred while executing an async statement: "); + warnMsg.AppendLiteral("An error occurred while executing an async statement: "); warnMsg.AppendInt(result); warnMsg.Append(" "); warnMsg.Append(message); diff --git a/toolkit/components/downloads/ApplicationReputation.cpp b/toolkit/components/downloads/ApplicationReputation.cpp index 75ed83cae4c6..6aba87b1d8f2 100644 --- a/toolkit/components/downloads/ApplicationReputation.cpp +++ b/toolkit/components/downloads/ApplicationReputation.cpp @@ -415,11 +415,11 @@ PendingLookup::EscapeCertificateAttribute(const nsACString& aAttribute) escaped.SetCapacity(aAttribute.Length()); for (unsigned int i = 0; i < aAttribute.Length(); ++i) { if (aAttribute.Data()[i] == '%') { - escaped.Append("%25"); + escaped.AppendLiteral("%25"); } else if (aAttribute.Data()[i] == '/') { - escaped.Append("%2F"); + escaped.AppendLiteral("%2F"); } else if (aAttribute.Data()[i] == ' ') { - escaped.Append("%20"); + escaped.AppendLiteral("%20"); } else { escaped.Append(aAttribute.Data()[i]); } @@ -465,7 +465,7 @@ PendingLookup::GenerateWhitelistStringsForPair( rv = certificate->GetCommonName(commonName); NS_ENSURE_SUCCESS(rv, rv); if (!commonName.IsEmpty()) { - whitelistString.Append("/CN="); + whitelistString.AppendLiteral("/CN="); whitelistString.Append( EscapeCertificateAttribute(NS_ConvertUTF16toUTF8(commonName))); } @@ -474,7 +474,7 @@ PendingLookup::GenerateWhitelistStringsForPair( rv = certificate->GetOrganization(organization); NS_ENSURE_SUCCESS(rv, rv); if (!organization.IsEmpty()) { - whitelistString.Append("/O="); + whitelistString.AppendLiteral("/O="); whitelistString.Append( EscapeCertificateAttribute(NS_ConvertUTF16toUTF8(organization))); } @@ -483,7 +483,7 @@ PendingLookup::GenerateWhitelistStringsForPair( rv = certificate->GetOrganizationalUnit(organizationalUnit); NS_ENSURE_SUCCESS(rv, rv); if (!organizationalUnit.IsEmpty()) { - whitelistString.Append("/OU="); + whitelistString.AppendLiteral("/OU="); whitelistString.Append( EscapeCertificateAttribute(NS_ConvertUTF16toUTF8(organizationalUnit))); } diff --git a/toolkit/components/places/Helpers.cpp b/toolkit/components/places/Helpers.cpp index 1f20b986afbb..22defc339ef6 100644 --- a/toolkit/components/places/Helpers.cpp +++ b/toolkit/components/places/Helpers.cpp @@ -50,7 +50,7 @@ AsyncStatementCallback::HandleError(mozIStorageError *aError) NS_ENSURE_SUCCESS(rv, rv); nsAutoCString warnMsg; - warnMsg.Append("An error occurred while executing an async statement: "); + warnMsg.AppendLiteral("An error occurred while executing an async statement: "); warnMsg.AppendInt(result); warnMsg.Append(" "); warnMsg.Append(message); diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp index 19301b165b6b..8cb97b03593e 100644 --- a/toolkit/components/places/nsNavHistory.cpp +++ b/toolkit/components/places/nsNavHistory.cpp @@ -1898,7 +1898,7 @@ PlacesSQLQueryBuilder::Where() nsAutoCString tmp = additionalVisitsConditions; additionalVisitsConditions = "AND EXISTS (SELECT 1 FROM moz_historyvisits WHERE place_id = h.id "; additionalVisitsConditions.Append(tmp); - additionalVisitsConditions.Append("LIMIT 1)"); + additionalVisitsConditions.AppendLiteral("LIMIT 1)"); } mQueryString.ReplaceSubstring("{QUERY_OPTIONS_VISITS}", diff --git a/toolkit/components/url-classifier/Classifier.cpp b/toolkit/components/url-classifier/Classifier.cpp index 0d59d0db8413..278e1a4d82a4 100644 --- a/toolkit/components/url-classifier/Classifier.cpp +++ b/toolkit/components/url-classifier/Classifier.cpp @@ -197,7 +197,7 @@ Classifier::TableRequest(nsACString& aResult) ChunkSet &subs = store->SubChunks(); if (adds.Length() > 0) { - aResult.Append("a:"); + aResult.AppendLiteral("a:"); nsAutoCString addList; adds.Serialize(addList); aResult.Append(addList); @@ -206,7 +206,7 @@ Classifier::TableRequest(nsACString& aResult) if (subs.Length() > 0) { if (adds.Length() > 0) aResult.Append(':'); - aResult.Append("s:"); + aResult.AppendLiteral("s:"); nsAutoCString subList; subs.Serialize(subList); aResult.Append(subList); diff --git a/toolkit/system/gnome/nsGConfService.cpp b/toolkit/system/gnome/nsGConfService.cpp index 529ab97d13b2..9c9453553474 100644 --- a/toolkit/system/gnome/nsGConfService.cpp +++ b/toolkit/system/gnome/nsGConfService.cpp @@ -237,7 +237,7 @@ nsGConfService::GetAppForProtocol(const nsACString &aScheme, bool *aEnabled, { nsAutoCString key("/desktop/gnome/url-handlers/"); key.Append(aScheme); - key.Append("/command"); + key.AppendLiteral("/command"); GError *err = nullptr; gchar *command = gconf_client_get_string(mClient, key.get(), &err); @@ -265,7 +265,7 @@ nsGConfService::HandlerRequiresTerminal(const nsACString &aScheme, { nsAutoCString key("/desktop/gnome/url-handlers/"); key.Append(aScheme); - key.Append("/requires_terminal"); + key.AppendLiteral("/requires_terminal"); GError *err = nullptr; *aResult = gconf_client_get_bool(mClient, key.get(), &err); @@ -283,7 +283,7 @@ nsGConfService::SetAppForProtocol(const nsACString &aScheme, { nsAutoCString key("/desktop/gnome/url-handlers/"); key.Append(aScheme); - key.Append("/command"); + key.AppendLiteral("/command"); bool res = gconf_client_set_string(mClient, key.get(), PromiseFlatCString(aCommand).get(), diff --git a/toolkit/xre/nsX11ErrorHandler.cpp b/toolkit/xre/nsX11ErrorHandler.cpp index 3bfbb00d260f..12c8accf4a74 100644 --- a/toolkit/xre/nsX11ErrorHandler.cpp +++ b/toolkit/xre/nsX11ErrorHandler.cpp @@ -83,13 +83,13 @@ X11Error(Display *display, XErrorEvent *event) { if (buffer[0]) { notes.Append(buffer); } else { - notes.Append("Request "); + notes.AppendLiteral("Request "); notes.AppendInt(event->request_code); notes.Append('.'); notes.AppendInt(event->minor_code); } - notes.Append(": "); + notes.AppendLiteral(": "); // Get a string to describe the error. XGetErrorText(display, event->error_code, buffer, sizeof(buffer)); @@ -109,11 +109,11 @@ X11Error(Display *display, XErrorEvent *event) { // XSynchronize call returns the same function after an enable call then // synchronization must have already been enabled. if (XSynchronize(display, True) == XSynchronize(display, False)) { - notes.Append("; sync"); + notes.AppendLiteral("; sync"); } else { - notes.Append("; "); + notes.AppendLiteral("; "); notes.AppendInt(uint32_t(age)); - notes.Append(" requests ago"); + notes.AppendLiteral(" requests ago"); } } @@ -132,14 +132,14 @@ X11Error(Display *display, XErrorEvent *event) { #ifdef DEBUG // The resource id is unlikely to be useful in a crash report without // context of other ids, but add it to the debug console output. - notes.Append("; id=0x"); + notes.AppendLiteral("; id=0x"); notes.AppendInt(uint32_t(event->resourceid), 16); #ifdef MOZ_X11 // Actually, for requests where Xlib gets the reply synchronously, // MOZ_X_SYNC=1 will not be necessary, but we don't have a table to tell us // which requests get a synchronous reply. if (!PR_GetEnv("MOZ_X_SYNC")) { - notes.Append("\nRe-running with MOZ_X_SYNC=1 in the environment may give a more helpful backtrace."); + notes.AppendLiteral("\nRe-running with MOZ_X_SYNC=1 in the environment may give a more helpful backtrace."); } #endif #endif diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index 90972486eefb..9f40a904326b 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -2597,7 +2597,7 @@ NS_IMETHODIMP nsExternalHelperAppService::GetFromTypeAndExtension(const nsACStri if (NS_FAILED(rv) && !aFileExt.IsEmpty()) { // XXXzpao This should probably be localized nsAutoCString desc(aFileExt); - desc.Append(" File"); + desc.AppendLiteral(" File"); (*_retval)->SetDescription(NS_ConvertASCIItoUTF16(desc)); LOG(("Falling back to 'File' file description\n")); } diff --git a/widget/gtk/nsCUPSShim.cpp b/widget/gtk/nsCUPSShim.cpp index d4d0f141960d..d05da307f862 100644 --- a/widget/gtk/nsCUPSShim.cpp +++ b/widget/gtk/nsCUPSShim.cpp @@ -47,7 +47,7 @@ nsCUPSShim::Init() if (! *(symAddr[i])) { #ifdef DEBUG nsAutoCString msg(gSymName[i]); - msg.Append(" not found in CUPS library"); + msg.AppendLiteral(" not found in CUPS library"); NS_WARNING(msg.get()); #endif PR_UnloadLibrary(mCupsLib); diff --git a/widget/tests/TestWinTSF.cpp b/widget/tests/TestWinTSF.cpp index b3e9a90126d4..14f4809009fd 100644 --- a/widget/tests/TestWinTSF.cpp +++ b/widget/tests/TestWinTSF.cpp @@ -2903,7 +2903,7 @@ TestApp::TestScrollMessages(void) #define DO_CHECK(aFailureCondition, aDescription) \ if (aFailureCondition) { \ nsAutoCString str(aDescription); \ - str.Append(": "); \ + str.AppendLiteral(": "); \ str.Append(#aFailureCondition); \ fail(str.get()); \ mTextArea->SetAttribute(NS_LITERAL_STRING("style"), EmptyString()); \ diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp index 463aeeb6d09b..63e2b2a96e84 100644 --- a/widget/windows/GfxInfo.cpp +++ b/widget/windows/GfxInfo.cpp @@ -738,19 +738,19 @@ GfxInfo::AddCrashReportAnnotations() * can go away after we store the above in the socorro db */ nsAutoCString note; /* AppendPrintf only supports 32 character strings, mrghh. */ - note.Append("AdapterVendorID: "); + note.AppendLiteral("AdapterVendorID: "); note.Append(narrowVendorID); - note.Append(", AdapterDeviceID: "); + note.AppendLiteral(", AdapterDeviceID: "); note.Append(narrowDeviceID); note.AppendPrintf(", AdapterSubsysID: %08x, ", mAdapterSubsysID); - note.Append("AdapterDriverVersion: "); + note.AppendLiteral("AdapterDriverVersion: "); note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString)); if (vendorID == GfxDriverInfo::GetDeviceVendor(VendorAll)) { /* if we didn't find a valid vendorID lets append the mDeviceID string to try to find out why */ - note.Append(", "); + note.AppendLiteral(", "); LossyAppendUTF16toASCII(mDeviceID, note); - note.Append(", "); + note.AppendLiteral(", "); LossyAppendUTF16toASCII(mDeviceKeyDebug, note); LossyAppendUTF16toASCII(mDeviceKeyDebug, note); } @@ -767,9 +767,9 @@ GfxInfo::AddCrashReportAnnotations() GetAdapterVendorID2(vendorID2); CopyUTF16toUTF8(vendorID2, narrowVendorID2); GetAdapterDriverVersion2(adapterDriverVersionString2); - note.Append("AdapterVendorID2: "); + note.AppendLiteral("AdapterVendorID2: "); note.Append(narrowVendorID2); - note.Append(", AdapterDeviceID2: "); + note.AppendLiteral(", AdapterDeviceID2: "); note.Append(narrowDeviceID2); note.AppendPrintf(", AdapterSubsysID2: %08x, ", mAdapterSubsysID2); note.AppendPrintf("AdapterDriverVersion2: "); diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index 8140669f4e1c..0d5ca255a114 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -1125,7 +1125,7 @@ nsresult FaviconHelper::GetOutputIconPath(nsCOMPtr aFaviconPageURI, NS_ENSURE_SUCCESS(rv, rv); // Append the icon extension - inputURIHash.Append(".ico"); + inputURIHash.AppendLiteral(".ico"); rv = aICOFile->AppendNative(inputURIHash); return rv; diff --git a/widget/windows/nsDataObj.cpp b/widget/windows/nsDataObj.cpp index 4f24329907aa..59a20dea05b2 100644 --- a/widget/windows/nsDataObj.cpp +++ b/widget/windows/nsDataObj.cpp @@ -1240,7 +1240,7 @@ HRESULT nsDataObj::GetText(const nsACString & aDataFlavor, FORMATETC& aFE, STGME // if someone asks for text/plain, look up text/unicode instead in the transferable. const char* flavorStr; const nsPromiseFlatCString& flat = PromiseFlatCString(aDataFlavor); - if ( aDataFlavor.EqualsLiteral("text/plain") ) + if (aDataFlavor.EqualsLiteral("text/plain")) flavorStr = kUnicodeMime; else flavorStr = flat.get(); diff --git a/widget/windows/nsImageClipboard.cpp b/widget/windows/nsImageClipboard.cpp index eb73df5f8682..e3570f39dca4 100644 --- a/widget/windows/nsImageClipboard.cpp +++ b/widget/windows/nsImageClipboard.cpp @@ -244,7 +244,7 @@ nsImageFromClipboard ::GetEncodedImageStream (unsigned char * aClipboardData, co // Map image/jpg to image/jpeg (which is how the encoder is registered). if (strcmp(aMIMEFormat, kJPGImageMime) == 0) - encoderCID.Append("image/jpeg"); + encoderCID.AppendLiteral("image/jpeg"); else encoderCID.Append(aMIMEFormat); nsCOMPtr encoder = do_CreateInstance(encoderCID.get(), &rv); diff --git a/widget/xpwidgets/GfxInfoX11.cpp b/widget/xpwidgets/GfxInfoX11.cpp index bd8877c099ff..10d398a76dfc 100644 --- a/widget/xpwidgets/GfxInfoX11.cpp +++ b/widget/xpwidgets/GfxInfoX11.cpp @@ -187,13 +187,13 @@ GfxInfo::GetData() mAdapterDescription.Append(mRenderer); nsAutoCString note; - note.Append("OpenGL: "); + note.AppendLiteral("OpenGL: "); note.Append(mAdapterDescription); - note.Append(" -- "); + note.AppendLiteral(" -- "); note.Append(mVersion); if (mHasTextureFromPixmap) - note.Append(" -- texture_from_pixmap"); - note.Append("\n"); + note.AppendLiteral(" -- texture_from_pixmap"); + note.AppendLiteral("\n"); #ifdef MOZ_CRASHREPORTER CrashReporter::AppendAppNotesToCrashReport(note); #endif diff --git a/xpcom/base/SystemMemoryReporter.cpp b/xpcom/base/SystemMemoryReporter.cpp index ec50d1eceb61..5e69888b8bd4 100644 --- a/xpcom/base/SystemMemoryReporter.cpp +++ b/xpcom/base/SystemMemoryReporter.cpp @@ -255,11 +255,11 @@ private: // as path separators. Consumers of this reporter (such as // about:memory) have to undo this change. processName.ReplaceChar('/', '\\'); - processName.Append(", "); + processName.AppendLiteral(", "); } fclose(f); } - processName.Append("pid="); + processName.AppendLiteral("pid="); processName.Append(pidStr); processName.Append(")"); @@ -299,7 +299,7 @@ private: nsAutoCString desc("This is the sum of all processes' '"); desc.Append(kindPathSuffixes[i]); - desc.Append("' numbers."); + desc.AppendLiteral("' numbers."); REPORT(path, processSizes.mSizes[i], desc); } @@ -397,27 +397,28 @@ private: GetBasename(absPath, basename); if (basename.EqualsLiteral("[heap]")) { - aName.Append("anonymous/brk-heap"); - aDesc.Append("Memory in anonymous mappings within the boundaries " - "defined by brk() / sbrk(). This is likely to be just " - "a portion of the application's heap; the remainder " - "lives in other anonymous mappings. This corresponds to " - "'[heap]' in /proc//smaps."); + aName.AppendLiteral("anonymous/brk-heap"); + aDesc.AppendLiteral( + "Memory in anonymous mappings within the boundaries defined by " + "brk() / sbrk(). This is likely to be just a portion of the " + "application's heap; the remainder lives in other anonymous mappings. " + "This corresponds to '[heap]' in /proc//smaps."); *aProcessSizeKind = AnonymousBrkHeap; } else if (basename.EqualsLiteral("[stack]")) { - aName.Append("main-thread-stack"); - aDesc.Append("The stack size of the process's main thread. This " - "corresponds to '[stack]' in /proc//smaps."); + aName.AppendLiteral("main-thread-stack"); + aDesc.AppendLiteral( + "The stack size of the process's main thread. This corresponds to " + "'[stack]' in /proc//smaps."); *aProcessSizeKind = MainThreadStack; } else if (basename.EqualsLiteral("[vdso]")) { - aName.Append("vdso"); - aDesc.Append("The virtual dynamically-linked shared object, also known " - "as the 'vsyscall page'. This is a memory region mapped by " - "the operating system for the purpose of allowing processes " - "to perform some privileged actions without the overhead of " - "a syscall."); + aName.AppendLiteral("vdso"); + aDesc.AppendLiteral( + "The virtual dynamically-linked shared object, also known as the " + "'vsyscall page'. This is a memory region mapped by the operating " + "system for the purpose of allowing processes to perform some " + "privileged actions without the overhead of a syscall."); *aProcessSizeKind = Vdso; } else if (!IsAnonymous(basename)) { @@ -428,7 +429,7 @@ private: // its dirname contains "/lib", or if the basename ends with ".so". if (EndsWithLiteral(basename, ".so") || (basename.Find(".so") != -1 && dirname.Find("/lib") != -1)) { - aName.Append("shared-libraries/"); + aName.AppendLiteral("shared-libraries/"); if (strncmp(aPerms, "r-x", 3) == 0) { *aProcessSizeKind = SharedLibrariesRX; @@ -441,11 +442,11 @@ private: } } else { - aName.Append("other-files/"); + aName.AppendLiteral("other-files/"); if (EndsWithLiteral(basename, ".xpi")) { - aName.Append("extensions/"); + aName.AppendLiteral("extensions/"); } else if (dirname.Find("/fontconfig") != -1) { - aName.Append("fontconfig/"); + aName.AppendLiteral("fontconfig/"); } *aProcessSizeKind = OtherFiles; } @@ -454,20 +455,21 @@ private: aDesc.Append(absPath); } else { - aName.Append("anonymous/outside-brk"); - aDesc.Append("Memory in anonymous mappings outside the boundaries " - "defined by brk() / sbrk()."); + aName.AppendLiteral("anonymous/outside-brk"); + aDesc.AppendLiteral( + "Memory in anonymous mappings outside the boundaries defined by " + "brk() / sbrk()."); *aProcessSizeKind = AnonymousOutsideBrk; } - aName.Append("/["); + aName.AppendLiteral("/["); aName.Append(aPerms); aName.Append("]"); // Append the permissions. This is useful for non-verbose mode in // about:memory when the filename is long and goes of the right side of the // window. - aDesc.Append(" ["); + aDesc.AppendLiteral(" ["); aDesc.Append(aPerms); aDesc.Append("]"); } diff --git a/xpcom/glue/BlockingResourceBase.cpp b/xpcom/glue/BlockingResourceBase.cpp index 1f03aa46e9f1..9a92895f3398 100644 --- a/xpcom/glue/BlockingResourceBase.cpp +++ b/xpcom/glue/BlockingResourceBase.cpp @@ -116,11 +116,11 @@ BlockingResourceBase::CheckAcquire(const CallStack& aCallContext) if (maybeImminent) { fputs("\n###!!! Deadlock may happen NOW!\n\n", stderr); - out.Append("\n###!!! Deadlock may happen NOW!\n\n"); + out.AppendLiteral("\n###!!! Deadlock may happen NOW!\n\n"); } else { fputs("\nDeadlock may happen for some other execution\n\n", stderr); - out.Append("\nDeadlock may happen for some other execution\n\n"); + out.AppendLiteral("\nDeadlock may happen for some other execution\n\n"); } // XXX can customize behavior on whether we /think/ deadlock is