Bug 1081293 - Silently ignore lack of ServiceWorkerManager when shutting down ServiceWorkerContainer. r=baku
authorNikhil Marathe <nsm.nikhil@gmail.com>
Fri, 23 Jan 2015 11:23:55 -0800
changeset 226071 e3d924b6797f92a37db62429065de7cd5347fda6
parent 226070 c61a87a20888ebf068761c1d2ce3d461b589cb5f
child 226072 cb8cbda065c6a94bfab387a7e7bfa3a3a96d0bec
push id28185
push userkwierso@gmail.com
push dateWed, 28 Jan 2015 00:05:15 +0000
treeherdermozilla-central@b2b10231606b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1081293
milestone38.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 1081293 - Silently ignore lack of ServiceWorkerManager when shutting down ServiceWorkerContainer. r=baku
dom/workers/ServiceWorkerContainer.cpp
--- a/dom/workers/ServiceWorkerContainer.cpp
+++ b/dom/workers/ServiceWorkerContainer.cpp
@@ -51,17 +51,20 @@ ServiceWorkerContainer::DisconnectFromOw
 
 void
 ServiceWorkerContainer::RemoveReadyPromise()
 {
   nsCOMPtr<nsPIDOMWindow> window = GetOwner();
   if (window) {
     nsCOMPtr<nsIServiceWorkerManager> swm =
       mozilla::services::GetServiceWorkerManager();
-    MOZ_ASSERT(swm);
+    if (!swm) {
+      // If the browser is shutting down, we don't need to remove the promise.
+      return;
+    }
 
     swm->RemoveReadyPromise(window);
   }
 }
 
 JSObject*
 ServiceWorkerContainer::WrapObject(JSContext* aCx)
 {