Bug 1373761 - Add a PROFILER_LABEL to nsInProcessTabChildGlobal::LoadFrameScript. r?billm draft
authorMarkus Stange <mstange@themasta.com>
Fri, 16 Jun 2017 16:34:12 -0400
changeset 595747 98ecb788e3686dc5c30875db02e8b220271d396a
parent 595746 b4c66b553337ddbdd683f5968b168497dd41f919
child 633800 a32d552b94547ab3b1203e7ec359059cfce1a6e6
push id64442
push userbmo:mstange@themasta.com
push dateFri, 16 Jun 2017 20:34:31 +0000
reviewersbillm
bugs1373761
milestone56.0a1
Bug 1373761 - Add a PROFILER_LABEL to nsInProcessTabChildGlobal::LoadFrameScript. r?billm MozReview-Commit-ID: A1mU4RdjYw7
dom/base/nsInProcessTabChildGlobal.cpp
--- a/dom/base/nsInProcessTabChildGlobal.cpp
+++ b/dom/base/nsInProcessTabChildGlobal.cpp
@@ -321,16 +321,23 @@ public:
   RefPtr<nsInProcessTabChildGlobal> mTabChild;
   nsString mURL;
   bool mRunInGlobalScope;
 };
 
 void
 nsInProcessTabChildGlobal::LoadFrameScript(const nsAString& aURL, bool aRunInGlobalScope)
 {
+#ifdef MOZ_GECKO_PROFILER
+  NS_LossyConvertUTF16toASCII urlCStr(aURL);
+  PROFILER_LABEL_DYNAMIC("nsInProcessTabChildGlobal", "LoadFrameScript",
+                          js::ProfileEntry::Category::OTHER,
+                          urlCStr.get());
+#endif
+
   if (!nsContentUtils::IsSafeToRunScript()) {
     nsContentUtils::AddScriptRunner(new nsAsyncScriptLoad(this, aURL, aRunInGlobalScope));
     return;
   }
   if (!mInitialized) {
     mInitialized = true;
     Init();
   }