Bug 1440941 - FetchDriver should check if the operation has been already aborted when OnStartRequest is called, r=bkelly a=lizzard DEVEDITION_59_0b14_BUILD1 DEVEDITION_59_0b14_RELEASE FIREFOX_59_0b14_BUILD1 FIREFOX_59_0b14_RELEASE
authorAndrea Marchesini <amarchesini@mozilla.com>
Mon, 26 Feb 2018 22:32:15 +0100
changeset 455069 f83587c150abb271b3f15742007994ca57bc8395
parent 455068 4ebc3f8a7357f68c706ef8224c6ed91697bc22d5
child 455070 a330f1d4d12a7c144797f3686f35a99c37b0755e
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly, lizzard
bugs1440941
milestone59.0
Bug 1440941 - FetchDriver should check if the operation has been already aborted when OnStartRequest is called, r=bkelly a=lizzard
dom/fetch/FetchDriver.cpp
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -764,16 +764,21 @@ FetchDriver::OnStartRequest(nsIRequest* 
                             nsISupports* aContext)
 {
   workers::AssertIsOnMainThread();
 
   // Note, this can be called multiple times if we are doing an opaqueredirect.
   // In that case we will get a simulated OnStartRequest() and then the real
   // channel will call in with an errored OnStartRequest().
 
+  if (!mChannel) {
+    MOZ_ASSERT(!mObserver);
+    return NS_BINDING_ABORTED;
+  }
+
   nsresult rv;
   aRequest->GetStatus(&rv);
   if (NS_FAILED(rv)) {
     FailWithNetworkError(rv);
     return rv;
   }
 
   // We should only get to the following code once.