Bug 1331564 - XHR SyncTeardownRunnable must run also when the worker is in killing state, r=bkelly
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 18 Jan 2017 15:05:41 +0100
changeset 377232 b3885db8150b4e0450717776f3a652ec2425503c
parent 377231 5cf462d962ce50af3d801318c58648925457bef9
child 377233 2d9cff6d389ac6ece80e6621b2a6d029bcb81908
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1331564
milestone53.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 1331564 - XHR SyncTeardownRunnable must run also when the worker is in killing state, r=bkelly
dom/xhr/XMLHttpRequestWorker.cpp
--- a/dom/xhr/XMLHttpRequestWorker.cpp
+++ b/dom/xhr/XMLHttpRequestWorker.cpp
@@ -1628,22 +1628,20 @@ XMLHttpRequestWorker::ReleaseProxy(Relea
         mProxy->mOuterEventStreamId++;
       }
 
       // We need to make a sync call here.
       RefPtr<SyncTeardownRunnable> runnable =
         new SyncTeardownRunnable(mWorkerPrivate, mProxy);
       mProxy = nullptr;
 
-      ErrorResult forAssertionsOnly;
+      IgnoredErrorResult forAssertionsOnly;
       // This runnable _must_ be executed.
-      runnable->Dispatch(Killing, forAssertionsOnly);
-      if (forAssertionsOnly.Failed()) {
-        NS_ERROR("Failed to dispatch teardown runnable!");
-      }
+      runnable->Dispatch(Dead, forAssertionsOnly);
+      MOZ_DIAGNOSTIC_ASSERT(!forAssertionsOnly.Failed());
     }
   }
 }
 
 void
 XMLHttpRequestWorker::MaybePin(ErrorResult& aRv)
 {
   mWorkerPrivate->AssertIsOnWorkerThread();