Bug 1188545 - ServiceWorkerRegistrationInfo::Clear() should terminated workers. r=nsm
☠☠ backed out by f39b2e477fbe ☠ ☠
authorCatalin Badea <catalin.badea392@gmail.com>
Wed, 30 Sep 2015 10:14:33 -0400
changeset 300484 d5d05def5b17335ef6608856c23b43e541cd411d
parent 300483 e94f12b0bcf347eddd4010bba97cee37ea88f993
child 300485 4be675dc1b37adca979606828fcf6ab9dc082dfd
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnsm
bugs1188545
milestone44.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 1188545 - ServiceWorkerRegistrationInfo::Clear() should terminated workers. r=nsm
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -323,43 +323,45 @@ ServiceWorkerJob::Done(nsresult aStatus)
     mQueue->Done(this);
   }
 }
 
 void
 ServiceWorkerRegistrationInfo::Clear()
 {
   if (mInstallingWorker) {
-    // FIXME(nsm): Terminate installing worker.
     mInstallingWorker->UpdateState(ServiceWorkerState::Redundant);
+    mInstallingWorker->WorkerPrivate()->NoteDeadServiceWorkerInfo();
     mInstallingWorker = nullptr;
     // FIXME(nsm): Abort any inflight requests from installing worker.
   }
 
   if (mWaitingWorker) {
     mWaitingWorker->UpdateState(ServiceWorkerState::Redundant);
 
     nsresult rv = serviceWorkerScriptCache::PurgeCache(mPrincipal,
                                                        mWaitingWorker->CacheName());
     if (NS_FAILED(rv)) {
       NS_WARNING("Failed to purge the waiting cache.");
     }
 
+    mWaitingWorker->WorkerPrivate()->NoteDeadServiceWorkerInfo();
     mWaitingWorker = nullptr;
   }
 
   if (mActiveWorker) {
     mActiveWorker->UpdateState(ServiceWorkerState::Redundant);
 
     nsresult rv = serviceWorkerScriptCache::PurgeCache(mPrincipal,
                                                        mActiveWorker->CacheName());
     if (NS_FAILED(rv)) {
       NS_WARNING("Failed to purge the active cache.");
     }
 
+    mActiveWorker->WorkerPrivate()->NoteDeadServiceWorkerInfo();
     mActiveWorker = nullptr;
   }
 
   nsRefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
   MOZ_ASSERT(swm);
   swm->InvalidateServiceWorkerRegistrationWorker(this,
                                                  WhichServiceWorker::INSTALLING_WORKER |
                                                  WhichServiceWorker::WAITING_WORKER |