Bug 1492014 get WorkletLoadInfo from global rather than thread in WorkletGlobalScope r=baku
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 20 Sep 2018 11:27:25 +0000
changeset 497302 bb62e7dad63f66f7f9c793e9a87f8c89983c412f
parent 497301 7576b6eca5d15aba8a8fab074a60c21a4180f491
child 497303 4d3a8fe2d2c794c55f756f686dcca4ad9e22af35
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1492014
milestone64.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 1492014 get WorkletLoadInfo from global rather than thread in WorkletGlobalScope r=baku We'll need to support multiple worklets sharng a single execution thread for AudioWorklet. Depends on D6103 Differential Revision: https://phabricator.services.mozilla.com/D6104
dom/worklet/WorkletGlobalScope.cpp
--- a/dom/worklet/WorkletGlobalScope.cpp
+++ b/dom/worklet/WorkletGlobalScope.cpp
@@ -48,43 +48,36 @@ WorkletGlobalScope::WrapObject(JSContext
 {
   MOZ_CRASH("We should never get here!");
   return nullptr;
 }
 
 already_AddRefed<Console>
 WorkletGlobalScope::GetConsole(JSContext* aCx, ErrorResult& aRv)
 {
-  RefPtr<WorkletThread> thread = WorkletThread::Get();
-  MOZ_ASSERT(thread);
-
   if (!mConsole) {
-    mConsole =
-      Console::CreateForWorklet(aCx,
-                                thread->GetWorkletLoadInfo().OuterWindowID(),
-                                thread->GetWorkletLoadInfo().InnerWindowID(),
-                                aRv);
+    const WorkletLoadInfo& loadInfo = mImpl->LoadInfo();
+    mConsole = Console::CreateForWorklet(aCx,
+                                         loadInfo.OuterWindowID(),
+                                         loadInfo.InnerWindowID(), aRv);
     if (NS_WARN_IF(aRv.Failed())) {
       return nullptr;
     }
   }
 
   RefPtr<Console> console = mConsole;
   return console.forget();
 }
 
 void
 WorkletGlobalScope::Dump(const Optional<nsAString>& aString) const
 {
   WorkletThread::AssertIsOnWorkletThread();
 
-  WorkletThread* workletThread = WorkletThread::Get();
-  MOZ_ASSERT(workletThread);
-
-  if (!workletThread->GetWorkletLoadInfo().DumpEnabled()) {
+  if (!mImpl->LoadInfo().DumpEnabled()) {
     return;
   }
 
   if (!aString.WasPassed()) {
     return;
   }
 
   NS_ConvertUTF16toUTF8 str(aString.Value());