Bug 1429904 - Add 'using namespace mozilla;' to ProfileBufferEntry.cpp and remove some mozilla:: prefixes. r?njn draft
authorMarkus Stange <mstange@themasta.com>
Sat, 17 Feb 2018 12:35:57 -0500
changeset 762104 2597f6b7180d88b46e79460c8557ca2445bd8566
parent 762103 d8b516a654c4d4ed73dd10ee308080db728c5f44
child 762105 77f286312bdedb30404b79a03e7a2305d60988f5
push id101088
push userbmo:mstange@themasta.com
push dateThu, 01 Mar 2018 20:52:26 +0000
reviewersnjn
bugs1429904
milestone60.0a1
Bug 1429904 - Add 'using namespace mozilla;' to ProfileBufferEntry.cpp and remove some mozilla:: prefixes. r?njn I think this file was picking up such a declaration from a different file already, through unified builds. MozReview-Commit-ID: 9xTB2QA86U0
tools/profiler/core/ProfileBufferEntry.cpp
--- a/tools/profiler/core/ProfileBufferEntry.cpp
+++ b/tools/profiler/core/ProfileBufferEntry.cpp
@@ -15,23 +15,17 @@
 // JS
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "js/TrackedOptimizationInfo.h"
 
 // Self
 #include "ProfileBufferEntry.h"
 
-using mozilla::JSONWriter;
-using mozilla::MakeUnique;
-using mozilla::Maybe;
-using mozilla::Nothing;
-using mozilla::Some;
-using mozilla::TimeStamp;
-using mozilla::UniquePtr;
+using namespace mozilla;
 
 ////////////////////////////////////////////////////////////////////////
 // BEGIN ProfileBufferEntry
 
 ProfileBufferEntry::ProfileBufferEntry()
   : mKind(Kind::INVALID)
 {
   u.mString = nullptr;
@@ -296,28 +290,28 @@ UniqueStacks::JITAddress::Hash() const
   hash = AddToHash(hash, mStreamingGen);
   return hash;
 }
 
 uint32_t UniqueStacks::FrameKey::Hash() const
 {
   uint32_t hash = 0;
   if (!mLocation.IsEmpty()) {
-    hash = mozilla::HashString(mLocation.get());
+    hash = HashString(mLocation.get());
   }
   if (mLine.isSome()) {
-    hash = mozilla::AddToHash(hash, *mLine);
+    hash = AddToHash(hash, *mLine);
   }
   if (mCategory.isSome()) {
-    hash = mozilla::AddToHash(hash, *mCategory);
+    hash = AddToHash(hash, *mCategory);
   }
   if (mJITAddress.isSome()) {
-    hash = mozilla::AddToHash(hash, mJITAddress->Hash());
+    hash = AddToHash(hash, mJITAddress->Hash());
     if (mJITDepth.isSome()) {
-      hash = mozilla::AddToHash(hash, *mJITDepth);
+      hash = AddToHash(hash, *mJITDepth);
     }
   }
   return hash;
 }
 
 UniqueStacks::UniqueStacks()
 {
   mFrameTableWriter.StartBareList();
@@ -518,17 +512,17 @@ StreamJITFrameOptimizations(SpliceableJS
         aJITFrame.forEachOptimizationAttempt(op, script.address(), &pc);
       }
       aWriter.EndArray();
     }
     aWriter.EndObject();
 
     if (JSAtom* name = js::GetPropertyNameFromPC(script, pc)) {
       char buf[512];
-      JS_PutEscapedFlatString(buf, mozilla::ArrayLength(buf), js::AtomToFlatString(name), 0);
+      JS_PutEscapedFlatString(buf, ArrayLength(buf), js::AtomToFlatString(name), 0);
       aUniqueStrings.WriteProperty(aWriter, "propertyName", buf);
     }
 
     unsigned line, column;
     line = JS_PCToLineNumber(script, pc, &column);
     aWriter.IntProperty("line", line);
     aWriter.IntProperty("column", column);
   }