Bug 1596330 - Remove CrossProcessRedirectDone and FinishCrossProcessSwitch r=mattwoodrow
authorPaul Bone <pbone@mozilla.com>
Thu, 14 Nov 2019 08:43:06 +0000
changeset 502083 fa6c87627ec8d357de398ebdbb05bc03399b8df4
parent 502082 f406de07f131f6478b7d012f3534021698331f74
child 502084 152f204eda63b35bb0d12b989141dd7261d32452
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1596330
milestone72.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 1596330 - Remove CrossProcessRedirectDone and FinishCrossProcessSwitch r=mattwoodrow Depends on D52950 Differential Revision: https://phabricator.services.mozilla.com/D52951
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/HttpChannelParent.h
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -1225,67 +1225,16 @@ void HttpChannelParent::MaybeFlushPendin
     return;
   }
 
   if (mDivertListener) {
     DivertTo(mDivertListener);
   }
 }
 
-void HttpChannelParent::FinishCrossProcessSwitch(nsHttpChannel* aChannel,
-                                                 nsresult aStatus) {
-  if (NS_SUCCEEDED(aStatus)) {
-    nsCOMPtr<nsIRedirectResultListener> redirectListener;
-    NS_QueryNotificationCallbacks(aChannel, redirectListener);
-    MOZ_ASSERT(redirectListener);
-
-    // This updates ParentChannelListener to point to this parent and at
-    // the same time cancels the old channel.
-    redirectListener->OnRedirectResult(true);
-  }
-
-  aChannel->OnRedirectVerifyCallback(aStatus);
-}
-
-void HttpChannelParent::CrossProcessRedirectDone(
-    const nsresult& aResult,
-    const mozilla::Maybe<LoadInfoArgs>& aLoadInfoArgs) {
-  RefPtr<nsHttpChannel> chan = do_QueryObject(mChannel);
-  nsresult rv = aResult;
-  auto sendReply = MakeScopeExit([&]() { FinishCrossProcessSwitch(chan, rv); });
-
-  if (NS_FAILED(rv)) {
-    return;
-  }
-
-  nsCOMPtr<nsILoadInfo> newLoadInfo;
-  rv = LoadInfoArgsToLoadInfo(aLoadInfoArgs, getter_AddRefs(newLoadInfo));
-  if (NS_FAILED(rv)) {
-    return;
-  }
-
-  if (newLoadInfo) {
-    chan->SetLoadInfo(newLoadInfo);
-  }
-
-  if (!mBgParent) {
-    sendReply.release();
-    RefPtr<HttpChannelParent> self = this;
-    WaitForBgParent()->Then(
-        GetMainThreadSerialEventTarget(), __func__,
-        [self, chan, aResult]() {
-          self->FinishCrossProcessSwitch(chan, aResult);
-        },
-        [self, chan](const nsresult& aRejectionRv) {
-          MOZ_ASSERT(NS_FAILED(aRejectionRv), "This should be an error code");
-          self->FinishCrossProcessSwitch(chan, aRejectionRv);
-        });
-  }
-}
-
 void HttpChannelParent::ResponseSynthesized() {
   // Suspend now even though the FinishSynthesizeResponse runnable has
   // not executed.  We want to suspend after we get far enough to trigger
   // the synthesis, but not actually allow the nsHttpChannel to trigger
   // any OnStartRequests().
   if (mSuspendAfterSynthesizeResponse) {
     mChannel->Suspend();
   }
--- a/netwerk/protocol/http/HttpChannelParent.h
+++ b/netwerk/protocol/http/HttpChannelParent.h
@@ -243,21 +243,16 @@ class HttpChannelParent final : public n
 
   void DivertOnDataAvailable(const nsCString& data, const uint64_t& offset,
                              const uint32_t& count);
   void DivertOnStopRequest(const nsresult& statusCode);
   void DivertComplete();
   void MaybeFlushPendingDiversion();
   void ResponseSynthesized();
 
-  void CrossProcessRedirectDone(
-      const nsresult& aResult,
-      const mozilla::Maybe<LoadInfoArgs>& aLoadInfoArgs);
-  void FinishCrossProcessSwitch(nsHttpChannel* aChannel, nsresult aStatus);
-
   // final step for Redirect2Verify procedure, will be invoked while both
   // redirecting and redirected channel are ready or any error happened.
   // OnRedirectVerifyCallback will be invoked for finishing the async
   // redirect verification procedure.
   void ContinueRedirect2Verify(const nsresult& aResult);
 
   void AsyncOpenFailed(nsresult aRv);