bug 1328964 changes for worletthread rebase for microtask bug 1343396 r?baku draft
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 06 Mar 2018 21:03:13 +1300
changeset 779537 79fe63a925f2bdf19b538e520353d892be81e9a1
parent 779536 a249e100f589b701ffa66ba88a6c2223e6b7ca96
child 779538 a65c71c0dc8877ce01437d6b4853c33d7b79e72f
child 779547 58f6d315a27d15e877f39925b8d9158e830c47d8
push id105792
push userktomlinson@mozilla.com
push dateTue, 10 Apr 2018 05:41:47 +0000
reviewersbaku
bugs1328964, 1343396
milestone61.0a1
bug 1328964 changes for worletthread rebase for microtask bug 1343396 r?baku For folding into "part 2 - WorkletThread". MozReview-Commit-ID: 13RpsQ1Ynpn
dom/worklet/WorkletThread.cpp
--- a/dom/worklet/WorkletThread.cpp
+++ b/dom/worklet/WorkletThread.cpp
@@ -198,39 +198,33 @@ public:
     JS_InitDestroyPrincipalsCallback(cx, DestroyWorkletPrincipals);
     JS_SetWrapObjectCallbacks(cx, &WrapObjectCallbacks);
     JS_SetFutexCanWait(cx);
 
     return NS_OK;
   }
 
   void
-  AfterProcessTask(uint32_t aRecursionDepth) override
+  DispatchToMicroTask(already_AddRefed<MicroTaskRunnable> aRunnable) override
   {
-    CycleCollectedJSContext::AfterProcessTask(aRecursionDepth);
-  }
-
-  void
-  DispatchToMicroTask(already_AddRefed<nsIRunnable> aRunnable) override
-  {
-    RefPtr<nsIRunnable> runnable(aRunnable);
+    RefPtr<MicroTaskRunnable> runnable(aRunnable);
 
     MOZ_ASSERT(!NS_IsMainThread());
     MOZ_ASSERT(runnable);
 
     WorkletThread* workletThread = WorkletThread::Get();
     MOZ_ASSERT(workletThread);
 
     JSContext* cx = workletThread->GetJSContext();
     MOZ_ASSERT(cx);
 
     JS::Rooted<JSObject*> global(cx, JS::CurrentGlobalOrNull(cx));
     MOZ_ASSERT(global);
 
-    mPromiseMicroTaskQueue.push(runnable.forget());
+    GetMicroTaskQueue().push(runnable.forget());
   }
 
 private:
   RefPtr<WorkletThread> mWorkletThread;
 };
 
 // This is the first runnable to be dispatched. It calls the RunEventLoop() so
 // basically everything happens into this runnable. The reason behind this