Backed out 6 changesets (bug 1616716) forcausing multiple mochitest failures on test_ext_protocolHandlers.html
authorArthur Iakab <aiakab@mozilla.com>
Wed, 26 Feb 2020 07:17:55 +0200
changeset 515608 7f41334e10443f4f1c7426e86fb0cb7adfdf4d62
parent 515607 77174cb8538c7c24a2c2d6edc6cd64edb1bbcdd1
child 515609 705b7ee46fa6af2c3b772e1185d9100e277abdce
push id37158
push useropoprus@mozilla.com
push dateWed, 26 Feb 2020 09:27:57 +0000
treeherdermozilla-central@7f41334e1044 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1616716
milestone75.0a1
backs out609cbe8b736e8538b3bfeba4ffa3e4fb001a779e
9e61658c177853e9806b0a561d63d8f63904d619
a0e842d96cd621d74889a4187066216feca64cdd
0174164a21e5682251cfef3a0d189d57a40438b8
35186917e79acc9c7171c82bb123c6ade4f2bad2
156d2898edb7af1109c621d515d96b040d3dccb4
first release with
nightly linux32
7f41334e1044 / 75.0a1 / 20200226092757 / files
nightly linux64
7f41334e1044 / 75.0a1 / 20200226092757 / files
nightly mac
7f41334e1044 / 75.0a1 / 20200226092757 / files
nightly win32
7f41334e1044 / 75.0a1 / 20200226092757 / files
nightly win64
7f41334e1044 / 75.0a1 / 20200226092757 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 6 changesets (bug 1616716) forcausing multiple mochitest failures on test_ext_protocolHandlers.html Backed out changeset 609cbe8b736e (bug 1616716) Backed out changeset 9e61658c1778 (bug 1616716) Backed out changeset a0e842d96cd6 (bug 1616716) Backed out changeset 0174164a21e5 (bug 1616716) Backed out changeset 35186917e79a (bug 1616716) Backed out changeset 156d2898edb7 (bug 1616716)
netwerk/ipc/DocumentChannelParent.cpp
netwerk/ipc/DocumentLoadListener.cpp
netwerk/ipc/DocumentLoadListener.h
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/ParentChannelListener.cpp
netwerk/protocol/http/ParentChannelListener.h
--- a/netwerk/ipc/DocumentChannelParent.cpp
+++ b/netwerk/ipc/DocumentChannelParent.cpp
@@ -1,32 +1,29 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et tw=80 : */
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DocumentChannelParent.h"
-#include "mozilla/dom/BrowserParent.h"
 
 extern mozilla::LazyLogModule gDocumentChannelLog;
 #define LOG(fmt) MOZ_LOG(gDocumentChannelLog, mozilla::LogLevel::Verbose, fmt)
 
-using namespace mozilla::dom;
-
 namespace mozilla {
 namespace net {
 
 DocumentChannelParent::DocumentChannelParent(BrowserParent* aBrowser,
                                              nsILoadContext* aLoadContext,
                                              PBOverrideStatus aOverrideStatus) {
   LOG(("DocumentChannelParent ctor [this=%p]", this));
-  mParent = new DocumentLoadListener(aBrowser->GetBrowsingContext(),
-                                     aLoadContext, aOverrideStatus, this);
+  mParent =
+      new DocumentLoadListener(aBrowser, aLoadContext, aOverrideStatus, this);
 }
 
 DocumentChannelParent::~DocumentChannelParent() {
   LOG(("DocumentChannelParent dtor [this=%p]", this));
 }
 
 bool DocumentChannelParent::Init(BrowserParent* aBrowser,
                                  const DocumentChannelCreationArgs& aArgs) {
@@ -36,24 +33,23 @@ bool DocumentChannelParent::Init(Browser
        loadState->URI()->GetSpecOrDefault().get()));
 
   RefPtr<class LoadInfo> loadInfo;
   nsresult rv = mozilla::ipc::LoadInfoArgsToLoadInfo(Some(aArgs.loadInfo()),
                                                      getter_AddRefs(loadInfo));
   MOZ_ASSERT(NS_SUCCEEDED(rv));
 
   rv = NS_ERROR_UNEXPECTED;
-  if (!mParent->Open(aBrowser->GetBrowsingContext(), loadState, loadInfo,
-                     aArgs.loadFlags(), aArgs.loadType(), aArgs.cacheKey(),
-                     aArgs.isActive(), aArgs.isTopLevelDoc(),
-                     aArgs.hasNonEmptySandboxingFlags(), aArgs.topWindowURI(),
-                     aArgs.contentBlockingAllowListPrincipal(),
-                     aArgs.channelId(), aArgs.asyncOpenTime(),
-                     aArgs.documentOpenFlags(), aArgs.pluginsAllowed(),
-                     aArgs.timing().refOr(nullptr), &rv)) {
+  if (!mParent->Open(
+          aBrowser, loadState, loadInfo, aArgs.loadFlags(), aArgs.loadType(),
+          aArgs.cacheKey(), aArgs.isActive(), aArgs.isTopLevelDoc(),
+          aArgs.hasNonEmptySandboxingFlags(), aArgs.topWindowURI(),
+          aArgs.contentBlockingAllowListPrincipal(), aArgs.channelId(),
+          aArgs.asyncOpenTime(), aArgs.documentOpenFlags(),
+          aArgs.pluginsAllowed(), aArgs.timing().refOr(nullptr), &rv)) {
     return SendFailedAsyncOpen(rv);
   }
 
   return true;
 }
 
 RefPtr<PDocumentChannelParent::RedirectToRealChannelPromise>
 DocumentChannelParent::RedirectToRealChannel(uint32_t aRedirectFlags,
--- a/netwerk/ipc/DocumentLoadListener.cpp
+++ b/netwerk/ipc/DocumentLoadListener.cpp
@@ -4,16 +4,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DocumentLoadListener.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/MozPromiseInlines.h"  // For MozPromise::FromDomPromise
+#include "mozilla/dom/BrowserParent.h"
 #include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/ClientChannelHelper.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/ContentProcessManager.h"
 #include "mozilla/dom/ipc/IdType.h"
 #include "mozilla/dom/ServiceWorkerManager.h"
 #include "mozilla/net/HttpChannelParent.h"
 #include "mozilla/net/RedirectChannelRegistrar.h"
@@ -228,37 +229,35 @@ NS_INTERFACE_MAP_BEGIN(DocumentLoadListe
   NS_INTERFACE_MAP_ENTRY(nsIParentChannel)
   NS_INTERFACE_MAP_ENTRY(nsIAsyncVerifyRedirectReadyCallback)
   NS_INTERFACE_MAP_ENTRY(nsIChannelEventSink)
   NS_INTERFACE_MAP_ENTRY(nsIProcessSwitchRequestor)
   NS_INTERFACE_MAP_ENTRY(nsIMultiPartChannelListener)
   NS_INTERFACE_MAP_ENTRY_CONCRETE(DocumentLoadListener)
 NS_INTERFACE_MAP_END
 
-DocumentLoadListener::DocumentLoadListener(
-    CanonicalBrowsingContext* aProcessTopBrowsingContext,
-    nsILoadContext* aLoadContext, PBOverrideStatus aOverrideStatus,
-    ADocumentChannelBridge* aBridge)
+DocumentLoadListener::DocumentLoadListener(BrowserParent* aBrowser,
+                                           nsILoadContext* aLoadContext,
+                                           PBOverrideStatus aOverrideStatus,
+                                           ADocumentChannelBridge* aBridge)
     : mLoadContext(aLoadContext), mPBOverride(aOverrideStatus) {
   LOG(("DocumentLoadListener ctor [this=%p]", this));
-  mParentChannelListener = new ParentChannelListener(
-      this, aProcessTopBrowsingContext, aLoadContext->UsePrivateBrowsing());
+  mParentChannelListener = new ParentChannelListener(this, aBrowser);
   mDocumentChannelBridge = aBridge;
 }
 
 DocumentLoadListener::~DocumentLoadListener() {
   LOG(("DocumentLoadListener dtor [this=%p]", this));
 }
 
 bool DocumentLoadListener::Open(
-    CanonicalBrowsingContext* aProcessTopBrowsingContext,
-    nsDocShellLoadState* aLoadState, class LoadInfo* aLoadInfo,
-    nsLoadFlags aLoadFlags, uint32_t aLoadType, uint32_t aCacheKey,
-    bool aIsActive, bool aIsTopLevelDoc, bool aHasNonEmptySandboxingFlags,
-    const Maybe<URIParams>& aTopWindowURI,
+    BrowserParent* aBrowser, nsDocShellLoadState* aLoadState,
+    LoadInfo* aLoadInfo, nsLoadFlags aLoadFlags, uint32_t aLoadType,
+    uint32_t aCacheKey, bool aIsActive, bool aIsTopLevelDoc,
+    bool aHasNonEmptySandboxingFlags, const Maybe<URIParams>& aTopWindowURI,
     const Maybe<PrincipalInfo>& aContentBlockingAllowListPrincipal,
     const uint64_t& aChannelId, const TimeStamp& aAsyncOpenTime,
     const Maybe<uint32_t>& aDocumentOpenFlags, bool aPluginsAllowed,
     nsDOMNavigationTiming* aTiming, nsresult* aRv) {
   LOG(("DocumentLoadListener Open [this=%p, uri=%s]", this,
        aLoadState->URI()->GetSpecOrDefault().get()));
 
   if (!nsDocShell::CreateAndConfigureRealChannelForLoadState(
@@ -310,17 +309,17 @@ bool DocumentLoadListener::Open(
   // Setup a ClientChannelHelper to watch for redirects, and copy
   // across any serviceworker related data between channels as needed.
   AddClientChannelHelperInParent(mChannel, GetMainThreadSerialEventTarget());
 
   if (aDocumentOpenFlags) {
     RefPtr<ParentProcessDocumentOpenInfo> openInfo =
         new ParentProcessDocumentOpenInfo(mParentChannelListener,
                                           aPluginsAllowed, *aDocumentOpenFlags,
-                                          aProcessTopBrowsingContext);
+                                          aBrowser->GetBrowsingContext());
     openInfo->Prepare();
 
     *aRv = mChannel->AsyncOpen(openInfo);
   } else {
     *aRv = mChannel->AsyncOpen(mParentChannelListener);
   }
   if (NS_FAILED(*aRv)) {
     mParentChannelListener = nullptr;
--- a/netwerk/ipc/DocumentLoadListener.h
+++ b/netwerk/ipc/DocumentLoadListener.h
@@ -9,17 +9,17 @@
 
 #include "mozilla/MozPromise.h"
 #include "mozilla/Variant.h"
 #include "mozilla/net/NeckoCommon.h"
 #include "mozilla/net/NeckoParent.h"
 #include "mozilla/net/PDocumentChannelParent.h"
 #include "mozilla/net/ParentChannelListener.h"
 #include "mozilla/net/ADocumentChannelBridge.h"
-#include "mozilla/dom/CanonicalBrowsingContext.h"
+#include "mozilla/dom/BrowserParent.h"
 #include "nsDOMNavigationTiming.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIObserver.h"
 #include "nsIParentChannel.h"
 #include "nsIParentRedirectingChannel.h"
 #include "nsIProcessSwitchRequestor.h"
 #include "nsIRedirectResultListener.h"
 #include "nsIMultiPartChannel.h"
@@ -58,33 +58,28 @@ class LoadInfo;
 class DocumentLoadListener : public nsIInterfaceRequestor,
                              public nsIAsyncVerifyRedirectReadyCallback,
                              public nsIParentChannel,
                              public nsIChannelEventSink,
                              public HttpChannelSecurityWarningReporter,
                              public nsIProcessSwitchRequestor,
                              public nsIMultiPartChannelListener {
  public:
-  // aProcessTopBrowsingContext should be the top BrowsingContext in the same
-  // process as the load, which would be the owner of the BrowserParent (if
-  // has been created).
-  // This is weird legacy behaviour, that will be cleaned up with bug 1618057.
-  explicit DocumentLoadListener(
-      dom::CanonicalBrowsingContext* aProcessTopBrowsingContext,
-      nsILoadContext* aLoadContext, PBOverrideStatus aOverrideStatus,
-      ADocumentChannelBridge* aBridge);
+  explicit DocumentLoadListener(dom::BrowserParent* aBrowser,
+                                nsILoadContext* aLoadContext,
+                                PBOverrideStatus aOverrideStatus,
+                                ADocumentChannelBridge* aBridge);
 
   // Creates the channel, and then calls AsyncOpen on it.
-  // Must be the same BrowsingContext as was passed to the constructor, we
+  // Must be the same BrowserParent as was passed to the constructor, we
   // expect Necko to pass it again so that we don't need a member var for
   // it.
-  bool Open(dom::CanonicalBrowsingContext* aProcessTopBrowsingContext,
-            nsDocShellLoadState* aLoadState, class LoadInfo* aLoadInfo,
-            nsLoadFlags aLoadFlags, uint32_t aLoadType, uint32_t aCacheKey,
-            bool aIsActive, bool aIsTopLevelDoc,
+  bool Open(dom::BrowserParent* aBrowser, nsDocShellLoadState* aLoadState,
+            LoadInfo* aLoadInfo, nsLoadFlags aLoadFlags, uint32_t aLoadType,
+            uint32_t aCacheKey, bool aIsActive, bool aIsTopLevelDoc,
             bool aHasNonEmptySandboxingFlags,
             const Maybe<ipc::URIParams>& aTopWindowURI,
             const Maybe<ipc::PrincipalInfo>& aContentBlockingAllowListPrincipal,
             const uint64_t& aChannelId, const TimeStamp& aAsyncOpenTime,
             const Maybe<uint32_t>& aDocumentOpenFlags, bool aPluginsAllowed,
             nsDOMNavigationTiming* aTiming, nsresult* aRv);
 
   NS_DECL_ISUPPORTS
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -506,19 +506,18 @@ bool HttpChannelParent::DoAsyncOpen(
       httpChannel->SetEmptyRequestHeader(requestHeaders[i].mHeader);
     } else {
       httpChannel->SetRequestHeader(requestHeaders[i].mHeader,
                                     requestHeaders[i].mValue,
                                     requestHeaders[i].mMerge);
     }
   }
 
-  RefPtr<ParentChannelListener> parentListener = new ParentChannelListener(
-      this, mBrowserParent ? mBrowserParent->GetBrowsingContext() : nullptr,
-      mLoadContext && mLoadContext->UsePrivateBrowsing());
+  RefPtr<ParentChannelListener> parentListener =
+      new ParentChannelListener(this, mBrowserParent);
 
   httpChannel->SetRequestMethod(nsDependentCString(requestMethod.get()));
 
   if (aCorsPreflightArgs.isSome()) {
     const CorsPreflightArgs& args = aCorsPreflightArgs.ref();
     httpChannel->SetCorsPreflightParameters(args.unsafeHeaders());
   }
 
--- a/netwerk/protocol/http/ParentChannelListener.cpp
+++ b/netwerk/protocol/http/ParentChannelListener.cpp
@@ -16,40 +16,32 @@
 #include "mozilla/Unused.h"
 #include "nsIHttpHeaderVisitor.h"
 #include "nsIPrompt.h"
 #include "nsISecureBrowserUI.h"
 #include "nsIWindowWatcher.h"
 #include "nsQueryObject.h"
 #include "nsIAuthPrompt.h"
 #include "nsIAuthPrompt2.h"
-#include "nsIPromptFactory.h"
-#include "Element.h"
-#include "nsILoginManagerAuthPrompter.h"
-#include "mozilla/dom/CanonicalBrowsingContext.h"
-#include "mozilla/dom/LoadURIOptionsBinding.h"
-#include "nsIWebNavigation.h"
 
 using mozilla::Unused;
 using mozilla::dom::ServiceWorkerInterceptController;
 using mozilla::dom::ServiceWorkerParentInterceptEnabled;
 
 namespace mozilla {
 namespace net {
 
-ParentChannelListener::ParentChannelListener(
-    nsIStreamListener* aListener,
-    dom::CanonicalBrowsingContext* aBrowsingContext, bool aUsePrivateBrowsing)
+ParentChannelListener::ParentChannelListener(nsIStreamListener* aListener,
+                                             dom::BrowserParent* aBrowserParent)
     : mNextListener(aListener),
       mSuspendedForDiversion(false),
       mShouldIntercept(false),
       mShouldSuspendIntercept(false),
       mInterceptCanceled(false),
-      mBrowsingContext(aBrowsingContext),
-      mUsePrivateBrowsing(aUsePrivateBrowsing) {
+      mBrowserParent(aBrowserParent) {
   LOG(("ParentChannelListener::ParentChannelListener [this=%p, next=%p]", this,
        aListener));
 
   if (ServiceWorkerParentInterceptEnabled()) {
     mInterceptController = new ServiceWorkerInterceptController();
   }
 }
 
@@ -64,18 +56,16 @@ ParentChannelListener::~ParentChannelLis
 NS_IMPL_ADDREF(ParentChannelListener)
 NS_IMPL_RELEASE(ParentChannelListener)
 NS_INTERFACE_MAP_BEGIN(ParentChannelListener)
   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
   NS_INTERFACE_MAP_ENTRY(nsIStreamListener)
   NS_INTERFACE_MAP_ENTRY(nsIRequestObserver)
   NS_INTERFACE_MAP_ENTRY(nsIMultiPartChannelListener)
   NS_INTERFACE_MAP_ENTRY(nsINetworkInterceptController)
-  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAuthPromptProvider, mBrowsingContext)
-  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIRemoteWindowContext, mBrowsingContext)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInterfaceRequestor)
   NS_INTERFACE_MAP_ENTRY_CONCRETE(ParentChannelListener)
 NS_INTERFACE_MAP_END
 
 //-----------------------------------------------------------------------------
 // ParentChannelListener::nsIRequestObserver
 //-----------------------------------------------------------------------------
 
@@ -155,19 +145,26 @@ ParentChannelListener::OnAfterLastPart(n
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 ParentChannelListener::GetInterface(const nsIID& aIID, void** result) {
   if (aIID.Equals(NS_GET_IID(nsINetworkInterceptController))) {
     return QueryInterface(aIID, result);
   }
 
-  if (mBrowsingContext && aIID.Equals(NS_GET_IID(nsIPrompt))) {
-    nsCOMPtr<dom::Element> frameElement =
-        mBrowsingContext->Top()->GetEmbedderElement();
+  if (aIID.Equals(NS_GET_IID(nsIAuthPromptProvider)) ||
+      aIID.Equals(NS_GET_IID(nsISecureBrowserUI)) ||
+      aIID.Equals(NS_GET_IID(nsIRemoteTab))) {
+    if (mBrowserParent) {
+      return mBrowserParent->QueryInterface(aIID, result);
+    }
+  }
+
+  if (mBrowserParent && aIID.Equals(NS_GET_IID(nsIPrompt))) {
+    nsCOMPtr<dom::Element> frameElement = mBrowserParent->GetOwnerElement();
     if (frameElement) {
       nsCOMPtr<nsPIDOMWindowOuter> win = frameElement->OwnerDoc()->GetWindow();
       NS_ENSURE_TRUE(win, NS_ERROR_UNEXPECTED);
 
       nsresult rv;
       nsCOMPtr<nsIWindowWatcher> wwatch =
           do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
 
@@ -181,19 +178,30 @@ ParentChannelListener::GetInterface(cons
         return rv;
       }
 
       prompt.forget(result);
       return NS_OK;
     }
   }
 
-  if (mBrowsingContext && (aIID.Equals(NS_GET_IID(nsIAuthPrompt)) ||
-                           aIID.Equals(NS_GET_IID(nsIAuthPrompt2)))) {
-    return GetAuthPrompt(nsIAuthPromptProvider::PROMPT_NORMAL, aIID, result);
+  if (mBrowserParent && (aIID.Equals(NS_GET_IID(nsIAuthPrompt)) ||
+                         aIID.Equals(NS_GET_IID(nsIAuthPrompt2)))) {
+    nsCOMPtr<nsIAuthPromptProvider> provider(do_QueryObject(mBrowserParent));
+    if (provider) {
+      return provider->GetAuthPrompt(nsIAuthPromptProvider::PROMPT_NORMAL, aIID,
+                                     result);
+    }
+  }
+
+  if (aIID.Equals(NS_GET_IID(nsIRemoteWindowContext)) && mBrowserParent) {
+    nsCOMPtr<nsIRemoteWindowContext> ctx(
+        new dom::RemoteWindowContext(mBrowserParent));
+    ctx.forget(result);
+    return NS_OK;
   }
 
   nsCOMPtr<nsIInterfaceRequestor> ir;
   if (mNextListener && NS_SUCCEEDED(CallQueryInterface(mNextListener.get(),
                                                        getter_AddRefs(ir)))) {
     return ir->GetInterface(aIID, result);
   }
 
@@ -372,71 +380,10 @@ void ParentChannelListener::ClearInterce
     mInterceptedChannel->CancelInterception(NS_ERROR_INTERCEPTION_FAILED);
     mInterceptedChannel = nullptr;
   }
   // Note that channel interception has been canceled.  If we got this before
   // the interception even occured we will trigger the cancel later.
   mInterceptCanceled = true;
 }
 
-//-----------------------------------------------------------------------------
-// ParentChannelListener::nsIAuthPromptProvider
-//
-
-NS_IMETHODIMP
-ParentChannelListener::GetAuthPrompt(uint32_t aPromptReason, const nsIID& iid,
-                                     void** aResult) {
-  if (!mBrowsingContext) {
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-  // we're either allowing auth, or it's a proxy request
-  nsresult rv;
-  nsCOMPtr<nsIPromptFactory> wwatch =
-      do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsPIDOMWindowOuter> window;
-  RefPtr<dom::Element> frame = mBrowsingContext->Top()->GetEmbedderElement();
-  if (frame) window = frame->OwnerDoc()->GetWindow();
-
-  // Get an auth prompter for our window so that the parenting
-  // of the dialogs works as it should when using tabs.
-  nsCOMPtr<nsISupports> prompt;
-  rv = wwatch->GetPrompt(window, iid, getter_AddRefs(prompt));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsILoginManagerAuthPrompter> prompter = do_QueryInterface(prompt);
-  if (prompter) {
-    prompter->SetBrowser(frame);
-  }
-
-  *aResult = prompt.forget().take();
-  return NS_OK;
-}
-
-//-----------------------------------------------------------------------------
-// ParentChannelListener::nsIRemoteWindowContext
-//
-
-NS_IMETHODIMP
-ParentChannelListener::OpenURI(nsIURI* aURI) {
-  nsCString spec;
-  aURI->GetSpec(spec);
-
-  dom::LoadURIOptions loadURIOptions;
-  loadURIOptions.mTriggeringPrincipal = nsContentUtils::GetSystemPrincipal();
-  loadURIOptions.mLoadFlags =
-      nsIWebNavigation::LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
-      nsIWebNavigation::LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
-
-  ErrorResult rv;
-  mBrowsingContext->LoadURI(NS_ConvertUTF8toUTF16(spec), loadURIOptions, rv);
-  return rv.StealNSResult();
-}
-
-NS_IMETHODIMP
-ParentChannelListener::GetUsePrivateBrowsing(bool* aUsePrivateBrowsing) {
-  *aUsePrivateBrowsing = mUsePrivateBrowsing;
-  return NS_OK;
-}
-
 }  // namespace net
 }  // namespace mozilla
--- a/netwerk/protocol/http/ParentChannelListener.h
+++ b/netwerk/protocol/http/ParentChannelListener.h
@@ -3,24 +3,21 @@
 
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_net_ParentChannelListener_h
 #define mozilla_net_ParentChannelListener_h
 
-#include "nsIAuthPromptProvider.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsINetworkInterceptController.h"
 #include "nsIStreamListener.h"
 #include "nsIMultiPartChannel.h"
-#include "nsIRemoteWindowContext.h"
-#include "mozilla/dom/CanonicalBrowsingContext.h"
-#include "mozilla/dom/CanonicalBrowsingContext.h"
+#include "mozilla/dom/BrowserParent.h"
 
 namespace mozilla {
 namespace net {
 
 #define PARENT_CHANNEL_LISTENER                      \
   {                                                  \
     0xa4e2c10c, 0xceba, 0x457f, {                    \
       0xa8, 0x0d, 0x78, 0x2b, 0x23, 0xba, 0xbd, 0x16 \
@@ -29,35 +26,29 @@ namespace net {
 
 // Note: nsIInterfaceRequestor must be the first base so that do_QueryObject()
 // works correctly on this object, as it's needed to compute a void* pointing to
 // the beginning of this object.
 
 class ParentChannelListener final : public nsIInterfaceRequestor,
                                     public nsIStreamListener,
                                     public nsIMultiPartChannelListener,
-                                    public nsINetworkInterceptController,
-                                    private nsIAuthPromptProvider,
-                                    private nsIRemoteWindowContext {
+                                    public nsINetworkInterceptController {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIMULTIPARTCHANNELLISTENER
   NS_DECL_NSINETWORKINTERCEPTCONTROLLER
-  NS_DECL_NSIAUTHPROMPTPROVIDER
-  NS_DECL_NSIREMOTEWINDOWCONTEXT
 
   NS_DECLARE_STATIC_IID_ACCESSOR(PARENT_CHANNEL_LISTENER)
 
-  explicit ParentChannelListener(
-      nsIStreamListener* aListener,
-      dom::CanonicalBrowsingContext* aBrowsingContext,
-      bool aUsePrivateBrowsing);
+  explicit ParentChannelListener(nsIStreamListener* aListener,
+                                 dom::BrowserParent* aBrowserParent);
 
   // For channel diversion from child to parent.
   void DivertTo(nsIStreamListener* aListener);
   MOZ_MUST_USE nsresult SuspendForDiversion();
 
   void SetupInterception(const nsHttpResponseHead& aResponseHead);
   void SetupInterceptionAfterRedirect(bool aShouldIntercept);
   void ClearInterceptedChannel(nsIStreamListener* aListener);
@@ -93,24 +84,21 @@ class ParentChannelListener final : publ
 
   // Handle to the channel wrapper if this channel has been intercepted.
   nsCOMPtr<nsIInterceptedChannel> mInterceptedChannel;
 
   // This will be populated with a real network controller if parent-side
   // interception is enabled.
   nsCOMPtr<nsINetworkInterceptController> mInterceptController;
 
-  RefPtr<mozilla::dom::CanonicalBrowsingContext> mBrowsingContext;
+  RefPtr<mozilla::dom::BrowserParent> mBrowserParent;
 
   // True if we received OnStartRequest for a nsIMultiPartChannel, and are
   // expected AllPartsStopped to be called when complete.
   bool mIsMultiPart = false;
-
-  // True if the nsILoadContext for this channel has private browsing enabled.
-  bool mUsePrivateBrowsing = false;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(ParentChannelListener, PARENT_CHANNEL_LISTENER)
 
 inline nsISupports* ToSupports(ParentChannelListener* aDoc) {
   return static_cast<nsIInterfaceRequestor*>(aDoc);
 }