Bug 1267733 P3 Trigger service worker update after failed interception. r=jdm a=ritu
authorBen Kelly <ben@wanderview.com>
Fri, 29 Apr 2016 16:55:58 -0700
changeset 326080 b7cef86d445d793c6dc0334a84a1a57e0db56c3d
parent 326079 c9d7a206612ed9e2397947b4a6de97b5e1579bbf
child 326081 8008dbbe1841442ea9d0f376bb9e47058d1a8f7c
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm, ritu
bugs1267733
milestone47.0
Bug 1267733 P3 Trigger service worker update after failed interception. r=jdm a=ritu
dom/workers/ServiceWorkerEvents.cpp
dom/workers/ServiceWorkerPrivate.cpp
--- a/dom/workers/ServiceWorkerEvents.cpp
+++ b/dom/workers/ServiceWorkerEvents.cpp
@@ -59,18 +59,18 @@ CancelChannelRunnable::CancelChannelRunn
   , mStatus(aStatus)
 {
 }
 
 NS_IMETHODIMP
 CancelChannelRunnable::Run()
 {
   MOZ_ASSERT(NS_IsMainThread());
-  nsresult rv = mChannel->Cancel(mStatus);
-  NS_ENSURE_SUCCESS(rv, rv);
+  mChannel->Cancel(mStatus);
+  mRegistration->MaybeScheduleUpdate();
   return NS_OK;
 }
 
 FetchEvent::FetchEvent(EventTarget* aOwner)
   : ExtendableEvent(aOwner)
   , mPreventDefaultLineNumber(0)
   , mPreventDefaultColumnNumber(0)
   , mIsReload(false)
--- a/dom/workers/ServiceWorkerPrivate.cpp
+++ b/dom/workers/ServiceWorkerPrivate.cpp
@@ -1257,20 +1257,16 @@ private:
         event->ReportCanceled();
       } else if (event->WidgetEventPtr()->mFlags.mExceptionHasBeenRisen) {
         // Exception logged via the WorkerPrivate ErrorReporter
       } else {
         runnable = new ResumeRequest(mInterceptedChannel);
       }
 
       if (!runnable) {
-        nsCOMPtr<nsIRunnable> updateRunnable =
-          new RegistrationUpdateRunnable(mRegistration, false /* time check */);
-        NS_DispatchToMainThread(runnable.forget());
-
         runnable = new CancelChannelRunnable(mInterceptedChannel,
                                              mRegistration,
                                              NS_ERROR_INTERCEPTION_FAILED);
       }
 
       MOZ_ALWAYS_TRUE(NS_SUCCEEDED(NS_DispatchToMainThread(runnable)));
     }