Bug 1533957 - The request should be cancelled before being removed from the LoadGroup r=bzbarsky
☠☠ backed out by a41c5e860d7b ☠ ☠
authorValentin Gosu <valentin.gosu@gmail.com>
Wed, 02 Oct 2019 15:23:50 +0000
changeset 496207 19d46cc8b80fd26d928db64bc943f6062b8a5d22
parent 496206 f3804bb2592c3107beaea6ad0181c83cee42f56b
child 496208 aa6ab3f678cc54c10beba4dae1f01f70025c58b1
push id36647
push usernerli@mozilla.com
push dateFri, 04 Oct 2019 04:09:18 +0000
treeherdermozilla-central@678d4d2c3c4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs1533957
milestone71.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 1533957 - The request should be cancelled before being removed from the LoadGroup r=bzbarsky Differential Revision: https://phabricator.services.mozilla.com/D46591
netwerk/base/nsLoadGroup.cpp
--- a/netwerk/base/nsLoadGroup.cpp
+++ b/netwerk/base/nsLoadGroup.cpp
@@ -207,27 +207,27 @@ nsLoadGroup::Cancel(nsresult status) {
 
     if (MOZ_LOG_TEST(gLoadGroupLog, LogLevel::Debug)) {
       nsAutoCString nameStr;
       request->GetName(nameStr);
       LOG(("LOADGROUP [%p]: Canceling request %p %s.\n", this, request.get(),
            nameStr.get()));
     }
 
+    // Cancel the request...
+    rv = request->Cancel(status);
+
     //
     // Remove the request from the load group...  This may cause
     // the OnStopRequest notification to fire...
     //
     // XXX: What should the context be?
     //
     (void)RemoveRequest(request, nullptr, status);
 
-    // Cancel the request...
-    rv = request->Cancel(status);
-
     // Remember the first failure and return it...
     if (NS_FAILED(rv) && NS_SUCCEEDED(firstError)) firstError = rv;
   }
 
   if (mRequestContext) {
     Unused << mRequestContext->CancelTailPendingRequests(status);
   }