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 291455 4c3640e00eefdca7693c4a0ffb097656404a8593
parent 291454 ff41464ac92d19c020112093a16ca4b364a7ad82
child 291456 df803eb33993cc01ad0c43740a9e2a97fd976020
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1261122
milestone48.0a1
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 =