Bug 1539535 - Add a (temporary) null check in RemoteWorkerChild::CloseWorkerOnMainThread r=asuth a=pascalc
authorPerry Jiang <perry@mozilla.com>
Thu, 11 Apr 2019 03:31:45 +0000
changeset 526160 afc3ac77b7750eae6581dae4cdf65b0678e8bea2
parent 526159 8f56f6681da40857faa243da02f4d1fcb1dfaf2d
child 526161 d9a704ef462353c6427f316faad23af8bd76832d
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth, pascalc
bugs1539535
milestone67.0
Bug 1539535 - Add a (temporary) null check in RemoteWorkerChild::CloseWorkerOnMainThread r=asuth a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D26794
dom/workers/remoteworkers/RemoteWorkerChild.cpp
--- a/dom/workers/remoteworkers/RemoteWorkerChild.cpp
+++ b/dom/workers/remoteworkers/RemoteWorkerChild.cpp
@@ -451,17 +451,23 @@ void RemoteWorkerChild::CloseWorkerOnMai
   if (lock->mWorkerState == ePending) {
     lock->mWorkerState = ePendingTerminated;
     // Already released.
     return;
   }
 
   // The holder will be notified by this.
   if (lock->mWorkerState == eRunning) {
-    MOZ_RELEASE_ASSERT(lock->mWorkerPrivate);
+    // FIXME: mWorkerState transition and each state's associated data should
+    // be improved/fixed in bug 1231213. `!lock->mWorkerPrivate` implies that
+    // the worker state is effectively `eTerminated.`
+    if (!lock->mWorkerPrivate) {
+      return;
+    }
+
     lock->mWorkerPrivate->Cancel();
   }
 }
 
 void RemoteWorkerChild::FlushReportsOnMainThread(
     nsIConsoleReportCollector* aReporter) {
   MOZ_ASSERT(NS_IsMainThread());