Bug 1641737 - P5. Remove unnecessary method. r=mattwoodrow
☠☠ backed out by 0f4b97c32ba0 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 09 Jun 2020 07:24:04 +0000
changeset 534608 abd9cd77f3cb3e6a7734af2b8e4a22de4b931382
parent 534607 e3bf9a45db6afe5fa55afa7e6b5d3992ea2b4b8d
child 534609 32fba417ebd01dfb2c2a392cdb1fad7ef66e96e8
push id37492
push userapavel@mozilla.com
push dateTue, 09 Jun 2020 15:16:49 +0000
treeherdermozilla-central@7f7b98339065 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1641737
milestone79.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 1641737 - P5. Remove unnecessary method. r=mattwoodrow Differential Revision: https://phabricator.services.mozilla.com/D78210
netwerk/ipc/DocumentChannelChild.cpp
netwerk/ipc/DocumentChannelParent.cpp
netwerk/ipc/PDocumentChannel.ipdl
--- a/netwerk/ipc/DocumentChannelChild.cpp
+++ b/netwerk/ipc/DocumentChannelChild.cpp
@@ -120,23 +120,16 @@ IPCResult DocumentChannelChild::RecvFail
 }
 
 IPCResult DocumentChannelChild::RecvDisconnectChildListeners(
     const nsresult& aStatus, const nsresult& aLoadGroupStatus) {
   DisconnectChildListeners(aStatus, aLoadGroupStatus);
   return IPC_OK();
 }
 
-IPCResult DocumentChannelChild::RecvDeleteSelf() {
-  // This calls NeckoChild::DeallocPGenericChannel(), which deletes |this| if
-  // IPDL holds the last reference.  Don't rely on |this| existing after here!
-  Send__delete__(this);
-  return IPC_OK();
-}
-
 IPCResult DocumentChannelChild::RecvRedirectToRealChannel(
     RedirectToRealChannelArgs&& aArgs,
     nsTArray<Endpoint<extensions::PStreamFilterParent>>&& aEndpoints,
     RedirectToRealChannelResolver&& aResolve) {
   LOG(("DocumentChannelChild RecvRedirectToRealChannel [this=%p, uri=%s]", this,
        aArgs.uri()->GetSpecOrDefault().get()));
 
   // The document that created the cspToInherit.
--- a/netwerk/ipc/DocumentChannelParent.cpp
+++ b/netwerk/ipc/DocumentChannelParent.cpp
@@ -74,18 +74,17 @@ bool DocumentChannelParent::Init(dom::Ca
             aResolveValue.mRedirectFlags, aResolveValue.mLoadFlags);
         // We chain the promise the DLL is waiting on to the one returned by
         // RedirectToRealChannel. As soon as the promise returned is resolved
         // or rejected, so will the DLL's promise.
         promise->ChainTo(aResolveValue.mPromise.forget(), __func__);
         self->mDocumentLoadListener = nullptr;
       },
       [self](DocumentLoadListener::OpenPromiseFailedType&& aRejectValue) {
-        if (aRejectValue.mStatus == NS_ERROR_DOCSHELL_DYING) {
-          Unused << self->SendDeleteSelf();
+        if (!self->CanSend()) {
           return;
         }
         Unused << self->SendDisconnectChildListeners(
             aRejectValue.mStatus, aRejectValue.mLoadGroupStatus);
         self->mDocumentLoadListener = nullptr;
       });
 
   return true;
--- a/netwerk/ipc/PDocumentChannel.ipdl
+++ b/netwerk/ipc/PDocumentChannel.ipdl
@@ -47,18 +47,13 @@ child:
   // We do this so we can remove using NS_BINDING_RETARGETED, but still have the
   // channel not be in an error state.
   async DisconnectChildListeners(nsresult aStatus, nsresult aLoadGroupReason);
 
   // Triggers replacing this DocumentChannel with a 'real' channel (like PHttpChannel),
   // and notifies the listener via a redirect to the new channel.
   async RedirectToRealChannel(RedirectToRealChannelArgs args, Endpoint<PStreamFilterParent>[] aEndpoint)
       returns (nsresult rv);
-
-  // Tell child to delete channel (all IPDL deletes must be done from child to
-  // avoid races: see bug 591708).
-  async DeleteSelf();
-
 };
 
 } // namespace net
 } // namespace mozilla