Bug 1220308 - Cache API should teardown DOM objects when Worker hits Terminating status. r=baku, a=ritu
authorBen Kelly <ben@wanderview.com>
Tue, 10 Nov 2015 13:51:22 -0800
changeset 305491 680d8c1b67166e25be9fa539b5a3b9940433d28a
parent 305490 d4159c66b1835d2c8e33c53b545bc33228608c3f
child 305492 953f0b711d38c84d4aefdfbc59f652245c77831b
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)
reviewersbaku, ritu
bugs1220308
milestone44.0a2
Bug 1220308 - Cache API should teardown DOM objects when Worker hits Terminating status. r=baku, a=ritu
dom/cache/Feature.cpp
--- a/dom/cache/Feature.cpp
+++ b/dom/cache/Feature.cpp
@@ -8,17 +8,17 @@
 
 #include "mozilla/dom/cache/ActorChild.h"
 #include "WorkerPrivate.h"
 
 namespace mozilla {
 namespace dom {
 namespace cache {
 
-using mozilla::dom::workers::Canceling;
+using mozilla::dom::workers::Terminating;
 using mozilla::dom::workers::Status;
 using mozilla::dom::workers::WorkerPrivate;
 
 // static
 already_AddRefed<Feature>
 Feature::Create(WorkerPrivate* aWorkerPrivate)
 {
   MOZ_ASSERT(aWorkerPrivate);
@@ -68,17 +68,19 @@ Feature::Notified() const
   return mNotified;
 }
 
 bool
 Feature::Notify(JSContext* aCx, Status aStatus)
 {
   NS_ASSERT_OWNINGTHREAD(Feature);
 
-  if (aStatus < Canceling || mNotified) {
+  // When the service worker thread is stopped we will get Terminating,
+  // but nothing higher than that.  We must shut things down at Terminating.
+  if (aStatus < Terminating || mNotified) {
     return true;
   }
 
   mNotified = true;
 
   // Start the asynchronous destruction of our actors.  These will call back
   // into RemoveActor() once the actor is destroyed.
   for (uint32_t i = 0; i < mActorList.Length(); ++i) {