Bug 1465587 Only hide the initial internal redirect to an InterceptedHttpChannel and not internal redirects initiated from IHC. r=mayhemer
authorBen Kelly <ben@wanderview.com>
Fri, 01 Jun 2018 10:56:57 -0700
changeset 420930 7e6bcb2cd0d86e5468402ae680f9ce10c88b0aca
parent 420929 8733db9b64b090b34f9e44139739299d2c8903b8
child 420931 7f4eeef07a85b27f3795a34030a16ad20675831a
push id34083
push userapavel@mozilla.com
push dateSat, 02 Jun 2018 23:03:25 +0000
treeherdermozilla-central@1f62ecdf59b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1465587
milestone62.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 1465587 Only hide the initial internal redirect to an InterceptedHttpChannel and not internal redirects initiated from IHC. r=mayhemer
netwerk/protocol/http/HttpChannelParent.cpp
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -1761,27 +1761,25 @@ HttpChannelParent::StartRedirect(uint32_
     return NS_BINDING_ABORTED;
   }
 
   // If this is an internal redirect for service worker interception, then
   // hide it from the child process.  The original e10s interception code
   // was not designed with this in mind and its not necessary to replace
   // the HttpChannelChild/Parent objects in this case.
   if (redirectFlags & nsIChannelEventSink::REDIRECT_INTERNAL) {
+    nsCOMPtr<nsIInterceptedChannel> oldIntercepted =
+        do_QueryInterface(static_cast<nsIChannel*>(mChannel.get()));
     nsCOMPtr<nsIInterceptedChannel> newIntercepted = do_QueryInterface(newChannel);
-    if (newIntercepted) {
-#ifdef DEBUG
-      // Note, InterceptedHttpChannel can also do an internal redirect
-      // for opaque response interception.  This should not actually
-      // happen here in e10s mode.
-      nsCOMPtr<nsIInterceptedChannel> oldIntercepted =
-        do_QueryInterface(static_cast<nsIChannel*>(mChannel.get()));
-      MOZ_ASSERT(!oldIntercepted);
-#endif
 
+    // We only want to hide the special internal redirect from nsHttpChannel
+    // to InterceptedHttpChannel.  We want to allow through internal redirects
+    // initiated from the InterceptedHttpChannel even if they are to another
+    // InterceptedHttpChannel.
+    if (!oldIntercepted && newIntercepted) {
       // We need to move across the reserved and initial client information
       // to the new channel.  Normally this would be handled by the child
       // ClientChannelHelper, but that is not notified of this redirect since
       // we're not propagating it back to the child process.
       nsCOMPtr<nsILoadInfo> oldLoadInfo;
       Unused << mChannel->GetLoadInfo(getter_AddRefs(oldLoadInfo));
       nsCOMPtr<nsILoadInfo> newLoadInfo;
       Unused << newChannel->GetLoadInfo(getter_AddRefs(newLoadInfo));