Bug 1144660 - Make KeepAliveHandler threadsafe refcounted. r=ehsan
authorNikhil Marathe <nsm.nikhil@gmail.com>
Wed, 05 Aug 2015 20:58:10 -0700
changeset 288341 c6eb267a1004e04edd08e19a14466698cd0e1e82
parent 288340 c2b5e339ec06106b6feee56f9d5af26da7276214
child 288342 23e43cedb8e9d778fdcdb7c033b2b57505b2f728
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1144660
milestone42.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 1144660 - Make KeepAliveHandler threadsafe refcounted. r=ehsan This works because KeepAliveHandler only holds nsMainThreadPtrHolder<> which is itself thread safe. It has assertions that the PromiseNativeHandler overrides are only called on the worker and these assertions are satisfied.
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -1617,17 +1617,17 @@ namespace {
 class KeepAliveHandler final : public PromiseNativeHandler
 {
   nsMainThreadPtrHandle<ServiceWorker> mServiceWorker;
 
   virtual ~KeepAliveHandler()
   {}
 
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_THREADSAFE_ISUPPORTS
 
   explicit KeepAliveHandler(const nsMainThreadPtrHandle<ServiceWorker>& aServiceWorker)
     : mServiceWorker(aServiceWorker)
   {}
 
   void
   ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override
   {