Bug 1261122 - don't needlessly construct nsAutoCString temporaries in dom/indexedDB; r=khuey
authorNathan Froyd <froydnj.com>
Thu, 31 Mar 2016 13:14:47 -0400
changeset 291396 4c3640e00eefdca7693c4a0ffb097656404a8593
parent 291395 ff41464ac92d19c020112093a16ca4b364a7ad82
child 291397 df803eb33993cc01ad0c43740a9e2a97fd976020
push id30132
push userryanvm@gmail.com
push dateSat, 02 Apr 2016 17:18:33 +0000
treeherdermozilla-central@df803eb33993 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1261122
milestone48.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 1261122 - don't needlessly construct nsAutoCString temporaries in dom/indexedDB; r=khuey We can make ScriptErrorRunnable::DumpLocalized take an nsACString instead.
dom/indexedDB/ScriptErrorHelper.cpp
--- a/dom/indexedDB/ScriptErrorHelper.cpp
+++ b/dom/indexedDB/ScriptErrorHelper.cpp
@@ -62,31 +62,31 @@ public:
     , mInnerWindowID(aInnerWindowID)
     , mIsChrome(aIsChrome)
   {
     MOZ_ASSERT(!NS_IsMainThread());
     mMessage.SetIsVoid(true);
   }
 
   static void
-  DumpLocalizedMessage(const nsCString& aMessageName,
+  DumpLocalizedMessage(const nsACString& aMessageName,
                        const nsAString& aFilename,
                        uint32_t aLineNumber,
                        uint32_t aColumnNumber,
                        uint32_t aSeverityFlag,
                        bool aIsChrome,
                        uint64_t aInnerWindowID)
   {
     MOZ_ASSERT(NS_IsMainThread());
     MOZ_ASSERT(!aMessageName.IsEmpty());
 
     nsXPIDLString localizedMessage;
     if (NS_WARN_IF(NS_FAILED(
       nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
-                                         aMessageName.get(),
+                                         aMessageName.BeginReading(),
                                          localizedMessage)))) {
       return;
     }
 
     Dump(localizedMessage,
          aFilename,
          aLineNumber,
          aColumnNumber,
@@ -219,17 +219,17 @@ ScriptErrorHelper::DumpLocalizedMessage(
                                         const nsAString& aFilename,
                                         uint32_t aLineNumber,
                                         uint32_t aColumnNumber,
                                         uint32_t aSeverityFlag,
                                         bool aIsChrome,
                                         uint64_t aInnerWindowID)
 {
   if (NS_IsMainThread()) {
-    ScriptErrorRunnable::DumpLocalizedMessage(nsAutoCString(aMessageName),
+    ScriptErrorRunnable::DumpLocalizedMessage(aMessageName,
                                               aFilename,
                                               aLineNumber,
                                               aColumnNumber,
                                               aSeverityFlag,
                                               aIsChrome,
                                               aInnerWindowID);
   } else {
     RefPtr<ScriptErrorRunnable> runnable =