Bug 1593766 relax assertion to handle case of no CycleCollectedJSContext created r=baku
authorKarl Tomlinson <karlt+@karlt.net>
Wed, 06 Nov 2019 12:36:41 +0000
changeset 501038 04e94296ee4ab011a03c7506f5e27d6a4b16e07b
parent 501037 1138923577823fbae40675932f07cd1a79730db1
child 501039 ae6a4596986d3c36a2f2beca9ac144495342adff
push id99943
push userktomlinson@mozilla.com
push dateThu, 07 Nov 2019 01:56:16 +0000
treeherderautoland@ae6a4596986d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1593766
milestone72.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 1593766 relax assertion to handle case of no CycleCollectedJSContext created r=baku This can happen when addModule() has not be called, but the thread is created just to send a NotifyWorkletFinished message. Differential Revision: https://phabricator.services.mozilla.com/D51925
dom/worklet/WorkletThread.cpp
--- a/dom/worklet/WorkletThread.cpp
+++ b/dom/worklet/WorkletThread.cpp
@@ -368,17 +368,17 @@ void WorkletThread::Terminate() {
 
   nsContentUtils::UnregisterShutdownObserver(this);
 
   RefPtr<TerminateRunnable> runnable = new TerminateRunnable(this);
   DispatchRunnable(runnable.forget());
 }
 
 void WorkletThread::TerminateInternal() {
-  AssertIsOnWorkletThread();
+  MOZ_ASSERT(!CycleCollectedJSContext::Get() || IsOnWorkletThread());
 
   mExitLoop = true;
 
   nsCOMPtr<nsIRunnable> runnable = NewRunnableMethod(
       "WorkletThread::Shutdown", this, &WorkletThread::Shutdown);
   NS_DispatchToMainThread(runnable);
 }