Bug 1191495 - Relax PushManager callback assertions. r=kitcambridge
☠☠ backed out by 15512b2f6f41 ☠ ☠
authorNikhil Marathe <nsm.nikhil@gmail.com>
Wed, 05 Aug 2015 13:21:08 -0700
changeset 288114 8917e73233991b25abf4bd9053cc3742eda85b4f
parent 288113 13ed6f60d3f9569b56d3d18584573d4481c500b9
child 288115 a37ae6d18b39cbdaf45a5c21fbf5cc68c5293d44
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)
reviewerskitcambridge
bugs1191495
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 1191495 - Relax PushManager callback assertions. r=kitcambridge
dom/push/PushManager.cpp
--- a/dom/push/PushManager.cpp
+++ b/dom/push/PushManager.cpp
@@ -281,26 +281,24 @@ private:
 
 class WorkerUnsubscribeResultCallback final : public nsIUnsubscribeResultCallback
 {
 public:
   NS_DECL_ISUPPORTS
 
   explicit WorkerUnsubscribeResultCallback(PromiseWorkerProxy* aProxy)
     : mProxy(aProxy)
-    , mCallbackCalled(false)
   {
     AssertIsOnMainThread();
   }
 
   NS_IMETHOD
   OnUnsubscribe(nsresult aStatus, bool aSuccess) override
   {
     AssertIsOnMainThread();
-    mCallbackCalled = true;
     if (!mProxy) {
       return NS_OK;
     }
 
     MutexAutoLock lock(mProxy->GetCleanUpLock());
     if (mProxy->IsClean()) {
       return NS_OK;
     }
@@ -314,24 +312,19 @@ public:
       ReleasePromiseWorkerProxy(mProxy.forget());
     }
 
     return NS_OK;
   }
 
 private:
   ~WorkerUnsubscribeResultCallback()
-  {
-    // Enforces that UnsubscribeRunnable uses the callback for error
-    // reporting once it creates the callback.
-    MOZ_ASSERT(mCallbackCalled);
-  }
+  {}
 
   nsRefPtr<PromiseWorkerProxy> mProxy;
-  DebugOnly<bool> mCallbackCalled;
 };
 
 NS_IMPL_ISUPPORTS(WorkerUnsubscribeResultCallback, nsIUnsubscribeResultCallback)
 
 class UnsubscribeRunnable final : public nsRunnable
 {
 public:
   UnsubscribeRunnable(PromiseWorkerProxy* aProxy,
@@ -472,24 +465,22 @@ class GetSubscriptionCallback final : pu
 {
 public:
   NS_DECL_ISUPPORTS
 
   explicit GetSubscriptionCallback(PromiseWorkerProxy* aProxy,
                                    const nsAString& aScope)
     : mProxy(aProxy)
     , mScope(aScope)
-    , mCallbackCalled(false)
   {}
 
   NS_IMETHOD
   OnPushEndpoint(nsresult aStatus, const nsAString& aEndpoint) override
   {
     AssertIsOnMainThread();
-    mCallbackCalled = true;
 
     if (!mProxy) {
       return NS_OK;
     }
 
     MutexAutoLock lock(mProxy->GetCleanUpLock());
     if (mProxy->IsClean()) {
       return NS_OK;
@@ -503,26 +494,21 @@ public:
     if (!r->Dispatch(jsapi.cx())) {
       ReleasePromiseWorkerProxy(mProxy.forget());
     }
     return NS_OK;
   }
 
 protected:
   ~GetSubscriptionCallback()
-  {
-    // Enforces that GetSubscriptionRunnable uses the callback for error
-    // reporting once it creates the callback.
-    MOZ_ASSERT(mCallbackCalled);
-  }
+  {}
 
 private:
   nsRefPtr<PromiseWorkerProxy> mProxy;
   nsString mScope;
-  DebugOnly<bool> mCallbackCalled;
 };
 
 NS_IMPL_ISUPPORTS(GetSubscriptionCallback, nsIPushEndpointCallback)
 
 class GetSubscriptionRunnable final : public nsRunnable
 {
 public:
   GetSubscriptionRunnable(PromiseWorkerProxy* aProxy,