Bug 1589309. Pass XPCOM strings, not buffer pointers, to notifyJSRunToCompletionStart. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 18 Oct 2019 02:50:45 +0000
changeset 559424 f0138a399f7c4e3988711293ff595df3e67e60d1
parent 559423 2923afce519ae4339e8fb7d29dfba065717eff83
child 559425 77f284223290667b57b3fa70bf147817f974a6d7
push id12177
push usercsabou@mozilla.com
push dateMon, 21 Oct 2019 14:52:16 +0000
treeherdermozilla-beta@1918a9cd33bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1589309
milestone71.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 1589309. Pass XPCOM strings, not buffer pointers, to notifyJSRunToCompletionStart. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D49650
docshell/base/nsDocShell.cpp
docshell/base/nsIDocShell.idl
docshell/base/timeline/JavascriptTimelineMarker.h
dom/script/ScriptSettings.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -13346,18 +13346,18 @@ void nsDocShell::SetOpener(nsIRemoteTab*
 
 nsIRemoteTab* nsDocShell::GetOpener() {
   nsCOMPtr<nsIRemoteTab> opener(do_QueryReferent(mOpener));
   return opener;
 }
 
 // The caller owns |aAsyncCause| here.
 void nsDocShell::NotifyJSRunToCompletionStart(const char* aReason,
-                                              const char16_t* aFunctionName,
-                                              const char16_t* aFilename,
+                                              const nsAString& aFunctionName,
+                                              const nsAString& aFilename,
                                               const uint32_t aLineNumber,
                                               JS::Handle<JS::Value> aAsyncStack,
                                               const char* aAsyncCause) {
   // If first start, mark interval start.
   if (mJSRunToCompletionDepth == 0) {
     RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
     if (timelines && timelines->HasConsumer(this)) {
       timelines->AddMarkerForDocShell(
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -956,18 +956,18 @@ interface nsIDocShell : nsIDocShellTreeI
   [noscript,notxpcom,nostdcall] nsIRemoteTab getOpener();
 
   /**
    * Notify DocShell when the browser is about to start executing JS, and after
    * that execution has stopped.  This only occurs when the Timeline devtool
    * is collecting information.
    */
   [noscript,notxpcom,nostdcall] void notifyJSRunToCompletionStart(in string aReason,
-                                                                  in wstring functionName,
-                                                                  in wstring fileName,
+                                                                  in AString functionName,
+                                                                  in AString fileName,
                                                                   in unsigned long lineNumber,
                                                                   in jsval asyncStack,
                                                                   in string asyncCause);
   [noscript,notxpcom,nostdcall] void notifyJSRunToCompletionStop();
 
   [noscript] void GetOSHEId(out uint32_t aSHEntryId);
 
   /**
--- a/docshell/base/timeline/JavascriptTimelineMarker.h
+++ b/docshell/base/timeline/JavascriptTimelineMarker.h
@@ -16,18 +16,18 @@
 #include "mozilla/dom/ToJSValue.h"
 
 namespace mozilla {
 
 class JavascriptTimelineMarker : public TimelineMarker {
  public:
   // The caller owns |aAsyncCause| here, so we must copy it into a separate
   // string for use later on.
-  JavascriptTimelineMarker(const char* aReason, const char16_t* aFunctionName,
-                           const char16_t* aFileName, uint32_t aLineNumber,
+  JavascriptTimelineMarker(const char* aReason, const nsAString& aFunctionName,
+                           const nsAString& aFileName, uint32_t aLineNumber,
                            MarkerTracingType aTracingType,
                            JS::Handle<JS::Value> aAsyncStack,
                            const char* aAsyncCause)
       : TimelineMarker("Javascript", aTracingType,
                        MarkerStackRequest::NO_STACK),
         mCause(NS_ConvertUTF8toUTF16(aReason)),
         mFunctionName(aFunctionName),
         mFileName(aFileName),
--- a/dom/script/ScriptSettings.cpp
+++ b/dom/script/ScriptSettings.cpp
@@ -642,18 +642,17 @@ void AutoEntryScript::DocshellEntryMonit
   }
   if (rootedScript) {
     filename = NS_ConvertUTF8toUTF16(JS_GetScriptFilename(rootedScript));
     lineNumber = JS_GetScriptBaseLineNumber(aCx, rootedScript);
   }
 
   if (!filename.IsEmpty() || !functionName.IsEmpty()) {
     docShellForJSRunToCompletion->NotifyJSRunToCompletionStart(
-        mReason, functionName.get(), filename.get(), lineNumber, aAsyncStack,
-        aAsyncCause);
+        mReason, functionName, filename, lineNumber, aAsyncStack, aAsyncCause);
   }
 }
 
 void AutoEntryScript::DocshellEntryMonitor::Exit(JSContext* aCx) {
   nsCOMPtr<nsPIDOMWindowInner> window = xpc::CurrentWindowOrNull(aCx);
   // Not really worth checking GetRecordProfileTimelineMarkers here.
   if (window && window->GetDocShell()) {
     nsCOMPtr<nsIDocShell> docShellForJSRunToCompletion = window->GetDocShell();