Bug 1637869 - P1. Cancel channel before resuming. r=mattwoodrow
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 28 May 2020 00:07:24 +0000
changeset 596495 e73a92c045b82e25a658e7966dd509f7a24eef53
parent 596494 14a902630badfa3c7ddbfe3c95fc959eddd6685d
child 596496 d08bb712835684001850881bbe70cdf6130f610e
push id13186
push userffxbld-merge
push dateMon, 01 Jun 2020 09:52:46 +0000
treeherdermozilla-beta@3e7c70a1e4a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1637869
milestone78.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 1637869 - P1. Cancel channel before resuming. r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D76314
netwerk/ipc/DocumentLoadListener.cpp
--- a/netwerk/ipc/DocumentLoadListener.cpp
+++ b/netwerk/ipc/DocumentLoadListener.cpp
@@ -802,16 +802,17 @@ void DocumentLoadListener::FinishReplace
        this, aSucceeded));
 
   if (mDoingProcessSwitch) {
     DisconnectChildListeners(NS_BINDING_ABORTED, NS_BINDING_ABORTED);
   }
 
   if (!mRedirectChannelId) {
     if (!aSucceeded) {
+      mChannel->Cancel(NS_BINDING_ABORTED);
       mChannel->Resume();
       return;
     }
     ApplyPendingFunctions(mChannel);
     // ResumeSuspendedChannel will be called later as RedirectToRealChannel
     // continues, so we can return early.
     return;
   }
@@ -841,16 +842,17 @@ void DocumentLoadListener::FinishReplace
   // Release all previously registered channels, they are no longer needed to
   // be kept in the registrar from this moment.
   registrar->DeregisterChannels(mRedirectChannelId);
   mRedirectChannelId = 0;
   if (!aSucceeded) {
     if (redirectChannel) {
       redirectChannel->Delete();
     }
+    mChannel->Cancel(NS_BINDING_ABORTED);
     mChannel->Resume();
     if (auto* ctx = GetBrowsingContext()) {
       ctx->EndDocumentLoad(this);
     }
     return;
   }
 
   MOZ_ASSERT(