Backed out 18 changesets (bug 1525720) for mass failures on Windows platform e.g ProcessPriorityManager.cpp on a CLOSED TREE.
authorGurzau Raul <rgurzau@mozilla.com>
Thu, 23 May 2019 01:57:16 +0300
changeset 474972 f287bb6c18942c75aca41d54987006951270628d
parent 474971 1f2e86c2d6912946eac17beabdd27e4c42accf27
child 474973 57bf01d965797fac39ca0f267050633039aa4c57
child 475050 840b7106d8ae3158aeba8268d2ac0b40c3682bcb
push id113184
push userrgurzau@mozilla.com
push dateWed, 22 May 2019 22:58:26 +0000
treeherdermozilla-inbound@f287bb6c1894 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1525720
milestone69.0a1
backs out1f2e86c2d6912946eac17beabdd27e4c42accf27
9b79caa460a01a7bdf9c27ede487de0ec642ae0b
e65cb2d4c5a55e3049922df02af643337b7a58b2
99f971a02d87941ee49a391de0e0626c170c0821
d25963c72ff7981990660050182a82ea3e935f53
810b7371987139844429d0206f9da6a7701a1efc
ee10a825448133635dbd933c3d60fe427400647b
1bcf9f586c5582ddeb822f4c2be3ca314694337e
d3b2ac8d5ca4bd350603085c3cb9f6a51269e075
697774dd89848fb992355abaae97bba35b8c74ba
eadeacbe44838a0db21d5f535fd14bfd62455a22
32eeee79d628dade8109454c636d5f8aaff0c93e
07678a2fa9e7cb164b2d3b07b8c61653253b7540
757b4f595cc4b18ae35483d23edff4896d15d4b1
b255e0a84e12657a62a2cdfd4a4c2ebb893b2a0d
9a255864f75ddcf4096b6222d016a914f5a43c8a
5f1c1b609ec1ecc28734e1b6daeeb3f6854ded38
00d83f1d02e015735d580045524eceeeccdc4e28
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
Backed out 18 changesets (bug 1525720) for mass failures on Windows platform e.g ProcessPriorityManager.cpp on a CLOSED TREE. Backed out changeset 1f2e86c2d691 (bug 1525720) Backed out changeset 9b79caa460a0 (bug 1525720) Backed out changeset e65cb2d4c5a5 (bug 1525720) Backed out changeset 99f971a02d87 (bug 1525720) Backed out changeset d25963c72ff7 (bug 1525720) Backed out changeset 810b73719871 (bug 1525720) Backed out changeset ee10a8254481 (bug 1525720) Backed out changeset 1bcf9f586c55 (bug 1525720) Backed out changeset d3b2ac8d5ca4 (bug 1525720) Backed out changeset 697774dd8984 (bug 1525720) Backed out changeset eadeacbe4483 (bug 1525720) Backed out changeset 32eeee79d628 (bug 1525720) Backed out changeset 07678a2fa9e7 (bug 1525720) Backed out changeset 757b4f595cc4 (bug 1525720) Backed out changeset b255e0a84e12 (bug 1525720) Backed out changeset 9a255864f75d (bug 1525720) Backed out changeset 5f1c1b609ec1 (bug 1525720) Backed out changeset 00d83f1d02e0 (bug 1525720)
accessible/generic/RootAccessible.cpp
accessible/ipc/DocAccessibleParent.cpp
browser/components/sessionstore/SessionStore.jsm
docshell/shistory/ParentSHistory.cpp
dom/base/nsContentAreaDragDrop.cpp
dom/base/nsDOMAttributeMap.h
dom/base/nsFrameLoader.cpp
dom/base/nsFrameLoader.h
dom/base/nsPIWindowRoot.h
dom/base/nsWindowRoot.cpp
dom/base/nsWindowRoot.h
dom/chrome-webidl/WindowGlobalActors.webidl
dom/events/EventStateManager.cpp
dom/html/nsGenericHTMLFrameElement.cpp
dom/html/nsGenericHTMLFrameElement.h
dom/interfaces/base/nsIRemoteTab.idl
dom/interfaces/html/nsIMozBrowserFrame.idl
dom/ipc/BrowserBridgeChild.cpp
dom/ipc/BrowserBridgeChild.h
dom/ipc/BrowserBridgeHost.cpp
dom/ipc/BrowserBridgeHost.h
dom/ipc/BrowserBridgeParent.cpp
dom/ipc/BrowserHost.cpp
dom/ipc/BrowserHost.h
dom/ipc/BrowserParent.cpp
dom/ipc/BrowserParent.h
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/JSWindowActorChild.cpp
dom/ipc/JSWindowActorParent.cpp
dom/ipc/ProcessPriorityManager.cpp
dom/ipc/RemoteBrowser.h
dom/ipc/WindowGlobalParent.cpp
dom/ipc/WindowGlobalParent.h
dom/ipc/moz.build
layout/base/nsPresContext.cpp
netwerk/protocol/http/HttpChannelParentListener.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannel.h
netwerk/test/browser/browser_cross_process_redirect.js
toolkit/components/extensions/webrequest/ChannelWrapper.cpp
toolkit/components/windowwatcher/nsWindowWatcher.cpp
widget/nsBaseDragService.cpp
xpfe/appshell/nsXULWindow.cpp
--- a/accessible/generic/RootAccessible.cpp
+++ b/accessible/generic/RootAccessible.cpp
@@ -22,17 +22,16 @@
 #ifdef MOZ_XUL
 #  include "XULTreeAccessible.h"
 #endif
 
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/CustomEvent.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ScriptSettings.h"
-#include "mozilla/dom/BrowserHost.h"
 
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/EventTarget.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
 #include "mozilla/dom/Document.h"
 #include "nsIInterfaceRequestorUtils.h"
@@ -665,17 +664,17 @@ void RootAccessible::HandleTreeInvalidat
 }
 #endif
 
 ProxyAccessible* RootAccessible::GetPrimaryRemoteTopLevelContentDoc() const {
   nsCOMPtr<nsIDocShellTreeOwner> owner;
   mDocumentNode->GetDocShell()->GetTreeOwner(getter_AddRefs(owner));
   NS_ENSURE_TRUE(owner, nullptr);
 
-  nsCOMPtr<nsIRemoteTab> remoteTab;
-  owner->GetPrimaryRemoteTab(getter_AddRefs(remoteTab));
-  if (!remoteTab) {
+  nsCOMPtr<nsIRemoteTab> browserParent;
+  owner->GetPrimaryRemoteTab(getter_AddRefs(browserParent));
+  if (!browserParent) {
     return nullptr;
   }
 
-  auto tab = static_cast<dom::BrowserHost*>(remoteTab.get());
+  auto tab = static_cast<dom::BrowserParent*>(browserParent.get());
   return tab->GetTopLevelDocAccessible();
 }
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -667,18 +667,18 @@ void DocAccessibleParent::MaybeInitWindo
   bool isActive = true;
   nsIntRect rect(CW_USEDEFAULT, CW_USEDEFAULT, 0, 0);
   if (Compatibility::IsDolphin()) {
     rect = Bounds();
     nsIntRect rootRect = rootDocument->Bounds();
     rect.MoveToX(rootRect.X() - rect.X());
     rect.MoveToY(rect.Y() - rootRect.Y());
 
-    auto browserParent = static_cast<dom::BrowserParent*>(Manager());
-    isActive = browserParent->GetDocShellIsActive();
+    auto tab = static_cast<dom::BrowserParent*>(Manager());
+    tab->GetDocShellIsActive(&isActive);
   }
 
   nsWinUtils::NativeWindowCreateProc onCreate([this](HWND aHwnd) -> void {
     IDispatchHolder hWndAccHolder;
 
     ::SetPropW(aHwnd, kPropNameDocAccParent, reinterpret_cast<HANDLE>(this));
 
     SetEmulatedWindowHandle(aHwnd);
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -2326,17 +2326,17 @@ var SessionStoreInternal = {
     if (aBrowser.remoteType != aRemoteType ||
         !aBrowser.frameLoader || !aBrowser.frameLoader.remoteTab) {
       throw Cr.NS_ERROR_FAILURE;
     }
 
     // Tell our caller to redirect the load into this newly created process.
     let remoteTab = aBrowser.frameLoader.remoteTab;
     debug(`[process-switch]: new tabID: ${remoteTab.tabId}`);
-    return remoteTab.contentProcessId;
+    return remoteTab;
   },
 
   /**
    * Perform a destructive process switch into a distinct process.
    * This method is asynchronous, as it requires multiple calls into content
    * processes.
    */
   async _doProcessSwitch(aBrowsingContext, aRemoteType, aChannel, aSwitchId, aReplaceBrowsingContext) {
--- a/docshell/shistory/ParentSHistory.cpp
+++ b/docshell/shistory/ParentSHistory.cpp
@@ -21,17 +21,17 @@ ParentSHistory::ParentSHistory(nsFrameLo
 
 ParentSHistory::~ParentSHistory() {}
 
 nsDocShell* ParentSHistory::GetDocShell() {
   return nsDocShell::Cast(mFrameLoader->GetExistingDocShell());
 }
 
 BrowserParent* ParentSHistory::GetBrowserParent() {
-  return mFrameLoader->GetBrowserParent();
+  return static_cast<BrowserParent*>(mFrameLoader->GetRemoteBrowser());
 }
 
 already_AddRefed<ChildSHistory> ParentSHistory::GetChildIfSameProcess() {
   if (GetDocShell()) {
     return GetDocShell()->GetSessionHistory();
   }
 
   return nullptr;
--- a/dom/base/nsContentAreaDragDrop.cpp
+++ b/dom/base/nsContentAreaDragDrop.cpp
@@ -547,21 +547,21 @@ nsresult DragDataProducer::Produce(DataT
       dsti && dsti->ItemType() == nsIDocShellTreeItem::typeChrome;
 
   // In chrome shells, only allow dragging inside editable areas.
   if (isChromeShell && !editingElement) {
     RefPtr<nsFrameLoaderOwner> flo = do_QueryObject(mTarget);
     if (flo) {
       RefPtr<nsFrameLoader> fl = flo->GetFrameLoader();
       if (fl) {
-        BrowserParent* bp = fl->GetBrowserParent();
-        if (bp) {
+        BrowserParent* tp = static_cast<BrowserParent*>(fl->GetRemoteBrowser());
+        if (tp) {
           // We have a BrowserParent, so it may have data for dnd in case the
           // child process started a dnd session.
-          bp->AddInitialDnDDataTo(aDataTransfer, aPrincipal);
+          tp->AddInitialDnDDataTo(aDataTransfer, aPrincipal);
         }
       }
     }
     return NS_OK;
   }
 
   if (isChromeShell && textControl) {
     // Only use the selection if the target node is in the selection.
--- a/dom/base/nsDOMAttributeMap.h
+++ b/dom/base/nsDOMAttributeMap.h
@@ -55,18 +55,17 @@ class nsAttrKey {
  * PLDHashEntryHdr implementation for nsAttrKey.
  */
 class nsAttrHashKey : public PLDHashEntryHdr {
  public:
   typedef const nsAttrKey& KeyType;
   typedef const nsAttrKey* KeyTypePointer;
 
   explicit nsAttrHashKey(KeyTypePointer aKey) : mKey(*aKey) {}
-  nsAttrHashKey(const nsAttrHashKey& aCopy)
-      : PLDHashEntryHdr{}, mKey(aCopy.mKey) {}
+  nsAttrHashKey(const nsAttrHashKey& aCopy) : mKey(aCopy.mKey) {}
   ~nsAttrHashKey() {}
 
   KeyType GetKey() const { return mKey; }
   bool KeyEquals(KeyTypePointer aKey) const {
     return mKey.mLocalName == aKey->mLocalName &&
            mKey.mNamespaceID == aKey->mNamespaceID;
   }
 
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -104,18 +104,16 @@
 #include "mozilla/WebBrowserPersistLocalDocument.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseNativeHandler.h"
 #include "mozilla/dom/ParentSHistory.h"
 #include "mozilla/dom/ChildSHistory.h"
 #include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/BrowserBridgeChild.h"
-#include "mozilla/dom/BrowserHost.h"
-#include "mozilla/dom/BrowserBridgeHost.h"
 
 #include "mozilla/dom/HTMLBodyElement.h"
 
 #include "mozilla/ContentPrincipal.h"
 
 #ifdef XP_WIN
 #  include "mozilla/plugins/PPluginWidgetParent.h"
 #  include "../plugins/ipc/PluginWidgetParent.h"
@@ -152,33 +150,34 @@ typedef ScrollableLayerGuid::ViewID View
 // keep number of shells to a reasonable number on accidental recursion with a
 // small (but not 1) branching factor.  With large branching factors the number
 // of shells can rapidly become huge and run us out of memory.  To solve that,
 // we'd need to re-institute a fixed version of bug 98158.
 #define MAX_DEPTH_CONTENT_FRAMES 10
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsFrameLoader, mBrowsingContext,
                                       mMessageManager, mChildMessageManager,
-                                      mParentSHistory, mRemoteBrowser)
+                                      mParentSHistory, mBrowserParent)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsFrameLoader)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsFrameLoader)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFrameLoader)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY_CONCRETE(nsFrameLoader)
   NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 nsFrameLoader::nsFrameLoader(Element* aOwner, BrowsingContext* aBrowsingContext,
                              bool aNetworkCreated)
     : mBrowsingContext(aBrowsingContext),
       mOwnerContent(aOwner),
       mDetachedSubdocFrame(nullptr),
       mPendingSwitchID(0),
+      mBrowserParent(nullptr),
       mChildID(0),
       mDepthTooGreat(false),
       mIsTopLevelContent(false),
       mDestroyCalled(false),
       mNeedsAsyncDestroy(false),
       mInSwap(false),
       mInShow(false),
       mHideCalled(false),
@@ -193,16 +192,17 @@ nsFrameLoader::nsFrameLoader(Element* aO
 }
 
 nsFrameLoader::nsFrameLoader(Element* aOwner, BrowsingContext* aBrowsingContext,
                              const mozilla::dom::RemotenessOptions& aOptions)
     : mBrowsingContext(aBrowsingContext),
       mOwnerContent(aOwner),
       mDetachedSubdocFrame(nullptr),
       mPendingSwitchID(0),
+      mBrowserParent(nullptr),
       mChildID(0),
       mDepthTooGreat(false),
       mIsTopLevelContent(false),
       mDestroyCalled(false),
       mNeedsAsyncDestroy(false),
       mInSwap(false),
       mInShow(false),
       mHideCalled(false),
@@ -538,26 +538,38 @@ nsresult nsFrameLoader::ReallyStartLoadi
 
 nsresult nsFrameLoader::ReallyStartLoadingInternal() {
   NS_ENSURE_STATE((mURIToLoad || mPendingSwitchID) && mOwnerContent &&
                   mOwnerContent->IsInComposedDoc());
 
   AUTO_PROFILER_LABEL("nsFrameLoader::ReallyStartLoadingInternal", OTHER);
 
   if (IsRemoteFrame()) {
-    if (!EnsureRemoteBrowser()) {
+    if (!mBrowserParent && !mBrowserBridgeChild && !TryRemoteBrowser()) {
       NS_WARNING("Couldn't create child process for iframe.");
       return NS_ERROR_FAILURE;
     }
 
     if (mPendingSwitchID) {
-      mRemoteBrowser->ResumeLoad(mPendingSwitchID);
+      if (mBrowserBridgeChild) {
+        Unused << mBrowserBridgeChild->SendResumeLoad(mPendingSwitchID);
+      } else {
+        mBrowserParent->ResumeLoad(mPendingSwitchID);
+      }
+
       mPendingSwitchID = 0;
     } else {
-      mRemoteBrowser->LoadURL(mURIToLoad);
+      if (mBrowserBridgeChild) {
+        nsAutoCString spec;
+        mURIToLoad->GetSpec(spec);
+        Unused << mBrowserBridgeChild->SendLoadURL(spec);
+      } else {
+        // FIXME get error codes from child
+        mBrowserParent->LoadURL(mURIToLoad);
+      }
     }
 
     if (!mRemoteBrowserShown) {
       // This can fail if it's too early to show the frame, we will retry later.
       Unused << ShowRemoteFrame(ScreenIntSize(0, 0));
     }
 
     return NS_OK;
@@ -1012,17 +1024,17 @@ void nsFrameLoader::MarginsChanged(uint3
 }
 
 bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size,
                                     nsSubDocumentFrame* aFrame) {
   AUTO_PROFILER_LABEL("nsFrameLoader::ShowRemoteFrame", OTHER);
   NS_ASSERTION(IsRemoteFrame(),
                "ShowRemote only makes sense on remote frames.");
 
-  if (!EnsureRemoteBrowser()) {
+  if (!mBrowserParent && !mBrowserBridgeChild && !TryRemoteBrowser()) {
     NS_ERROR("Couldn't create child process.");
     return false;
   }
 
   // FIXME/bug 589337: Show()/Hide() is pretty expensive for
   // cross-process layers; need to figure out what behavior we really
   // want here.  For now, hack.
   if (!mRemoteBrowserShown) {
@@ -1031,49 +1043,57 @@ bool nsFrameLoader::ShowRemoteFrame(cons
     }
 
     // We never want to host remote frameloaders in simple popups, like menus.
     nsIWidget* widget = nsContentUtils::WidgetForContent(mOwnerContent);
     if (!widget || static_cast<nsBaseWidget*>(widget)->IsSmallPopup()) {
       return false;
     }
 
-    if (RefPtr<BrowserBridgeChild> browserBridgeChild =
-            GetBrowserBridgeChild()) {
+    if (mBrowserBridgeChild) {
       nsCOMPtr<nsISupports> container =
           mOwnerContent->OwnerDoc()->GetContainer();
       nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(container);
       nsCOMPtr<nsIWidget> mainWidget;
       baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
       nsSizeMode sizeMode =
           mainWidget ? mainWidget->SizeMode() : nsSizeMode_Normal;
 
-      Unused << browserBridgeChild->SendShow(
+      Unused << mBrowserBridgeChild->SendShow(
           size, ParentWindowIsActive(mOwnerContent->OwnerDoc()), sizeMode);
       mRemoteBrowserShown = true;
       return true;
     }
 
-    if (!mRemoteBrowser->Show(
-            size, ParentWindowIsActive(mOwnerContent->OwnerDoc()))) {
+    RenderFrame* rf =
+        mBrowserParent ? mBrowserParent->GetRenderFrame() : nullptr;
+
+    if (!rf || !rf->AttachLayerManager()) {
+      // This is just not going to work.
       return false;
     }
+
+    mBrowserParent->Show(size, ParentWindowIsActive(mOwnerContent->OwnerDoc()));
     mRemoteBrowserShown = true;
 
     nsCOMPtr<nsIObserverService> os = services::GetObserverService();
     if (os) {
       os->NotifyObservers(ToSupports(this), "remote-browser-shown", nullptr);
     }
   } else {
     nsIntRect dimensions;
     NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), false);
 
     // Don't show remote iframe if we are waiting for the completion of reflow.
     if (!aFrame || !(aFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
-      mRemoteBrowser->UpdateDimensions(dimensions, size);
+      if (mBrowserParent) {
+        mBrowserParent->UpdateDimensions(dimensions, size);
+      } else if (mBrowserBridgeChild) {
+        mBrowserBridgeChild->UpdateDimensions(dimensions, size);
+      }
     }
   }
 
   return true;
 }
 
 void nsFrameLoader::Hide() {
   if (mHideCalled) {
@@ -1156,42 +1176,44 @@ nsresult nsFrameLoader::SwapWithOtherRem
   }
 
   PresShell* ourPresShell = ourDoc->GetPresShell();
   PresShell* otherPresShell = otherDoc->GetPresShell();
   if (!ourPresShell || !otherPresShell) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
-  auto* browserParent = GetBrowserParent();
-  auto* otherBrowserParent = aOther->GetBrowserParent();
-
-  if (!browserParent || !otherBrowserParent) {
+  // FIXME: Consider supporting FrameLoader swapping for remote sub frames.
+  if (mBrowserBridgeChild) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
-  if (browserParent->IsIsolatedMozBrowserElement() !=
-      otherBrowserParent->IsIsolatedMozBrowserElement()) {
+  if (!mBrowserParent || !aOther->mBrowserParent) {
+    return NS_ERROR_NOT_IMPLEMENTED;
+  }
+
+  if (mBrowserParent->IsIsolatedMozBrowserElement() !=
+      aOther->mBrowserParent->IsIsolatedMozBrowserElement()) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   // When we swap docShells, maybe we have to deal with a new page created just
   // for this operation. In this case, the browser code should already have set
   // the correct userContextId attribute value in the owning element, but our
   // docShell, that has been created way before) doesn't know that that
   // happened.
   // This is the reason why now we must retrieve the correct value from the
   // usercontextid attribute before comparing our originAttributes with the
   // other one.
-  OriginAttributes ourOriginAttributes = browserParent->OriginAttributesRef();
+  OriginAttributes ourOriginAttributes = mBrowserParent->OriginAttributesRef();
   rv = PopulateUserContextIdFromAttribute(ourOriginAttributes);
   NS_ENSURE_SUCCESS(rv, rv);
 
   OriginAttributes otherOriginAttributes =
-      otherBrowserParent->OriginAttributesRef();
+      aOther->mBrowserParent->OriginAttributesRef();
   rv = aOther->PopulateUserContextIdFromAttribute(otherOriginAttributes);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (ourOriginAttributes != otherOriginAttributes) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   bool ourHasHistory =
@@ -1225,62 +1247,62 @@ nsresult nsFrameLoader::SwapWithOtherRem
 
   rv = ourFrameFrame->BeginSwapDocShells(otherFrame);
   if (NS_FAILED(rv)) {
     mInSwap = aOther->mInSwap = false;
     return rv;
   }
 
   nsCOMPtr<nsIBrowserDOMWindow> otherBrowserDOMWindow =
-      otherBrowserParent->GetBrowserDOMWindow();
+      aOther->mBrowserParent->GetBrowserDOMWindow();
   nsCOMPtr<nsIBrowserDOMWindow> browserDOMWindow =
-      browserParent->GetBrowserDOMWindow();
+      mBrowserParent->GetBrowserDOMWindow();
 
   if (!!otherBrowserDOMWindow != !!browserDOMWindow) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   // Destroy browser frame scripts for content leaving a frame with browser API
   if (OwnerIsMozBrowserFrame() && !aOther->OwnerIsMozBrowserFrame()) {
     DestroyBrowserFrameScripts();
   }
   if (!OwnerIsMozBrowserFrame() && aOther->OwnerIsMozBrowserFrame()) {
     aOther->DestroyBrowserFrameScripts();
   }
 
-  otherBrowserParent->SetBrowserDOMWindow(browserDOMWindow);
-  browserParent->SetBrowserDOMWindow(otherBrowserDOMWindow);
+  aOther->mBrowserParent->SetBrowserDOMWindow(browserDOMWindow);
+  mBrowserParent->SetBrowserDOMWindow(otherBrowserDOMWindow);
 
 #ifdef XP_WIN
   // Native plugin windows used by this remote content need to be reparented.
   if (nsPIDOMWindowOuter* newWin = ourDoc->GetWindow()) {
     RefPtr<nsIWidget> newParent =
         nsGlobalWindowOuter::Cast(newWin)->GetMainWidget();
     const ManagedContainer<mozilla::plugins::PPluginWidgetParent>& plugins =
-        otherBrowserParent->ManagedPPluginWidgetParent();
+        aOther->mBrowserParent->ManagedPPluginWidgetParent();
     for (auto iter = plugins.ConstIter(); !iter.Done(); iter.Next()) {
       static_cast<mozilla::plugins::PluginWidgetParent*>(iter.Get()->GetKey())
           ->SetParent(newParent);
     }
   }
 #endif  // XP_WIN
 
   MaybeUpdatePrimaryBrowserParent(eBrowserParentRemoved);
   aOther->MaybeUpdatePrimaryBrowserParent(eBrowserParentRemoved);
 
   SetOwnerContent(otherContent);
   aOther->SetOwnerContent(ourContent);
 
-  browserParent->SetOwnerElement(otherContent);
-  otherBrowserParent->SetOwnerElement(ourContent);
+  mBrowserParent->SetOwnerElement(otherContent);
+  aOther->mBrowserParent->SetOwnerElement(ourContent);
 
   // Update window activation state for the swapped owner content.
-  Unused << browserParent->SendParentActivated(
+  Unused << mBrowserParent->SendParentActivated(
       ParentWindowIsActive(otherContent->OwnerDoc()));
-  Unused << otherBrowserParent->SendParentActivated(
+  Unused << aOther->mBrowserParent->SendParentActivated(
       ParentWindowIsActive(ourContent->OwnerDoc()));
 
   MaybeUpdatePrimaryBrowserParent(eBrowserParentChanged);
   aOther->MaybeUpdatePrimaryBrowserParent(eBrowserParentChanged);
 
   RefPtr<nsFrameMessageManager> ourMessageManager = mMessageManager;
   RefPtr<nsFrameMessageManager> otherMessageManager = aOther->mMessageManager;
   // Swap and setup things in parent message managers.
@@ -1317,19 +1339,19 @@ nsresult nsFrameLoader::SwapWithOtherRem
     return rv;
   }
   MutableTabContext otherContext;
   rv = aOther->GetNewTabContext(&otherContext);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  Unused << browserParent->SendSwappedWithOtherRemoteLoader(
+  Unused << mBrowserParent->SendSwappedWithOtherRemoteLoader(
       ourContext.AsIPCTabContext());
-  Unused << otherBrowserParent->SendSwappedWithOtherRemoteLoader(
+  Unused << aOther->mBrowserParent->SendSwappedWithOtherRemoteLoader(
       otherContext.AsIPCTabContext());
   return NS_OK;
 }
 
 class MOZ_RAII AutoResetInFrameSwap final {
  public:
   AutoResetInFrameSwap(
       nsFrameLoader* aThisFrameLoader, nsFrameLoader* aOtherFrameLoader,
@@ -1773,30 +1795,30 @@ void nsFrameLoader::StartDestroy() {
   // the message manager on the frame.
   if (mMessageManager) {
     mMessageManager->Close();
   }
 
   // Retain references to the <browser> element and the frameloader in case we
   // receive any messages from the message manager on the frame. These
   // references are dropped in DestroyComplete.
-  if (mChildMessageManager || mRemoteBrowser) {
+  if (mChildMessageManager || mBrowserParent) {
     mOwnerContentStrong = mOwnerContent;
-    if (auto* browserParent = GetBrowserParent()) {
-      browserParent->CacheFrameLoader(this);
+    if (mBrowserParent) {
+      mBrowserParent->CacheFrameLoader(this);
     }
     if (mChildMessageManager) {
       mChildMessageManager->CacheFrameLoader(this);
     }
   }
 
   // If the BrowserParent has installed any event listeners on the window, this
   // is its last chance to remove them while we're still in the document.
-  if (auto* browserParent = GetBrowserParent()) {
-    browserParent->RemoveWindowListeners();
+  if (mBrowserParent) {
+    mBrowserParent->RemoveWindowListeners();
   }
 
   nsCOMPtr<Document> doc;
   bool dynamicSubframeRemoval = false;
   if (mOwnerContent) {
     doc = mOwnerContent->OwnerDoc();
     dynamicSubframeRemoval = !mIsTopLevelContent && !doc->InUnlinkOrDeletion();
     doc->SetSubDocumentFor(mOwnerContent, nullptr);
@@ -1885,18 +1907,23 @@ nsresult nsFrameLoaderDestroyRunnable::R
 void nsFrameLoader::DestroyDocShell() {
   // This code runs after the frameloader has been detached from the <browser>
   // element. We postpone this work because we may not be allowed to run
   // script at that time.
 
   // Ask the BrowserChild to fire the frame script "unload" event, destroy its
   // docshell, and finally destroy the PBrowser actor. This eventually leads to
   // nsFrameLoader::DestroyComplete being called.
-  if (mRemoteBrowser) {
-    mRemoteBrowser->DestroyStart();
+  if (mBrowserParent) {
+    mBrowserParent->Destroy();
+  }
+
+  if (mBrowserBridgeChild) {
+    Unused << mBrowserBridgeChild->Send__delete__(mBrowserBridgeChild);
+    mBrowserBridgeChild = nullptr;
   }
 
   // Fire the "unload" event if we're in-process.
   if (mChildMessageManager) {
     mChildMessageManager->FireUnloadEvent();
   }
 
   if (mSessionStoreListener) {
@@ -1919,30 +1946,36 @@ void nsFrameLoader::DestroyDocShell() {
 
 void nsFrameLoader::DestroyComplete() {
   // We get here, as part of StartDestroy, after the docshell has been destroyed
   // and all message manager messages sent during docshell destruction have been
   // dispatched.  We also get here if the child process crashes. In the latter
   // case, StartDestroy might not have been called.
 
   // Drop the strong references created in StartDestroy.
-  if (mChildMessageManager || mRemoteBrowser) {
+  if (mChildMessageManager || mBrowserParent) {
     mOwnerContentStrong = nullptr;
-    if (auto* browserParent = GetBrowserParent()) {
-      browserParent->CacheFrameLoader(nullptr);
+    if (mBrowserParent) {
+      mBrowserParent->CacheFrameLoader(nullptr);
     }
     if (mChildMessageManager) {
       mChildMessageManager->CacheFrameLoader(nullptr);
     }
   }
 
   // Call BrowserParent::Destroy if we haven't already (in case of a crash).
-  if (mRemoteBrowser) {
-    mRemoteBrowser->DestroyComplete();
-    mRemoteBrowser = nullptr;
+  if (mBrowserParent) {
+    mBrowserParent->SetOwnerElement(nullptr);
+    mBrowserParent->Destroy();
+    mBrowserParent = nullptr;
+  }
+
+  if (mBrowserBridgeChild) {
+    Unused << mBrowserBridgeChild->Send__delete__(mBrowserBridgeChild);
+    mBrowserBridgeChild = nullptr;
   }
 
   if (mMessageManager) {
     mMessageManager->Disconnect();
   }
 
   if (mChildMessageManager) {
     mChildMessageManager->Disconnect();
@@ -2456,40 +2489,44 @@ nsresult nsFrameLoader::GetWindowDimensi
   nsCOMPtr<nsIBaseWindow> treeOwnerAsWin(do_GetInterface(parentOwner));
   treeOwnerAsWin->GetPosition(&aRect.x, &aRect.y);
   treeOwnerAsWin->GetSize(&aRect.width, &aRect.height);
   return NS_OK;
 }
 
 nsresult nsFrameLoader::UpdatePositionAndSize(nsSubDocumentFrame* aIFrame) {
   if (IsRemoteFrame()) {
-    if (mRemoteBrowser) {
+    if (mBrowserParent || mBrowserBridgeChild) {
       ScreenIntSize size = aIFrame->GetSubdocumentSize();
       // If we were not able to show remote frame before, we should probably
       // retry now to send correct showInfo.
       if (!mRemoteBrowserShown) {
         ShowRemoteFrame(size, aIFrame);
       }
       nsIntRect dimensions;
       NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), NS_ERROR_FAILURE);
       mLazySize = size;
-      mRemoteBrowser->UpdateDimensions(dimensions, size);
+      if (mBrowserParent) {
+        mBrowserParent->UpdateDimensions(dimensions, size);
+      } else if (mBrowserBridgeChild) {
+        mBrowserBridgeChild->UpdateDimensions(dimensions, size);
+      }
     }
     return NS_OK;
   }
   UpdateBaseWindowPositionAndSize(aIFrame);
   return NS_OK;
 }
 
 void nsFrameLoader::SendIsUnderHiddenEmbedderElement(
     bool aIsUnderHiddenEmbedderElement) {
   MOZ_ASSERT(IsRemoteFrame());
 
-  if (auto* browserBridgeChild = GetBrowserBridgeChild()) {
-    browserBridgeChild->SetIsUnderHiddenEmbedderElement(
+  if (mBrowserBridgeChild) {
+    mBrowserBridgeChild->SetIsUnderHiddenEmbedderElement(
         aIsUnderHiddenEmbedderElement);
   }
 }
 
 void nsFrameLoader::UpdateBaseWindowPositionAndSize(
     nsSubDocumentFrame* aIFrame) {
   nsCOMPtr<nsIBaseWindow> baseWindow = GetDocShell(IgnoreErrors());
 
@@ -2555,23 +2592,18 @@ static Tuple<ContentParent*, BrowserPare
   BrowserParent* browserParent = BrowserParent::GetFrom(otherLoader);
   if (browserParent && browserParent->Manager()) {
     return MakeTuple(browserParent->Manager(), browserParent);
   }
 
   return ReturnTuple(nullptr, nullptr);
 }
 
-bool nsFrameLoader::EnsureRemoteBrowser() {
-  MOZ_ASSERT(IsRemoteFrame());
-  return mRemoteBrowser || TryRemoteBrowser();
-}
-
 bool nsFrameLoader::TryRemoteBrowser() {
-  NS_ASSERTION(!mRemoteBrowser,
+  NS_ASSERTION(!mBrowserParent && !mBrowserBridgeChild,
                "TryRemoteBrowser called with a remote browser already?");
 
   if (!mOwnerContent) {
     return false;
   }
 
   // XXXsmaug Per spec (2014/08/21) frameloader should not work in case the
   //         element isn't in document, only in shadow dom, but that will change
@@ -2594,20 +2626,23 @@ bool nsFrameLoader::TryRemoteBrowser() {
     return false;
   }
 
   nsCOMPtr<nsIDocShell> parentDocShell = parentWin->GetDocShell();
   if (!parentDocShell) {
     return false;
   }
 
+  BrowserParent* openingTab =
+      BrowserParent::GetFrom(parentDocShell->GetOpener());
   RefPtr<ContentParent> openerContentParent;
   RefPtr<BrowserParent> sameTabGroupAs;
-  if (auto* host = BrowserHost::GetFrom(parentDocShell->GetOpener())) {
-    openerContentParent = host->GetActor()->Manager();
+
+  if (openingTab && openingTab->Manager()) {
+    openerContentParent = openingTab->Manager();
   }
 
   // <iframe mozbrowser> gets to skip these checks.
   // iframes for JS plugins also get to skip these checks. We control the URL
   // that gets loaded, but the load is triggered from the document containing
   // the plugin.
   // out of process iframes also get to skip this check.
   if (!OwnerIsMozBrowserFrame() && !XRE_IsContentProcess()) {
@@ -2680,75 +2715,72 @@ bool nsFrameLoader::TryRemoteBrowser() {
   }
 
   nsCOMPtr<Element> ownerElement = mOwnerContent;
 
   // If we're in a content process, create a BrowserBridgeChild actor.
   if (XRE_IsContentProcess()) {
     mBrowsingContext->SetEmbedderElement(mOwnerContent);
 
-    mRemoteBrowser = ContentChild::CreateBrowser(
+    mBrowserBridgeChild = BrowserBridgeChild::Create(
         this, context, NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE),
         mBrowsingContext);
-    return !!mRemoteBrowser;
+    return !!mBrowserBridgeChild;
   }
 
-  mRemoteBrowser = ContentParent::CreateBrowser(
+  mBrowserParent = ContentParent::CreateBrowser(
       context, ownerElement, mBrowsingContext, openerContentParent,
       sameTabGroupAs, nextRemoteTabId);
-  if (!mRemoteBrowser) {
+  if (!mBrowserParent) {
     return false;
   }
 
-  // Grab the reference to the actor
-  RefPtr<BrowserParent> browserParent = GetBrowserParent();
-
   // We no longer need the remoteType attribute on the frame element.
   // The remoteType can be queried by asking the message manager instead.
   ownerElement->UnsetAttr(kNameSpaceID_None, nsGkAtoms::RemoteType, false);
 
-  // Now that browserParent is set, we can initialize the RenderFrame
-  browserParent->InitRendering();
+  // Now that mBrowserParent is set, we can initialize the RenderFrame
+  mBrowserParent->InitRendering();
 
   MaybeUpdatePrimaryBrowserParent(eBrowserParentChanged);
 
-  mChildID = browserParent->Manager()->ChildID();
+  mChildID = mBrowserParent->Manager()->ChildID();
 
   nsCOMPtr<nsIDocShellTreeItem> rootItem;
   parentDocShell->GetRootTreeItem(getter_AddRefs(rootItem));
   nsCOMPtr<nsPIDOMWindowOuter> rootWin = rootItem->GetWindow();
   nsCOMPtr<nsIDOMChromeWindow> rootChromeWin = do_QueryInterface(rootWin);
 
   if (rootChromeWin) {
     nsCOMPtr<nsIBrowserDOMWindow> browserDOMWin;
     rootChromeWin->GetBrowserDOMWindow(getter_AddRefs(browserDOMWin));
-    browserParent->SetBrowserDOMWindow(browserDOMWin);
+    mBrowserParent->SetBrowserDOMWindow(browserDOMWin);
   }
 
   // Set up a parent SHistory
   if (XRE_IsParentProcess()) {
     // XXX(nika): Once we get out of process iframes we won't want to
     // unconditionally set this up. What do we do for iframes in a chrome loaded
     // document for example?
     mParentSHistory = new ParentSHistory(this);
   }
 
   // For xul:browsers, update some settings based on attributes:
   if (mOwnerContent->IsXULElement()) {
-    // Send down the name of the browser through browserParent if it is set.
+    // Send down the name of the browser through mBrowserParent if it is set.
     nsAutoString frameName;
     mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::name, frameName);
     if (nsContentUtils::IsOverridingWindowName(frameName)) {
-      Unused << browserParent->SendSetWindowName(frameName);
+      Unused << mBrowserParent->SendSetWindowName(frameName);
     }
     // Allow scripts to close the window if the browser specified so:
     if (mOwnerContent->AttrValueIs(kNameSpaceID_None,
                                    nsGkAtoms::allowscriptstoclose,
                                    nsGkAtoms::_true, eCaseMatters)) {
-      Unused << browserParent->SendAllowScriptsToClose();
+      Unused << mBrowserParent->SendAllowScriptsToClose();
     }
   }
 
   ReallyLoadFrameScripts();
   InitializeBrowserAPI();
 
   return true;
 }
@@ -2756,95 +2788,76 @@ bool nsFrameLoader::TryRemoteBrowser() {
 bool nsFrameLoader::IsRemoteFrame() {
   if (mIsRemoteFrame) {
     MOZ_ASSERT(!GetDocShell(), "Found a remote frame with a DocShell");
     return true;
   }
   return false;
 }
 
-BrowserParent* nsFrameLoader::GetBrowserParent() const {
-  if (!mRemoteBrowser) {
-    return nullptr;
-  }
-  RefPtr<BrowserHost> browserHost = mRemoteBrowser->AsBrowserHost();
-  if (!browserHost) {
-    return nullptr;
-  }
-  return browserHost->GetActor();
+mozilla::dom::PBrowserParent* nsFrameLoader::GetRemoteBrowser() const {
+  return mBrowserParent;
 }
 
-BrowserBridgeChild* nsFrameLoader::GetBrowserBridgeChild() const {
-  if (!mRemoteBrowser) {
-    return nullptr;
-  }
-  RefPtr<BrowserBridgeHost> browserBridgeHost =
-      mRemoteBrowser->AsBrowserBridgeHost();
-  if (!browserBridgeHost) {
-    return nullptr;
-  }
-  return browserBridgeHost->GetActor();
+mozilla::dom::BrowserBridgeChild* nsFrameLoader::GetBrowserBridgeChild() const {
+  return mBrowserBridgeChild;
 }
 
 mozilla::layers::LayersId nsFrameLoader::GetLayersId() const {
   MOZ_ASSERT(mIsRemoteFrame);
-  if (auto* browserParent = GetBrowserParent()) {
-    return browserParent->GetRenderFrame()->GetLayersId();
+  if (mBrowserParent) {
+    return mBrowserParent->GetRenderFrame()->GetLayersId();
   }
-  if (auto* browserBridgeChild = GetBrowserBridgeChild()) {
-    return browserBridgeChild->GetLayersId();
+  if (mBrowserBridgeChild) {
+    return mBrowserBridgeChild->GetLayersId();
   }
   return mozilla::layers::LayersId{};
 }
 
 void nsFrameLoader::ActivateRemoteFrame(ErrorResult& aRv) {
-  auto* browserParent = GetBrowserParent();
-  if (!browserParent) {
+  if (!mBrowserParent) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return;
   }
 
-  browserParent->Activate();
+  mBrowserParent->Activate();
 }
 
 void nsFrameLoader::DeactivateRemoteFrame(ErrorResult& aRv) {
-  auto* browserParent = GetBrowserParent();
-  if (!browserParent) {
+  if (!mBrowserParent) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return;
   }
 
-  browserParent->Deactivate();
+  mBrowserParent->Deactivate();
 }
 
 void nsFrameLoader::SendCrossProcessMouseEvent(const nsAString& aType, float aX,
                                                float aY, int32_t aButton,
                                                int32_t aClickCount,
                                                int32_t aModifiers,
                                                bool aIgnoreRootScrollFrame,
                                                ErrorResult& aRv) {
-  auto* browserParent = GetBrowserParent();
-  if (!browserParent) {
+  if (!mBrowserParent) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
-  browserParent->SendMouseEvent(aType, aX, aY, aButton, aClickCount, aModifiers,
-                                aIgnoreRootScrollFrame);
+  mBrowserParent->SendMouseEvent(aType, aX, aY, aButton, aClickCount,
+                                 aModifiers, aIgnoreRootScrollFrame);
 }
 
 void nsFrameLoader::ActivateFrameEvent(const nsAString& aType, bool aCapture,
                                        ErrorResult& aRv) {
-  auto* browserParent = GetBrowserParent();
-  if (!browserParent) {
+  if (!mBrowserParent) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
-  bool ok = browserParent->SendActivateFrameEvent(nsString(aType), aCapture);
+  bool ok = mBrowserParent->SendActivateFrameEvent(nsString(aType), aCapture);
   if (!ok) {
     aRv.Throw(NS_ERROR_NOT_AVAILABLE);
   }
 }
 
 nsresult nsFrameLoader::CreateStaticClone(nsFrameLoader* aDest) {
   aDest->MaybeCreateDocShell();
   NS_ENSURE_STATE(aDest->GetDocShell());
@@ -2865,17 +2878,18 @@ nsresult nsFrameLoader::CreateStaticClon
   nsCOMPtr<Document> clonedDoc = doc->CreateStaticClone(aDest->GetDocShell());
 
   viewer->SetDocument(clonedDoc);
   return NS_OK;
 }
 
 bool nsFrameLoader::DoLoadMessageManagerScript(const nsAString& aURL,
                                                bool aRunInGlobalScope) {
-  if (auto* browserParent = GetBrowserParent()) {
+  auto* browserParent = BrowserParent::GetFrom(GetRemoteBrowser());
+  if (browserParent) {
     return browserParent->SendLoadRemoteScript(nsString(aURL),
                                                aRunInGlobalScope);
   }
   RefPtr<InProcessBrowserChildMessageManager> browserChild =
       GetBrowserChildMessageManager();
   if (browserChild) {
     browserChild->LoadFrameScript(aURL, aRunInGlobalScope);
   }
@@ -2909,17 +2923,17 @@ class nsAsyncMessageToChild : public nsS
   RefPtr<nsFrameLoader> mFrameLoader;
 };
 
 nsresult nsFrameLoader::DoSendAsyncMessage(JSContext* aCx,
                                            const nsAString& aMessage,
                                            StructuredCloneData& aData,
                                            JS::Handle<JSObject*> aCpows,
                                            nsIPrincipal* aPrincipal) {
-  auto* browserParent = GetBrowserParent();
+  BrowserParent* browserParent = mBrowserParent;
   if (browserParent) {
     ClonedMessageData data;
     ContentParent* cp = browserParent->Manager();
     if (!BuildClonedMessageDataForParent(cp, aData, data)) {
       MOZ_CRASH();
       return NS_ERROR_DOM_DATA_CLONE_ERR;
     }
     InfallibleTArray<mozilla::jsipc::CpowEntry> cpows;
@@ -3029,25 +3043,25 @@ nsresult nsFrameLoader::ReallyLoadFrameS
   }
   return NS_OK;
 }
 
 already_AddRefed<Element> nsFrameLoader::GetOwnerElement() {
   return do_AddRef(mOwnerContent);
 }
 
-void nsFrameLoader::InitializeFromBrowserParent(BrowserParent* aBrowserParent) {
-  MOZ_ASSERT(!mRemoteBrowser);
+void nsFrameLoader::SetRemoteBrowser(nsIRemoteTab* aBrowserParent) {
+  MOZ_ASSERT(!mBrowserParent);
   mIsRemoteFrame = true;
-  mRemoteBrowser = new BrowserHost(aBrowserParent);
-  mChildID = aBrowserParent ? aBrowserParent->Manager()->ChildID() : 0;
+  mBrowserParent = BrowserParent::GetFrom(aBrowserParent);
+  mChildID = mBrowserParent ? mBrowserParent->Manager()->ChildID() : 0;
   MaybeUpdatePrimaryBrowserParent(eBrowserParentChanged);
   ReallyLoadFrameScripts();
   InitializeBrowserAPI();
-  aBrowserParent->InitRendering();
+  mBrowserParent->InitRendering();
   ShowRemoteFrame(ScreenIntSize(0, 0));
 }
 
 void nsFrameLoader::SetDetachedSubdocFrame(nsIFrame* aDetachedFrame,
                                            Document* aContainerDoc) {
   mDetachedSubdocFrame = aDetachedFrame;
   mContainerDocWhileDetached = aContainerDoc;
 }
@@ -3141,65 +3155,65 @@ void nsFrameLoader::AttributeChanged(moz
   }
 }
 
 /**
  * Send the RequestNotifyAfterRemotePaint message to the current Tab.
  */
 void nsFrameLoader::RequestNotifyAfterRemotePaint() {
   // If remote browsing (e10s), handle this with the BrowserParent.
-  if (auto* browserParent = GetBrowserParent()) {
-    Unused << browserParent->SendRequestNotifyAfterRemotePaint();
+  if (mBrowserParent) {
+    Unused << mBrowserParent->SendRequestNotifyAfterRemotePaint();
   }
 }
 
 void nsFrameLoader::RequestUpdatePosition(ErrorResult& aRv) {
-  if (auto* browserParent = GetBrowserParent()) {
+  if (auto* browserParent = BrowserParent::GetFrom(GetRemoteBrowser())) {
     nsresult rv = browserParent->UpdatePosition();
 
     if (NS_FAILED(rv)) {
       aRv.Throw(rv);
     }
   }
 }
 
 bool nsFrameLoader::RequestTabStateFlush(uint32_t aFlushId, bool aIsFinal) {
   if (mSessionStoreListener) {
     mSessionStoreListener->ForceFlushFromParent(aFlushId, aIsFinal);
     // No async ipc call is involved in parent only case
     return false;
   }
 
   // If remote browsing (e10s), handle this with the BrowserParent.
-  if (auto* browserParent = GetBrowserParent()) {
-    Unused << browserParent->SendFlushTabState(aFlushId, aIsFinal);
+  if (mBrowserParent) {
+    Unused << mBrowserParent->SendFlushTabState(aFlushId, aIsFinal);
     return true;
   }
 
   return false;
 }
 
 void nsFrameLoader::Print(uint64_t aOuterWindowID,
                           nsIPrintSettings* aPrintSettings,
                           nsIWebProgressListener* aProgressListener,
                           ErrorResult& aRv) {
 #if defined(NS_PRINTING)
-  if (auto* browserParent = GetBrowserParent()) {
+  if (mBrowserParent) {
     RefPtr<embedding::PrintingParent> printingParent =
-        browserParent->Manager()->GetPrintingParent();
+        mBrowserParent->Manager()->GetPrintingParent();
 
     embedding::PrintData printData;
     nsresult rv = printingParent->SerializeAndEnsureRemotePrintJob(
         aPrintSettings, aProgressListener, nullptr, &printData);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       aRv.Throw(rv);
       return;
     }
 
-    bool success = browserParent->SendPrint(aOuterWindowID, printData);
+    bool success = mBrowserParent->SendPrint(aOuterWindowID, printData);
     if (!success) {
       aRv.Throw(NS_ERROR_FAILURE);
     }
     return;
   }
 
   nsGlobalWindowOuter* outerWindow =
       nsGlobalWindowOuter::GetOuterWindowWithId(aOuterWindowID);
@@ -3221,22 +3235,16 @@ void nsFrameLoader::Print(uint64_t aOute
     return;
   }
 #endif
 }
 
 already_AddRefed<mozilla::dom::Promise> nsFrameLoader::DrawSnapshot(
     double aX, double aY, double aW, double aH, double aScale,
     const nsAString& aBackgroundColor, mozilla::ErrorResult& aRv) {
-  MOZ_ASSERT(XRE_IsParentProcess());
-  if (!XRE_IsParentProcess()) {
-    aRv = NS_ERROR_FAILURE;
-    return nullptr;
-  }
-
   RefPtr<nsIGlobalObject> global = GetOwnerContent()->GetOwnerGlobal();
   RefPtr<Promise> promise = Promise::Create(global, aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
 
   RefPtr<Document> document = GetOwnerContent()->GetOwnerDocument();
   if (NS_WARN_IF(!document)) {
@@ -3256,50 +3264,54 @@ already_AddRefed<mozilla::dom::Promise> 
           set, NS_RGB(0, 0, 0), aBackgroundColor, &color, nullptr, loader))) {
     aRv = NS_ERROR_FAILURE;
     return nullptr;
   }
 
   gfx::IntRect rect = gfx::IntRect::RoundOut(gfx::Rect(aX, aY, aW, aH));
 
   if (IsRemoteFrame()) {
-    gfx::CrossProcessPaint::StartRemote(GetBrowserParent()->GetTabId(), rect,
+    gfx::CrossProcessPaint::StartRemote(mBrowserParent->GetTabId(), rect,
                                         aScale, color, promise);
   } else {
     gfx::CrossProcessPaint::StartLocal(GetDocShell(), rect, aScale, color,
                                        promise);
   }
 
   return promise.forget();
 }
 
 already_AddRefed<nsIRemoteTab> nsFrameLoader::GetRemoteTab() {
-  if (!mRemoteBrowser) {
-    return nullptr;
-  }
-  if (auto* browserHost = mRemoteBrowser->AsBrowserHost()) {
-    return do_AddRef(browserHost);
-  }
-  return nullptr;
+  return do_AddRef(mBrowserParent);
 }
 
 already_AddRefed<nsILoadContext> nsFrameLoader::LoadContext() {
   nsCOMPtr<nsILoadContext> loadContext;
-  if (IsRemoteFrame() && EnsureRemoteBrowser()) {
-    loadContext = mRemoteBrowser->GetLoadContext();
+  if (IsRemoteFrame() &&
+      (mBrowserParent || mBrowserBridgeChild || TryRemoteBrowser())) {
+    if (mBrowserParent) {
+      loadContext = mBrowserParent->GetLoadContext();
+    } else {
+      loadContext = mBrowserBridgeChild->GetLoadContext();
+    }
   } else {
     loadContext = do_GetInterface(ToSupports(GetDocShell(IgnoreErrors())));
   }
   return loadContext.forget();
 }
 
 already_AddRefed<BrowsingContext> nsFrameLoader::GetBrowsingContext() {
   RefPtr<BrowsingContext> browsingContext;
-  if (IsRemoteFrame() && EnsureRemoteBrowser()) {
-    browsingContext = mRemoteBrowser->GetBrowsingContext();
+  if (IsRemoteFrame() &&
+      (mBrowserParent || mBrowserBridgeChild || TryRemoteBrowser())) {
+    if (mBrowserParent) {
+      browsingContext = mBrowserParent->GetBrowsingContext();
+    } else {
+      browsingContext = mBrowserBridgeChild->GetBrowsingContext();
+    }
   } else if (GetDocShell(IgnoreErrors())) {
     browsingContext = GetDocShell()->GetBrowsingContext();
   }
   return browsingContext.forget();
 }
 
 void nsFrameLoader::InitializeBrowserAPI() {
   if (!OwnerIsMozBrowserFrame()) {
@@ -3333,18 +3345,18 @@ void nsFrameLoader::DestroyBrowserFrameS
   }
 }
 
 void nsFrameLoader::StartPersistence(
     uint64_t aOuterWindowID, nsIWebBrowserPersistDocumentReceiver* aRecv,
     ErrorResult& aRv) {
   MOZ_ASSERT(aRecv);
 
-  if (auto* browserParent = GetBrowserParent()) {
-    browserParent->StartPersistence(aOuterWindowID, aRecv, aRv);
+  if (mBrowserParent) {
+    mBrowserParent->StartPersistence(aOuterWindowID, aRecv, aRv);
     return;
   }
 
   nsCOMPtr<Document> rootDoc =
       GetDocShell() ? GetDocShell()->GetDocument() : nullptr;
   nsCOMPtr<Document> foundDoc;
   if (aOuterWindowID) {
     foundDoc = nsContentUtils::GetSubdocumentWithOuterWindowId(rootDoc,
@@ -3359,51 +3371,44 @@ void nsFrameLoader::StartPersistence(
     nsCOMPtr<nsIWebBrowserPersistDocument> pdoc =
         new mozilla::WebBrowserPersistLocalDocument(foundDoc);
     aRecv->OnDocumentReady(pdoc);
   }
 }
 
 void nsFrameLoader::MaybeUpdatePrimaryBrowserParent(
     BrowserParentChange aChange) {
-  if (!mOwnerContent || !mRemoteBrowser) {
-    return;
-  }
-
-  RefPtr<BrowserHost> browserHost = mRemoteBrowser->AsBrowserHost();
-  if (!browserHost) {
-    return;
-  }
-
-  nsCOMPtr<nsIDocShell> docShell = mOwnerContent->OwnerDoc()->GetDocShell();
-  if (!docShell) {
-    return;
-  }
-
-  int32_t parentType = docShell->ItemType();
-  if (parentType != nsIDocShellTreeItem::typeChrome) {
-    return;
-  }
-
-  nsCOMPtr<nsIDocShellTreeOwner> parentTreeOwner;
-  docShell->GetTreeOwner(getter_AddRefs(parentTreeOwner));
-  if (!parentTreeOwner) {
-    return;
-  }
-
-  if (!mObservingOwnerContent) {
-    mOwnerContent->AddMutationObserver(this);
-    mObservingOwnerContent = true;
-  }
-
-  parentTreeOwner->RemoteTabRemoved(browserHost);
-  if (aChange == eBrowserParentChanged) {
-    bool isPrimary = mOwnerContent->AttrValueIs(
-        kNameSpaceID_None, nsGkAtoms::primary, nsGkAtoms::_true, eIgnoreCase);
-    parentTreeOwner->RemoteTabAdded(browserHost, isPrimary);
+  if (mBrowserParent && mOwnerContent) {
+    nsCOMPtr<nsIDocShell> docShell = mOwnerContent->OwnerDoc()->GetDocShell();
+    if (!docShell) {
+      return;
+    }
+
+    int32_t parentType = docShell->ItemType();
+    if (parentType != nsIDocShellTreeItem::typeChrome) {
+      return;
+    }
+
+    nsCOMPtr<nsIDocShellTreeOwner> parentTreeOwner;
+    docShell->GetTreeOwner(getter_AddRefs(parentTreeOwner));
+    if (!parentTreeOwner) {
+      return;
+    }
+
+    if (!mObservingOwnerContent) {
+      mOwnerContent->AddMutationObserver(this);
+      mObservingOwnerContent = true;
+    }
+
+    parentTreeOwner->RemoteTabRemoved(mBrowserParent);
+    if (aChange == eBrowserParentChanged) {
+      bool isPrimary = mOwnerContent->AttrValueIs(
+          kNameSpaceID_None, nsGkAtoms::primary, nsGkAtoms::_true, eIgnoreCase);
+      parentTreeOwner->RemoteTabAdded(mBrowserParent, isPrimary);
+    }
   }
 }
 
 nsresult nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
                                          nsIURI* aURI) {
   OriginAttributes attrs;
   attrs.mInIsolatedMozBrowser = OwnerIsIsolatedMozBrowserFrame();
   nsresult rv;
@@ -3468,38 +3473,36 @@ nsresult nsFrameLoader::PopulateUserCont
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
 
   return NS_OK;
 }
 
 ProcessMessageManager* nsFrameLoader::GetProcessMessageManager() const {
-  if (auto* browserParent = GetBrowserParent()) {
-    return browserParent->Manager()->GetMessageManager();
-  }
-  return nullptr;
+  return mBrowserParent ? mBrowserParent->Manager()->GetMessageManager()
+                        : nullptr;
 };
 
 JSObject* nsFrameLoader::WrapObject(JSContext* cx,
                                     JS::Handle<JSObject*> aGivenProto) {
   JS::RootedObject result(cx);
   FrameLoader_Binding::Wrap(cx, this, this, aGivenProto, &result);
   return result;
 }
 
 void nsFrameLoader::SkipBrowsingContextDetach() {
   if (IsRemoteFrame()) {
     // OOP Browser - Go directly over Browser Parent
-    if (auto* browserParent = GetBrowserParent()) {
-      Unused << browserParent->SendSkipBrowsingContextDetach();
+    if (mBrowserParent) {
+      Unused << mBrowserParent->SendSkipBrowsingContextDetach();
     }
     // OOP IFrame - Through Browser Bridge Parent, set on browser child
-    else if (auto* browserBridgeChild = GetBrowserBridgeChild()) {
-      Unused << browserBridgeChild->SendSkipBrowsingContextDetach();
+    else if (mBrowserBridgeChild) {
+      Unused << mBrowserBridgeChild->SendSkipBrowsingContextDetach();
     }
     return;
   }
 
   // In process
   RefPtr<nsDocShell> docshell = GetDocShell();
   MOZ_ASSERT(docshell);
   docshell->SkipBrowsingContextDetach();
--- a/dom/base/nsFrameLoader.h
+++ b/dom/base/nsFrameLoader.h
@@ -18,17 +18,16 @@
 #include "nsSize.h"
 #include "nsWrapperCache.h"
 #include "nsIURI.h"
 #include "nsFrameMessageManager.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ParentSHistory.h"
-#include "mozilla/dom/RemoteBrowser.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/layers/LayersTypes.h"
 #include "nsStubMutationObserver.h"
 #include "Units.h"
 #include "nsIFrame.h"
 #include "nsPluginTags.h"
 
 class nsIURI;
@@ -88,19 +87,19 @@ typedef struct _GtkWidget GtkWidget;
     }                                                \
   }
 
 class nsFrameLoader final : public nsStubMutationObserver,
                             public mozilla::dom::ipc::MessageManagerCallback,
                             public nsWrapperCache {
   friend class AutoResetInShow;
   friend class AutoResetInFrameSwap;
+  typedef mozilla::dom::PBrowserParent PBrowserParent;
   typedef mozilla::dom::Document Document;
   typedef mozilla::dom::BrowserParent BrowserParent;
-  typedef mozilla::dom::BrowserBridgeChild BrowserBridgeChild;
   typedef mozilla::dom::BrowsingContext BrowsingContext;
   typedef mozilla::layout::RenderFrame RenderFrame;
 
  public:
   // Called by Frame Elements to create a new FrameLoader.
   static nsFrameLoader* Create(mozilla::dom::Element* aOwner,
                                mozilla::dom::BrowsingContext* aOpener,
                                bool aNetworkCreated);
@@ -307,23 +306,23 @@ class nsFrameLoader final : public nsStu
    * or a remote subframe in the child process.
    */
   bool IsRemoteFrame();
 
   /**
    * Returns the IPDL actor used if this is a top-level remote browser, or null
    * otherwise.
    */
-  BrowserParent* GetBrowserParent() const;
+  PBrowserParent* GetRemoteBrowser() const;
 
   /**
-   * Returns the IPDL actor used if this is an out-of-process iframe, or null
+   * Returns the BrowserBridgeChild if this is an out-of-process iframe, or null
    * otherwise.
    */
-  BrowserBridgeChild* GetBrowserBridgeChild() const;
+  mozilla::dom::BrowserBridgeChild* GetBrowserBridgeChild() const;
 
   /**
    * Returns the layers ID that this remote frame is using to render.
    *
    * This must only be called if this is a remote frame.
    */
   mozilla::layers::LayersId GetLayersId() const;
 
@@ -338,17 +337,17 @@ class nsFrameLoader final : public nsStu
   /**
    * Tell this FrameLoader to use a particular remote browser.
    *
    * This will assert if mBrowserParent is non-null.  In practice,
    * this means you can't have successfully run TryRemoteBrowser() on
    * this object, which means you can't have called ShowRemoteFrame()
    * or ReallyStartLoading().
    */
-  void InitializeFromBrowserParent(BrowserParent* aBrowserParent);
+  void SetRemoteBrowser(nsIRemoteTab* aBrowserParent);
 
   /**
    * Stashes a detached nsIFrame on the frame loader. We do this when we're
    * destroying the nsSubDocumentFrame. If the nsSubdocumentFrame is
    * being reframed we'll restore the detached nsIFrame when it's recreated,
    * otherwise we'll discard the old presentation and set the detached
    * subdoc nsIFrame to null. aContainerDoc is the document containing the
    * the subdoc frame. This enables us to detect when the containing
@@ -441,20 +440,16 @@ class nsFrameLoader final : public nsStu
    * @param aURI The URI to check.
    * @param aTriggeringPrincipal The triggering principal for the load. May be
    *        null, in which case the node principal of the owner content is used.
    */
   nsresult CheckURILoad(nsIURI* aURI, nsIPrincipal* aTriggeringPrincipal);
   void FireErrorEvent();
   nsresult ReallyStartLoadingInternal();
 
-  // Returns true if we have a remote browser or else attempts to create a
-  // remote browser and returns true if successful.
-  bool EnsureRemoteBrowser();
-
   // Return true if remote browser created; nothing else to do
   bool TryRemoteBrowser();
 
   // Tell the remote browser that it's now "virtually visible"
   bool ShowRemoteFrame(const mozilla::ScreenIntSize& size,
                        nsSubDocumentFrame* aFrame = nullptr);
 
   void AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem,
@@ -492,18 +487,21 @@ class nsFrameLoader final : public nsStu
   // a reframe, so that we know not to restore the presentation.
   RefPtr<Document> mContainerDocWhileDetached;
 
   // When performing a process switch, this value is used rather than mURIToLoad
   // to identify the process-switching load which should be resumed in the
   // target process.
   uint64_t mPendingSwitchID;
 
+  RefPtr<BrowserParent> mBrowserParent;
   uint64_t mChildID;
-  RefPtr<mozilla::dom::RemoteBrowser> mRemoteBrowser;
+
+  // This is used when this refers to a remote sub frame
+  RefPtr<mozilla::dom::BrowserBridgeChild> mBrowserBridgeChild;
 
   // Holds the last known size of the frame.
   mozilla::ScreenIntSize mLazySize;
 
   RefPtr<mozilla::dom::ParentSHistory> mParentSHistory;
 
   RefPtr<mozilla::dom::TabListener> mSessionStoreListener;
 
--- a/dom/base/nsPIWindowRoot.h
+++ b/dom/base/nsPIWindowRoot.h
@@ -56,20 +56,21 @@ class nsPIWindowRoot : public mozilla::d
   virtual void GetEnabledDisabledCommands(
       nsTArray<nsCString>& aEnabledCommands,
       nsTArray<nsCString>& aDisabledCommands) = 0;
 
   virtual void SetParentTarget(mozilla::dom::EventTarget* aTarget) = 0;
   virtual mozilla::dom::EventTarget* GetParentTarget() = 0;
 
   // Stores a weak reference to the browser.
-  virtual void AddBrowser(nsIRemoteTab* aBrowser) = 0;
-  virtual void RemoveBrowser(nsIRemoteTab* aBrowser) = 0;
+  virtual void AddBrowser(mozilla::dom::BrowserParent* aBrowser) = 0;
+  virtual void RemoveBrowser(mozilla::dom::BrowserParent* aBrowser) = 0;
 
-  typedef void (*BrowserEnumerator)(nsIRemoteTab* aTab, void* aArg);
+  typedef void (*BrowserEnumerator)(mozilla::dom::BrowserParent* aTab,
+                                    void* aArg);
 
   // Enumerate all stored browsers that for which the weak reference is valid.
   virtual void EnumerateBrowsers(BrowserEnumerator aEnumFunc, void* aArg) = 0;
 
   virtual bool ShowAccelerators() = 0;
   virtual bool ShowFocusRings() = 0;
   virtual void SetShowAccelerators(bool aEnable) = 0;
   virtual void SetShowFocusRings(bool aEnable) = 0;
--- a/dom/base/nsWindowRoot.cpp
+++ b/dom/base/nsWindowRoot.cpp
@@ -292,39 +292,42 @@ nsIGlobalObject* nsWindowRoot::GetParent
   return xpc::NativeGlobal(xpc::PrivilegedJunkScope());
 }
 
 JSObject* nsWindowRoot::WrapObject(JSContext* aCx,
                                    JS::Handle<JSObject*> aGivenProto) {
   return mozilla::dom::WindowRoot_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-void nsWindowRoot::AddBrowser(nsIRemoteTab* aBrowser) {
-  nsWeakPtr weakBrowser = do_GetWeakReference(aBrowser);
+void nsWindowRoot::AddBrowser(mozilla::dom::BrowserParent* aBrowser) {
+  nsWeakPtr weakBrowser =
+      do_GetWeakReference(static_cast<nsIRemoteTab*>(aBrowser));
   mWeakBrowsers.PutEntry(weakBrowser);
 }
 
-void nsWindowRoot::RemoveBrowser(nsIRemoteTab* aBrowser) {
-  nsWeakPtr weakBrowser = do_GetWeakReference(aBrowser);
+void nsWindowRoot::RemoveBrowser(mozilla::dom::BrowserParent* aBrowser) {
+  nsWeakPtr weakBrowser =
+      do_GetWeakReference(static_cast<nsIRemoteTab*>(aBrowser));
   mWeakBrowsers.RemoveEntry(weakBrowser);
 }
 
 void nsWindowRoot::EnumerateBrowsers(BrowserEnumerator aEnumFunc, void* aArg) {
   // Collect strong references to all browsers in a separate array in
   // case aEnumFunc alters mWeakBrowsers.
-  nsTArray<nsCOMPtr<nsIRemoteTab>> remoteTabs;
+  nsTArray<RefPtr<BrowserParent>> browserParents;
   for (auto iter = mWeakBrowsers.ConstIter(); !iter.Done(); iter.Next()) {
-    nsCOMPtr<nsIRemoteTab> remoteTab(do_QueryReferent(iter.Get()->GetKey()));
-    if (remoteTab) {
-      remoteTabs.AppendElement(remoteTab);
+    nsCOMPtr<nsIRemoteTab> browserParent(
+        do_QueryReferent(iter.Get()->GetKey()));
+    if (BrowserParent* tab = BrowserParent::GetFrom(browserParent)) {
+      browserParents.AppendElement(tab);
     }
   }
 
-  for (uint32_t i = 0; i < remoteTabs.Length(); ++i) {
-    aEnumFunc(remoteTabs[i], aArg);
+  for (uint32_t i = 0; i < browserParents.Length(); ++i) {
+    aEnumFunc(browserParents[i], aArg);
   }
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
 
 already_AddRefed<EventTarget> NS_NewWindowRoot(nsPIDOMWindowOuter* aWindow) {
   nsCOMPtr<EventTarget> result = new nsWindowRoot(aWindow);
 
--- a/dom/base/nsWindowRoot.h
+++ b/dom/base/nsWindowRoot.h
@@ -65,18 +65,18 @@ class nsWindowRoot final : public nsPIWi
 
   nsIGlobalObject* GetParentObject();
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aGivenProto) override;
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsWindowRoot)
 
-  virtual void AddBrowser(nsIRemoteTab* aBrowser) override;
-  virtual void RemoveBrowser(nsIRemoteTab* aBrowser) override;
+  virtual void AddBrowser(mozilla::dom::BrowserParent* aBrowser) override;
+  virtual void RemoveBrowser(mozilla::dom::BrowserParent* aBrowser) override;
   virtual void EnumerateBrowsers(BrowserEnumerator aEnumFunc,
                                  void* aArg) override;
 
   virtual bool ShowAccelerators() override { return mShowAccelerators; }
 
   virtual bool ShowFocusRings() override { return mShowFocusRings; }
 
   virtual void SetShowAccelerators(bool aEnable) override {
--- a/dom/chrome-webidl/WindowGlobalActors.webidl
+++ b/dom/chrome-webidl/WindowGlobalActors.webidl
@@ -18,27 +18,29 @@ interface WindowGlobalParent {
 
   readonly attribute unsigned long long innerWindowId;
   readonly attribute unsigned long long outerWindowId;
 
   readonly attribute FrameLoader? rootFrameLoader; // Embedded (browser) only
 
   readonly attribute WindowGlobalChild? childActor; // in-process only
 
+  readonly attribute RemoteTab? remoteTab; // out-of-process only
+
   // Information about the currently loaded document.
   readonly attribute Principal documentPrincipal;
   readonly attribute URI? documentURI;
 
   static WindowGlobalParent? getByInnerWindowId(unsigned long long innerWindowId);
 
   [Throws]
   JSWindowActorParent getActor(DOMString name);
 
   [Throws]
-  Promise<unsigned long long> changeFrameRemoteness(
+  Promise<RemoteTab> changeFrameRemoteness(
     BrowsingContext? bc, DOMString remoteType,
     unsigned long long pendingSwitchId);
 };
 
 [Exposed=Window, ChromeOnly]
 interface WindowGlobalChild {
   readonly attribute boolean isClosed;
   readonly attribute boolean isInProcess;
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -1091,17 +1091,19 @@ struct MOZ_STACK_CLASS AccessKeyInfo {
       : event(aEvent), charCodes(aCharCodes) {}
 };
 
 static bool HandleAccessKeyInRemoteChild(BrowserParent* aBrowserParent,
                                          void* aArg) {
   AccessKeyInfo* accessKeyInfo = static_cast<AccessKeyInfo*>(aArg);
 
   // Only forward accesskeys for the active tab.
-  if (aBrowserParent->GetDocShellIsActive()) {
+  bool active;
+  aBrowserParent->GetDocShellIsActive(&active);
+  if (active) {
     // Even if there is no target for the accesskey in this process,
     // the event may match with a content accesskey.  If so, the keyboard
     // event should be handled with reply event for preventing double action.
     // (e.g., Alt+Shift+F on Windows may focus a content in remote and open
     // "File" menu.)
     accessKeyInfo->event->StopPropagation();
     accessKeyInfo->event->MarkAsWaitingReplyFromRemoteProcess();
     aBrowserParent->HandleAccessKey(*accessKeyInfo->event,
--- a/dom/html/nsGenericHTMLFrameElement.cpp
+++ b/dom/html/nsGenericHTMLFrameElement.cpp
@@ -127,44 +127,31 @@ void nsGenericHTMLFrameElement::EnsureFr
     return;
   }
 
   // Strangely enough, this method doesn't actually ensure that the
   // frameloader exists.  It's more of a best-effort kind of thing.
   mFrameLoader = nsFrameLoader::Create(this, mOpenerWindow, mNetworkCreated);
 }
 
-void nsGenericHTMLFrameElement::DisallowCreateFrameLoader() {
-  MOZ_ASSERT(!mFrameLoader);
-  MOZ_ASSERT(!mFrameLoaderCreationDisallowed);
-  mFrameLoaderCreationDisallowed = true;
-}
-
-void nsGenericHTMLFrameElement::AllowCreateFrameLoader() {
-  MOZ_ASSERT(!mFrameLoader);
-  MOZ_ASSERT(mFrameLoaderCreationDisallowed);
-  mFrameLoaderCreationDisallowed = false;
-}
-
-void nsGenericHTMLFrameElement::CreateRemoteFrameLoader(
-    BrowserParent* aBrowserParent) {
+nsresult nsGenericHTMLFrameElement::CreateRemoteFrameLoader(
+    nsIRemoteTab* aBrowserParent) {
   MOZ_ASSERT(!mFrameLoader);
   EnsureFrameLoader();
-  if (NS_WARN_IF(!mFrameLoader)) {
-    return;
-  }
-  mFrameLoader->InitializeFromBrowserParent(aBrowserParent);
+  NS_ENSURE_STATE(mFrameLoader);
+  mFrameLoader->SetRemoteBrowser(aBrowserParent);
 
   if (nsSubDocumentFrame* subdocFrame = do_QueryFrame(GetPrimaryFrame())) {
     // The reflow for this element already happened while we were waiting
     // for the iframe creation. Therefore the subdoc frame didn't have a
     // frameloader when UpdatePositionAndSize was supposed to be called in
     // ReflowFinished, and we need to do it properly now.
     mFrameLoader->UpdatePositionAndSize(subdocFrame);
   }
+  return NS_OK;
 }
 
 void nsGenericHTMLFrameElement::PresetOpenerWindow(
     const Nullable<WindowProxyHolder>& aOpenerWindow, ErrorResult& aRv) {
   MOZ_ASSERT(!mFrameLoader);
   mOpenerWindow =
       aOpenerWindow.IsNull() ? nullptr : aOpenerWindow.Value().get();
 }
@@ -451,16 +438,32 @@ NS_IMETHODIMP nsGenericHTMLFrameElement:
   }
 
   // Isolation is only disabled if the attribute is present
   *aOut = !HasAttr(kNameSpaceID_None, nsGkAtoms::noisolation);
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsGenericHTMLFrameElement::DisallowCreateFrameLoader() {
+  MOZ_ASSERT(!mFrameLoader);
+  MOZ_ASSERT(!mFrameLoaderCreationDisallowed);
+  mFrameLoaderCreationDisallowed = true;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsGenericHTMLFrameElement::AllowCreateFrameLoader() {
+  MOZ_ASSERT(!mFrameLoader);
+  MOZ_ASSERT(mFrameLoaderCreationDisallowed);
+  mFrameLoaderCreationDisallowed = false;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
 nsGenericHTMLFrameElement::InitializeBrowserAPI() {
   MOZ_ASSERT(mFrameLoader);
   InitBrowserElementAPI();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsGenericHTMLFrameElement::DestroyBrowserFrameScripts() {
--- a/dom/html/nsGenericHTMLFrameElement.h
+++ b/dom/html/nsGenericHTMLFrameElement.h
@@ -14,17 +14,16 @@
 #include "nsFrameLoader.h"
 #include "nsFrameLoaderOwner.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIDOMEventListener.h"
 #include "nsIMozBrowserFrame.h"
 
 namespace mozilla {
 namespace dom {
-class BrowserParent;
 template <typename>
 struct Nullable;
 class WindowProxyHolder;
 class XULFrameElement;
 }  // namespace dom
 }  // namespace mozilla
 
 #define NS_GENERICHTMLFRAMEELEMENT_IID               \
@@ -86,41 +85,16 @@ class nsGenericHTMLFrameElement : public
 
   void SwapFrameLoaders(nsFrameLoaderOwner* aOtherLoaderOwner,
                         mozilla::ErrorResult& rv);
 
   void PresetOpenerWindow(const mozilla::dom::Nullable<
                               mozilla::dom::WindowProxyHolder>& aOpenerWindow,
                           mozilla::ErrorResult& aRv);
 
-  /**
-   * Normally, a frame tries to create its frame loader when its src is
-   * modified, or its contentWindow is accessed.
-   *
-   * disallowCreateFrameLoader prevents the frame element from creating its
-   * frame loader (in the same way that not being inside a document prevents the
-   * creation of a frame loader).  allowCreateFrameLoader lifts this
-   * restriction.
-   *
-   * These methods are not re-entrant -- it is an error to call
-   * disallowCreateFrameLoader twice without first calling allowFrameLoader.
-   *
-   * It's also an error to call either method if we already have a frame loader.
-   */
-  void DisallowCreateFrameLoader();
-  void AllowCreateFrameLoader();
-
-  /**
-   * Create a remote (i.e., out-of-process) frame loader attached to the given
-   * remote tab.
-   *
-   * It is an error to call this method if we already have a frame loader.
-   */
-  void CreateRemoteFrameLoader(mozilla::dom::BrowserParent* aBrowserParent);
-
   static void InitStatics();
   static bool BrowserFramesEnabled();
 
   /**
    * Helper method to map a HTML 'scrolling' attribute value to a nsIScrollable
    * enum value.  scrolling="no" (and its synonyms) maps to
    * nsIScrollable::Scrollbar_Never, and anything else (including nullptr) maps
    * to nsIScrollable::Scrollbar_Auto.
--- a/dom/interfaces/base/nsIRemoteTab.idl
+++ b/dom/interfaces/base/nsIRemoteTab.idl
@@ -52,18 +52,16 @@ interface nsIRemoteTab : nsISupports
    * potentially unhelpful memory usage. Calling preserveLayers
    * will cause the layers to be preserved even for inactive
    * docshells.
    */
   void preserveLayers(in boolean aPreserveLayers);
 
   readonly attribute uint64_t tabId;
 
-  readonly attribute uint64_t contentProcessId;
-
   /**
    * The OS level process Id of the related child process.
    */
   readonly attribute int32_t osPid;
 
   readonly attribute boolean hasContentOpener;
   /**
    * True if we've previously received layers for this tab when switching to
@@ -141,14 +139,9 @@ interface nsIRemoteTab : nsISupports
    * Interrupt content scripts if possible/needed to allow chrome scripts in the
    * content process to run (in particular, to allow navigating through browser
    * history.
    */
   [implicit_jscontext, binaryname(MaybeCancelContentJSExecutionFromScript)]
   void maybeCancelContentJSExecution(
       in nsIRemoteTab_NavigationType aNavigationType,
       [optional] in jsval aCancelContentJSOptions);
-
-  /**
-   * Notify the remote tab that the resolution has changed.
-   */
-  [noscript] void notifyResolutionChanged();
 };
--- a/dom/interfaces/html/nsIMozBrowserFrame.idl
+++ b/dom/interfaces/html/nsIMozBrowserFrame.idl
@@ -31,16 +31,40 @@ interface nsIMozBrowserFrame : nsIDOMMoz
    *
    * Isolation can be disabled by setting the frame's isolated attribute to
    * false.  Disabling isolation is only allowed if the containing document has
    * browser permission (or equivalent access).
    */
   [infallible] readonly attribute boolean isolated;
 
   /**
+   * Normally, a frame tries to create its frame loader when its src is
+   * modified, or its contentWindow is accessed.
+   *
+   * disallowCreateFrameLoader prevents the frame element from creating its
+   * frame loader (in the same way that not being inside a document prevents the
+   * creation of a frame loader).  allowCreateFrameLoader lifts this restriction.
+   *
+   * These methods are not re-entrant -- it is an error to call
+   * disallowCreateFrameLoader twice without first calling allowFrameLoader.
+   *
+   * It's also an error to call either method if we already have a frame loader.
+   */
+  void disallowCreateFrameLoader();
+  void allowCreateFrameLoader();
+
+  /**
+   * Create a remote (i.e., out-of-process) frame loader attached to the given
+   * remote tab.
+   *
+   * It is an error to call this method if we already have a frame loader.
+   */
+  void createRemoteFrameLoader(in nsIRemoteTab aRemoteTab);
+
+  /**
    * Initialize the API, and add frame message listener that supports API
    * invocations.
    */
   [noscript] void initializeBrowserAPI();
 
   /**
    * Notify frame scripts that support the API to destroy.
    */
--- a/dom/ipc/BrowserBridgeChild.cpp
+++ b/dom/ipc/BrowserBridgeChild.cpp
@@ -21,16 +21,98 @@ BrowserBridgeChild::BrowserBridgeChild(n
                                        BrowsingContext* aBrowsingContext)
     : mLayersId{0},
       mIPCOpen(true),
       mFrameLoader(aFrameLoader),
       mBrowsingContext(aBrowsingContext) {}
 
 BrowserBridgeChild::~BrowserBridgeChild() {}
 
+already_AddRefed<BrowserBridgeChild> BrowserBridgeChild::Create(
+    nsFrameLoader* aFrameLoader, const TabContext& aContext,
+    const nsString& aRemoteType, BrowsingContext* aBrowsingContext) {
+  MOZ_ASSERT(XRE_IsContentProcess());
+
+  // Determine our embedder's BrowserChild actor.
+  RefPtr<Element> owner = aFrameLoader->GetOwnerContent();
+  MOZ_DIAGNOSTIC_ASSERT(owner);
+
+  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(owner->GetOwnerGlobal());
+  MOZ_DIAGNOSTIC_ASSERT(docShell);
+
+  RefPtr<BrowserChild> browserChild = BrowserChild::GetFrom(docShell);
+  MOZ_DIAGNOSTIC_ASSERT(browserChild);
+
+  uint32_t chromeFlags = 0;
+
+  nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
+  if (docShell) {
+    docShell->GetTreeOwner(getter_AddRefs(treeOwner));
+  }
+  if (treeOwner) {
+    nsCOMPtr<nsIWebBrowserChrome> wbc = do_GetInterface(treeOwner);
+    if (wbc) {
+      wbc->GetChromeFlags(&chromeFlags);
+    }
+  }
+
+  // Checking that this actually does something useful is
+  // https://bugzilla.mozilla.org/show_bug.cgi?id=1542710
+  nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(docShell);
+  if (loadContext && loadContext->UsePrivateBrowsing()) {
+    chromeFlags |= nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW;
+  }
+  if (docShell->GetAffectPrivateSessionLifetime()) {
+    chromeFlags |= nsIWebBrowserChrome::CHROME_PRIVATE_LIFETIME;
+  }
+
+  RefPtr<BrowserBridgeChild> browserBridge =
+      new BrowserBridgeChild(aFrameLoader, aBrowsingContext);
+  // Reference is freed in BrowserChild::DeallocPBrowserBridgeChild.
+  browserChild->SendPBrowserBridgeConstructor(
+      do_AddRef(browserBridge).take(),
+      PromiseFlatString(aContext.PresentationURL()), aRemoteType,
+      aBrowsingContext, chromeFlags);
+  browserBridge->mIPCOpen = true;
+
+  return browserBridge.forget();
+}
+
+void BrowserBridgeChild::UpdateDimensions(const nsIntRect& aRect,
+                                          const mozilla::ScreenIntSize& aSize) {
+  MOZ_DIAGNOSTIC_ASSERT(mIPCOpen);
+
+  RefPtr<Element> owner = mFrameLoader->GetOwnerContent();
+  nsCOMPtr<nsIWidget> widget = nsContentUtils::WidgetForContent(owner);
+  if (!widget) {
+    widget = nsContentUtils::WidgetForDocument(owner->OwnerDoc());
+  }
+  MOZ_DIAGNOSTIC_ASSERT(widget);
+
+  CSSToLayoutDeviceScale widgetScale = widget->GetDefaultScale();
+
+  LayoutDeviceIntRect devicePixelRect = ViewAs<LayoutDevicePixel>(
+      aRect, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
+  LayoutDeviceIntSize devicePixelSize = ViewAs<LayoutDevicePixel>(
+      aSize, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
+
+  // XXX What are clientOffset and chromeOffset used for? Are they meaningful
+  // for nested iframes with transforms?
+  LayoutDeviceIntPoint clientOffset;
+  LayoutDeviceIntPoint chromeOffset;
+
+  CSSRect unscaledRect = devicePixelRect / widgetScale;
+  CSSSize unscaledSize = devicePixelSize / widgetScale;
+  hal::ScreenOrientation orientation = hal::eScreenOrientation_Default;
+  DimensionInfo di(unscaledRect, unscaledSize, orientation, clientOffset,
+                   chromeOffset);
+
+  Unused << SendUpdateDimensions(di);
+}
+
 void BrowserBridgeChild::NavigateByKey(bool aForward,
                                        bool aForDocumentNavigation) {
   Unused << SendNavigateByKey(aForward, aForDocumentNavigation);
 }
 
 void BrowserBridgeChild::Activate() { Unused << SendActivate(); }
 
 void BrowserBridgeChild::Deactivate() { Unused << SendDeactivate(); }
--- a/dom/ipc/BrowserBridgeChild.h
+++ b/dom/ipc/BrowserBridgeChild.h
@@ -8,69 +8,72 @@
 #define mozilla_dom_BrowserBridgeChild_h
 
 #include "mozilla/dom/PBrowserBridgeChild.h"
 #include "mozilla/dom/BrowserChild.h"
 
 namespace mozilla {
 namespace dom {
 class BrowsingContext;
-class ContentChild;
 
 /**
  * BrowserBridgeChild implements the child actor part of the PBrowserBridge
  * protocol. See PBrowserBridge for more information.
  */
 class BrowserBridgeChild : public PBrowserBridgeChild {
  public:
   NS_INLINE_DECL_REFCOUNTING(BrowserBridgeChild);
 
   BrowserChild* Manager() {
     MOZ_ASSERT(mIPCOpen);
     return static_cast<BrowserChild*>(PBrowserBridgeChild::Manager());
   }
 
   mozilla::layers::LayersId GetLayersId() { return mLayersId; }
-  nsFrameLoader* GetFrameLoader() const { return mFrameLoader; }
 
   BrowsingContext* GetBrowsingContext() { return mBrowsingContext; }
 
   // XXX(nika): We should have a load context here. (bug 1532664)
   nsILoadContext* GetLoadContext() { return nullptr; }
 
+  static already_AddRefed<BrowserBridgeChild> Create(
+      nsFrameLoader* aFrameLoader, const TabContext& aContext,
+      const nsString& aRemoteType, BrowsingContext* aBrowsingContext);
+
+  void UpdateDimensions(const nsIntRect& aRect,
+                        const mozilla::ScreenIntSize& aSize);
+
   void NavigateByKey(bool aForward, bool aForDocumentNavigation);
 
   void Activate();
 
   void Deactivate();
 
   void SetIsUnderHiddenEmbedderElement(bool aIsUnderHiddenEmbedderElement);
 
   static BrowserBridgeChild* GetFrom(nsFrameLoader* aFrameLoader);
 
   static BrowserBridgeChild* GetFrom(nsIContent* aContent);
 
  protected:
-  friend class ContentChild;
   friend class PBrowserBridgeChild;
 
-  BrowserBridgeChild(nsFrameLoader* aFrameLoader,
-                     BrowsingContext* aBrowsingContext);
-
   mozilla::ipc::IPCResult RecvSetLayersId(
       const mozilla::layers::LayersId& aLayersId);
 
   mozilla::ipc::IPCResult RecvRequestFocus(const bool& aCanRaise);
 
   mozilla::ipc::IPCResult RecvMoveFocus(const bool& aForward,
                                         const bool& aForDocumentNavigation);
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
 
  private:
+  explicit BrowserBridgeChild(nsFrameLoader* aFrameLoader,
+                              BrowsingContext* aBrowsingContext);
   ~BrowserBridgeChild();
 
   mozilla::layers::LayersId mLayersId;
   bool mIPCOpen;
   RefPtr<nsFrameLoader> mFrameLoader;
   RefPtr<BrowsingContext> mBrowsingContext;
 };
 
deleted file mode 100644
--- a/dom/ipc/BrowserBridgeHost.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 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 "mozilla/dom/BrowserBridgeHost.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BrowserBridgeHost)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-NS_IMPL_CYCLE_COLLECTION(BrowserBridgeHost)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(BrowserBridgeHost)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(BrowserBridgeHost)
-
-BrowserBridgeHost::BrowserBridgeHost(BrowserBridgeChild* aChild)
-    : mBridge(aChild) {}
-
-mozilla::layers::LayersId BrowserBridgeHost::GetLayersId() const {
-  return mBridge->GetLayersId();
-}
-
-BrowsingContext* BrowserBridgeHost::GetBrowsingContext() const {
-  return mBridge->GetBrowsingContext();
-}
-
-nsILoadContext* BrowserBridgeHost::GetLoadContext() const {
-  return mBridge->GetLoadContext();
-}
-
-void BrowserBridgeHost::LoadURL(nsIURI* aURI) {
-  nsAutoCString spec;
-  aURI->GetSpec(spec);
-  Unused << mBridge->SendLoadURL(spec);
-}
-
-void BrowserBridgeHost::ResumeLoad(uint64_t aPendingSwitchId) {
-  Unused << mBridge->SendResumeLoad(aPendingSwitchId);
-}
-
-void BrowserBridgeHost::DestroyStart() { DestroyComplete(); }
-
-void BrowserBridgeHost::DestroyComplete() {
-  if (!mBridge) {
-    return;
-  }
-
-  Unused << mBridge->Send__delete__(mBridge);
-  mBridge = nullptr;
-}
-
-bool BrowserBridgeHost::Show(const ScreenIntSize& aSize, bool aParentIsActive) {
-  RefPtr<Element> owner = mBridge->GetFrameLoader()->GetOwnerContent();
-  nsCOMPtr<nsIWidget> widget = nsContentUtils::WidgetForContent(owner);
-  if (!widget) {
-    widget = nsContentUtils::WidgetForDocument(owner->OwnerDoc());
-  }
-  MOZ_DIAGNOSTIC_ASSERT(widget);
-  nsSizeMode sizeMode = widget ? widget->SizeMode() : nsSizeMode_Normal;
-
-  Unused << mBridge->SendShow(aSize, aParentIsActive, sizeMode);
-  return true;
-}
-
-void BrowserBridgeHost::UpdateDimensions(const nsIntRect& aRect,
-                                         const ScreenIntSize& aSize) {
-  RefPtr<Element> owner = mBridge->GetFrameLoader()->GetOwnerContent();
-  nsCOMPtr<nsIWidget> widget = nsContentUtils::WidgetForContent(owner);
-  if (!widget) {
-    widget = nsContentUtils::WidgetForDocument(owner->OwnerDoc());
-  }
-  MOZ_DIAGNOSTIC_ASSERT(widget);
-
-  CSSToLayoutDeviceScale widgetScale = widget->GetDefaultScale();
-
-  LayoutDeviceIntRect devicePixelRect = ViewAs<LayoutDevicePixel>(
-      aRect, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
-  LayoutDeviceIntSize devicePixelSize = ViewAs<LayoutDevicePixel>(
-      aSize, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
-
-  // XXX What are clientOffset and chromeOffset used for? Are they meaningful
-  // for nested iframes with transforms?
-  LayoutDeviceIntPoint clientOffset;
-  LayoutDeviceIntPoint chromeOffset;
-
-  CSSRect unscaledRect = devicePixelRect / widgetScale;
-  CSSSize unscaledSize = devicePixelSize / widgetScale;
-  hal::ScreenOrientation orientation = hal::eScreenOrientation_Default;
-  DimensionInfo di(unscaledRect, unscaledSize, orientation, clientOffset,
-                   chromeOffset);
-
-  Unused << mBridge->SendUpdateDimensions(di);
-}
-
-}  // namespace dom
-}  // namespace mozilla
deleted file mode 100644
--- a/dom/ipc/BrowserBridgeHost.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 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/. */
-
-#ifndef mozilla_dom_BrowserBridgeHost_h
-#define mozilla_dom_BrowserBridgeHost_h
-
-#include "mozilla/dom/RemoteBrowser.h"
-#include "mozilla/dom/BrowserBridgeChild.h"
-
-namespace mozilla {
-namespace dom {
-
-/**
- * BrowserBridgeHost manages a remote browser from a content process.
- *
- * It is used via the RemoteBrowser interface in nsFrameLoader and proxies
- * work to the chrome process via PBrowserBridge.
- *
- * See `dom/docs/Fission-IPC-Diagram.svg` for an overview of the DOM IPC
- * actors.
- */
-class BrowserBridgeHost : public RemoteBrowser {
- public:
-  typedef mozilla::layers::LayersId LayersId;
-
-  explicit BrowserBridgeHost(BrowserBridgeChild* aChild);
-
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(BrowserBridgeHost)
-
-  // Get the IPDL actor for the BrowserBridgeChild.
-  BrowserBridgeChild* GetActor() { return mBridge; }
-
-  BrowserHost* AsBrowserHost() override { return nullptr; }
-  BrowserBridgeHost* AsBrowserBridgeHost() override { return this; }
-
-  LayersId GetLayersId() const override;
-  BrowsingContext* GetBrowsingContext() const override;
-  nsILoadContext* GetLoadContext() const override;
-
-  void LoadURL(nsIURI* aURI) override;
-  void ResumeLoad(uint64_t aPendingSwitchId) override;
-  void DestroyStart() override;
-  void DestroyComplete() override;
-
-  bool Show(const ScreenIntSize& aSize, bool aParentIsActive) override;
-  void UpdateDimensions(const nsIntRect& aRect,
-                        const ScreenIntSize& aSize) override;
-
- private:
-  virtual ~BrowserBridgeHost() = default;
-
-  // The IPDL actor for proxying browser operations
-  RefPtr<BrowserBridgeChild> mBridge;
-};
-
-}  // namespace dom
-}  // namespace mozilla
-
-#endif  // mozilla_dom_BrowserBridgeHost_h
--- a/dom/ipc/BrowserBridgeParent.cpp
+++ b/dom/ipc/BrowserBridgeParent.cpp
@@ -56,19 +56,19 @@ nsresult BrowserBridgeParent::Init(const
 
   ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
   TabId tabId(nsContentUtils::GenerateTabId());
   cpm->RegisterRemoteFrame(tabId, ContentParentId(0), TabId(0),
                            tabContext.AsIPCTabContext(),
                            constructorSender->ChildID());
 
   // Construct the BrowserParent object for our subframe.
-  RefPtr<BrowserParent> browserParent(new BrowserParent(
-      constructorSender, tabId, tabContext, aBrowsingContext, aChromeFlags));
-  browserParent->SetBrowserBridgeParent(this);
+  RefPtr<BrowserParent> browserParent(
+      new BrowserParent(constructorSender, tabId, tabContext, aBrowsingContext,
+                        aChromeFlags, this));
 
   // Open a remote endpoint for our PBrowser actor. DeallocPBrowserParent
   // releases the ref taken.
   ManagedEndpoint<PBrowserChild> childEp =
       constructorSender->OpenPBrowserEndpoint(do_AddRef(browserParent).take());
   if (NS_WARN_IF(!childEp.IsValid())) {
     MOZ_ASSERT(false, "Browser Open Endpoint Failed");
     return NS_ERROR_FAILURE;
deleted file mode 100644
--- a/dom/ipc/BrowserHost.cpp
+++ /dev/null
@@ -1,379 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 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 "mozilla/dom/BrowserHost.h"
-
-#include "mozilla/dom/CancelContentJSOptionsBinding.h"
-#include "mozilla/dom/WindowGlobalParent.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BrowserHost)
-  NS_INTERFACE_MAP_ENTRY(nsIRemoteTab)
-  NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, RemoteBrowser)
-NS_INTERFACE_MAP_END
-
-NS_IMPL_CYCLE_COLLECTION(BrowserHost, mRoot)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(BrowserHost)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(BrowserHost)
-
-BrowserHost::BrowserHost(BrowserParent* aParent)
-    : mId(aParent->GetTabId()), mRoot(aParent) {
-  mRoot->SetBrowserHost(this);
-}
-
-BrowserHost* BrowserHost::GetFrom(nsIRemoteTab* aRemoteTab) {
-  return static_cast<BrowserHost*>(aRemoteTab);
-}
-
-mozilla::layers::LayersId BrowserHost::GetLayersId() const {
-  return mRoot->GetRenderFrame()->GetLayersId();
-}
-
-BrowsingContext* BrowserHost::GetBrowsingContext() const {
-  return mRoot->GetBrowsingContext();
-}
-
-nsILoadContext* BrowserHost::GetLoadContext() const {
-  RefPtr<nsILoadContext> loadContext = mRoot->GetLoadContext();
-  return loadContext;
-}
-
-a11y::DocAccessibleParent* BrowserHost::GetTopLevelDocAccessible() const {
-  return mRoot->GetTopLevelDocAccessible();
-}
-
-void BrowserHost::LoadURL(nsIURI* aURI) { mRoot->LoadURL(aURI); }
-
-void BrowserHost::ResumeLoad(uint64_t aPendingSwitchId) {
-  mRoot->ResumeLoad(aPendingSwitchId);
-}
-
-void BrowserHost::DestroyStart() { mRoot->Destroy(); }
-
-void BrowserHost::DestroyComplete() {
-  if (!mRoot) {
-    return;
-  }
-  mRoot->SetOwnerElement(nullptr);
-  mRoot->Destroy();
-  mRoot = nullptr;
-}
-
-bool BrowserHost::Show(const ScreenIntSize& aSize, bool aParentIsActive) {
-  return mRoot->Show(aSize, aParentIsActive);
-}
-
-void BrowserHost::UpdateDimensions(const nsIntRect& aRect,
-                                   const ScreenIntSize& aSize) {
-  mRoot->UpdateDimensions(aRect, aSize);
-}
-
-/* attribute boolean docShellIsActive; */
-NS_IMETHODIMP
-BrowserHost::GetDocShellIsActive(bool* aDocShellIsActive) {
-  if (!mRoot) {
-    *aDocShellIsActive = false;
-    return NS_OK;
-  }
-  *aDocShellIsActive = mRoot->GetDocShellIsActive();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-BrowserHost::SetDocShellIsActive(bool aDocShellIsActive) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  VisitAll([&](BrowserParent* aBrowserParent) {
-    aBrowserParent->SetDocShellIsActive(aDocShellIsActive);
-  });
-  return NS_OK;
-}
-
-/* attribute boolean renderLayers; */
-NS_IMETHODIMP
-BrowserHost::GetRenderLayers(bool* aRenderLayers) {
-  if (!mRoot) {
-    *aRenderLayers = false;
-    return NS_OK;
-  }
-  *aRenderLayers = mRoot->GetRenderLayers();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-BrowserHost::SetRenderLayers(bool aRenderLayers) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  VisitAll([&](BrowserParent* aBrowserParent) {
-    aBrowserParent->SetRenderLayers(aRenderLayers);
-  });
-  return NS_OK;
-}
-
-/* readonly attribute boolean hasLayers; */
-NS_IMETHODIMP
-BrowserHost::GetHasLayers(bool* aHasLayers) {
-  if (!mRoot) {
-    *aHasLayers = false;
-    return NS_OK;
-  }
-  *aHasLayers = mRoot->GetHasLayers();
-  return NS_OK;
-}
-
-/* void forceRepaint (); */
-NS_IMETHODIMP
-BrowserHost::ForceRepaint(void) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  VisitAll(
-      [](BrowserParent* aBrowserParent) { aBrowserParent->ForceRepaint(); });
-  return NS_OK;
-}
-
-/* void resolutionChanged (); */
-NS_IMETHODIMP
-BrowserHost::NotifyResolutionChanged(void) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  VisitAll([](BrowserParent* aBrowserParent) {
-    aBrowserParent->NotifyResolutionChanged();
-  });
-  return NS_OK;
-}
-
-/* void deprioritize (); */
-NS_IMETHODIMP
-BrowserHost::Deprioritize(void) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  VisitAll(
-      [](BrowserParent* aBrowserParent) { aBrowserParent->Deprioritize(); });
-  return NS_OK;
-}
-
-/* void preserveLayers (in boolean aPreserveLayers); */
-NS_IMETHODIMP
-BrowserHost::PreserveLayers(bool aPreserveLayers) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  VisitAll([&](BrowserParent* aBrowserParent) {
-    aBrowserParent->PreserveLayers(aPreserveLayers);
-  });
-  return NS_OK;
-}
-
-/* readonly attribute uint64_t tabId; */
-NS_IMETHODIMP
-BrowserHost::GetTabId(uint64_t* aTabId) {
-  *aTabId = mId;
-  return NS_OK;
-}
-
-/* readonly attribute uint64_t contentProcessId; */
-NS_IMETHODIMP
-BrowserHost::GetContentProcessId(uint64_t* aContentProcessId) {
-  if (!mRoot) {
-    *aContentProcessId = 0;
-    return NS_OK;
-  }
-  *aContentProcessId = GetContentParent()->ChildID();
-  return NS_OK;
-}
-
-/* readonly attribute int32_t osPid; */
-NS_IMETHODIMP
-BrowserHost::GetOsPid(int32_t* aOsPid) {
-  if (!mRoot) {
-    *aOsPid = 0;
-    return NS_OK;
-  }
-  *aOsPid = GetContentParent()->Pid();
-  return NS_OK;
-}
-
-/* readonly attribute boolean hasContentOpener; */
-NS_IMETHODIMP
-BrowserHost::GetHasContentOpener(bool* aHasContentOpener) {
-  if (!mRoot) {
-    *aHasContentOpener = false;
-    return NS_OK;
-  }
-  *aHasContentOpener = mRoot->GetHasContentOpener();
-  return NS_OK;
-}
-
-/* readonly attribute boolean hasPresented; */
-NS_IMETHODIMP
-BrowserHost::GetHasPresented(bool* aHasPresented) {
-  if (!mRoot) {
-    *aHasPresented = false;
-    return NS_OK;
-  }
-  *aHasPresented = mRoot->GetHasPresented();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-BrowserHost::GetWindowGlobalParents(
-    nsTArray<RefPtr<WindowGlobalParent>>& aWindowGlobalParents) {
-  if (!mRoot) {
-    aWindowGlobalParents = nsTArray<RefPtr<WindowGlobalParent>>();
-    return NS_OK;
-  }
-  VisitAll([&](BrowserParent* aBrowser) {
-    const auto& windowGlobalParents = aBrowser->ManagedPWindowGlobalParent();
-    for (auto iter = windowGlobalParents.ConstIter(); !iter.Done();
-         iter.Next()) {
-      WindowGlobalParent* windowGlobalParent =
-          static_cast<WindowGlobalParent*>(iter.Get()->GetKey());
-      aWindowGlobalParents.AppendElement(windowGlobalParent);
-    }
-  });
-  return NS_OK;
-}
-
-/* void transmitPermissionsForPrincipal (in nsIPrincipal aPrincipal); */
-NS_IMETHODIMP
-BrowserHost::TransmitPermissionsForPrincipal(nsIPrincipal* aPrincipal) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  return GetContentParent()->TransmitPermissionsForPrincipal(aPrincipal);
-}
-
-/* readonly attribute boolean hasBeforeUnload; */
-NS_IMETHODIMP
-BrowserHost::GetHasBeforeUnload(bool* aHasBeforeUnload) {
-  if (!mRoot) {
-    *aHasBeforeUnload = false;
-    return NS_OK;
-  }
-  *aHasBeforeUnload = mRoot->GetHasBeforeUnload();
-  return NS_OK;
-}
-
-/* readonly attribute Element ownerElement; */
-NS_IMETHODIMP
-BrowserHost::GetOwnerElement(mozilla::dom::Element** aOwnerElement) {
-  if (!mRoot) {
-    *aOwnerElement = nullptr;
-    return NS_OK;
-  }
-  *aOwnerElement = mRoot->GetOwnerElement();
-  return NS_OK;
-}
-
-/* boolean startApzAutoscroll (in float aAnchorX, in float aAnchorY, in nsViewID
- * aScrollId, in uint32_t aPresShellId); */
-NS_IMETHODIMP
-BrowserHost::StartApzAutoscroll(float aAnchorX, float aAnchorY,
-                                nsViewID aScrollId, uint32_t aPresShellId,
-                                bool* _retval) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  *_retval =
-      mRoot->StartApzAutoscroll(aAnchorX, aAnchorY, aScrollId, aPresShellId);
-  return NS_OK;
-}
-
-/* void stopApzAutoscroll (in nsViewID aScrollId, in uint32_t aPresShellId); */
-NS_IMETHODIMP
-BrowserHost::StopApzAutoscroll(nsViewID aScrollId, uint32_t aPresShellId) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  mRoot->StopApzAutoscroll(aScrollId, aPresShellId);
-  return NS_OK;
-}
-
-/* bool saveRecording (in AString aFileName); */
-NS_IMETHODIMP
-BrowserHost::SaveRecording(const nsAString& aFileName, bool* _retval) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  nsCOMPtr<nsIFile> file;
-  nsresult rv = NS_NewLocalFile(aFileName, false, getter_AddRefs(file));
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  return GetContentParent()->SaveRecording(file, _retval);
-}
-
-/* Promise getContentBlockingLog (); */
-NS_IMETHODIMP
-BrowserHost::GetContentBlockingLog(::mozilla::dom::Promise** aPromise) {
-  if (!mRoot) {
-    *aPromise = nullptr;
-    return NS_OK;
-  }
-  NS_ENSURE_ARG_POINTER(aPromise);
-
-  *aPromise = nullptr;
-  if (!mRoot->GetOwnerElement()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  ErrorResult rv;
-  RefPtr<Promise> jsPromise = Promise::Create(
-      mRoot->GetOwnerElement()->OwnerDoc()->GetOwnerGlobal(), rv);
-  if (rv.Failed()) {
-    return NS_ERROR_FAILURE;
-  }
-
-  RefPtr<Promise> copy(jsPromise);
-  copy.forget(aPromise);
-
-  auto cblPromise = mRoot->SendGetContentBlockingLog();
-  cblPromise->Then(
-      GetMainThreadSerialEventTarget(), __func__,
-      [jsPromise](Tuple<nsCString, bool>&& aResult) {
-        if (Get<1>(aResult)) {
-          NS_ConvertUTF8toUTF16 utf16(Get<0>(aResult));
-          jsPromise->MaybeResolve(std::move(utf16));
-        } else {
-          jsPromise->MaybeRejectWithUndefined();
-        }
-      },
-      [jsPromise](ResponseRejectReason&& aReason) {
-        jsPromise->MaybeRejectWithUndefined();
-      });
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-BrowserHost::MaybeCancelContentJSExecutionFromScript(
-    nsIRemoteTab::NavigationType aNavigationType,
-    JS::Handle<JS::Value> aCancelContentJSOptions, JSContext* aCx) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  dom::CancelContentJSOptions cancelContentJSOptions;
-  if (!cancelContentJSOptions.Init(aCx, aCancelContentJSOptions)) {
-    return NS_ERROR_INVALID_ARG;
-  }
-  if (StaticPrefs::dom_ipc_cancel_content_js_when_navigating()) {
-    GetContentParent()->CancelContentJSExecutionIfRunning(
-        mRoot, aNavigationType, cancelContentJSOptions);
-  }
-  return NS_OK;
-}
-
-}  // namespace dom
-}  // namespace mozilla
deleted file mode 100644
--- a/dom/ipc/BrowserHost.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 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/. */
-
-#ifndef mozilla_dom_BrowserHost_h
-#define mozilla_dom_BrowserHost_h
-
-#include "nsIRemoteTab.h"
-#include "mozilla/dom/RemoteBrowser.h"
-#include "mozilla/dom/BrowserParent.h"
-
-class nsPIDOMWindowOuter;
-
-namespace mozilla {
-
-namespace a11y {
-class DocAccessibleParent;
-}  // namespace a11y
-
-namespace dom {
-
-class Element;
-
-/**
- * BrowserHost manages a remote browser from the chrome process.
- *
- * It is used via the RemoteBrowser interface in nsFrameLoader and supports
- * operations over the tree of BrowserParent/BrowserBridgeParent's.
- *
- * See `dom/docs/Fission-IPC-Diagram.svg` for an overview of the DOM IPC
- * actors.
- */
-class BrowserHost : public RemoteBrowser,
-                    public nsIRemoteTab,
-                    public nsSupportsWeakReference {
- public:
-  typedef mozilla::layers::LayersId LayersId;
-
-  explicit BrowserHost(BrowserParent* aParent);
-
-  static BrowserHost* GetFrom(nsIRemoteTab* aRemoteTab);
-
-  // NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  // nsIRemoteTab
-  NS_DECL_NSIREMOTETAB
-
-  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(BrowserHost, RemoteBrowser)
-
-  // Get the IPDL actor for the root BrowserParent. This method should be
-  // avoided and consumers migrated to use this class.
-  BrowserParent* GetActor() { return mRoot; }
-  ContentParent* GetContentParent() const { return mRoot->Manager(); }
-
-  BrowserHost* AsBrowserHost() override { return this; }
-  BrowserBridgeHost* AsBrowserBridgeHost() override { return nullptr; }
-
-  LayersId GetLayersId() const override;
-  BrowsingContext* GetBrowsingContext() const override;
-  nsILoadContext* GetLoadContext() const override;
-
-  Element* GetOwnerElement() const { return mRoot->GetOwnerElement(); }
-  already_AddRefed<nsPIDOMWindowOuter> GetParentWindowOuter() const {
-    return mRoot->GetParentWindowOuter();
-  }
-  a11y::DocAccessibleParent* GetTopLevelDocAccessible() const;
-
-  // Visit each BrowserParent in the tree formed by PBrowser and
-  // PBrowserBridge that is anchored by `mRoot`.
-  template <typename Callback>
-  void VisitAll(Callback aCallback) {
-    if (!mRoot) {
-      return;
-    }
-    mRoot->VisitAll(aCallback);
-  }
-
-  void LoadURL(nsIURI* aURI) override;
-  void ResumeLoad(uint64_t aPendingSwitchId) override;
-  void DestroyStart() override;
-  void DestroyComplete() override;
-
-  bool Show(const ScreenIntSize& aSize, bool aParentIsActive) override;
-  void UpdateDimensions(const nsIntRect& aRect,
-                        const ScreenIntSize& aSize) override;
-
- private:
-  virtual ~BrowserHost() = default;
-
-  // The TabID for the root BrowserParent, we cache this so that we can access
-  // it after the remote browser has been destroyed
-  TabId mId;
-  // The root BrowserParent of this remote browser
-  RefPtr<BrowserParent> mRoot;
-};
-
-}  // namespace dom
-}  // namespace mozilla
-
-#endif  // mozilla_dom_BrowserHost_h
--- a/dom/ipc/BrowserParent.cpp
+++ b/dom/ipc/BrowserParent.cpp
@@ -155,40 +155,41 @@ StaticAutoPtr<nsTArray<BrowserParent*>> 
 
 namespace mozilla {
 namespace dom {
 
 BrowserParent::LayerToBrowserParentTable*
     BrowserParent::sLayerToBrowserParentTable = nullptr;
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BrowserParent)
+  NS_INTERFACE_MAP_ENTRY(nsIRemoteTab)
   NS_INTERFACE_MAP_ENTRY(nsIAuthPromptProvider)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEventListener)
+  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIRemoteTab)
 NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTION(BrowserParent, mFrameElement, mBrowserDOMWindow,
                          mLoadContext, mFrameLoader, mBrowsingContext)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(BrowserParent)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(BrowserParent)
 
 BrowserParent::BrowserParent(ContentParent* aManager, const TabId& aTabId,
                              const TabContext& aContext,
                              CanonicalBrowsingContext* aBrowsingContext,
-                             uint32_t aChromeFlags)
+                             uint32_t aChromeFlags,
+                             BrowserBridgeParent* aBrowserBridgeParent)
     : TabContext(aContext),
       mTabId(aTabId),
       mManager(aManager),
       mBrowsingContext(aBrowsingContext),
       mLoadContext(nullptr),
       mFrameElement(nullptr),
       mBrowserDOMWindow(nullptr),
       mFrameLoader(nullptr),
       mChromeFlags(aChromeFlags),
-      mBrowserBridgeParent(nullptr),
-      mBrowserHost(nullptr),
+      mBrowserBridgeParent(aBrowserBridgeParent),
       mContentCache(*this),
       mRenderFrame{},
       mLayerTreeEpoch{1},
       mChildToParentConversionMatrix{},
       mRect(0, 0, 0, 0),
       mDimensions(0, 0),
       mOrientation(0),
       mDPI(0),
@@ -251,17 +252,23 @@ BrowserParent* BrowserParent::GetFocused
   return sFocusStack->LastElement();
 }
 
 /*static*/
 BrowserParent* BrowserParent::GetFrom(nsFrameLoader* aFrameLoader) {
   if (!aFrameLoader) {
     return nullptr;
   }
-  return aFrameLoader->GetBrowserParent();
+  PBrowserParent* remoteBrowser = aFrameLoader->GetRemoteBrowser();
+  return static_cast<BrowserParent*>(remoteBrowser);
+}
+
+/*static*/
+BrowserParent* BrowserParent::GetFrom(nsIRemoteTab* aBrowserParent) {
+  return static_cast<BrowserParent*>(aBrowserParent);
 }
 
 /*static*/
 BrowserParent* BrowserParent::GetFrom(PBrowserParent* aBrowserParent) {
   return static_cast<BrowserParent*>(aBrowserParent);
 }
 
 /*static*/
@@ -431,22 +438,16 @@ a11y::DocAccessibleParent* BrowserParent
 
 RenderFrame* BrowserParent::GetRenderFrame() {
   if (!mRenderFrame.IsInitialized()) {
     return nullptr;
   }
   return &mRenderFrame;
 }
 
-BrowserBridgeParent* BrowserParent::GetBrowserBridgeParent() const {
-  return mBrowserBridgeParent;
-}
-
-BrowserHost* BrowserParent::GetBrowserHost() const { return mBrowserHost; }
-
 ShowInfo BrowserParent::GetShowInfo() {
   TryCacheDPIAndScale();
   if (mFrameElement) {
     nsAutoString name;
     mFrameElement->GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
     bool allowFullscreen =
         mFrameElement->HasAttr(kNameSpaceID_None, nsGkAtoms::allowfullscreen) ||
         mFrameElement->HasAttr(kNameSpaceID_None,
@@ -473,25 +474,25 @@ void BrowserParent::SetOwnerElement(Elem
   RefPtr<nsPIWindowRoot> curTopLevelWin, newTopLevelWin;
   if (mFrameElement) {
     curTopLevelWin = nsContentUtils::GetWindowRoot(mFrameElement->OwnerDoc());
   }
   if (aElement) {
     newTopLevelWin = nsContentUtils::GetWindowRoot(aElement->OwnerDoc());
   }
   bool isSameTopLevelWin = curTopLevelWin == newTopLevelWin;
-  if (mBrowserHost && curTopLevelWin && !isSameTopLevelWin) {
-    curTopLevelWin->RemoveBrowser(mBrowserHost);
+  if (curTopLevelWin && !isSameTopLevelWin) {
+    curTopLevelWin->RemoveBrowser(this);
   }
 
   // Update to the new content, and register to listen for events from it.
   mFrameElement = aElement;
 
-  if (mBrowserHost && newTopLevelWin && !isSameTopLevelWin) {
-    newTopLevelWin->AddBrowser(mBrowserHost);
+  if (newTopLevelWin && !isSameTopLevelWin) {
+    newTopLevelWin->AddBrowser(this);
   }
 
   if (mFrameElement) {
     bool useGlobalHistory = !mFrameElement->HasAttr(
         kNameSpaceID_None, nsGkAtoms::disableglobalhistory);
     Unused << SendSetUseGlobalHistory(useGlobalHistory);
   }
 
@@ -540,16 +541,21 @@ void BrowserParent::SetOwnerElement(Elem
     mBrowsingContext->SetEmbedderElement(mFrameElement);
   }
 
   VisitChildren([aElement](BrowserBridgeParent* aBrowser) {
     aBrowser->GetBrowserParent()->SetOwnerElement(aElement);
   });
 }
 
+NS_IMETHODIMP BrowserParent::GetOwnerElement(Element** aElement) {
+  *aElement = do_AddRef(GetOwnerElement()).take();
+  return NS_OK;
+}
+
 void BrowserParent::CacheFrameLoader(nsFrameLoader* aFrameLoader) {
   mFrameLoader = aFrameLoader;
 }
 
 void BrowserParent::AddWindowListeners() {
   if (mFrameElement) {
     if (nsCOMPtr<nsPIDOMWindowOuter> window =
             mFrameElement->OwnerDoc()->GetWindow()) {
@@ -715,18 +721,19 @@ void BrowserParent::ActorDestroy(ActorDe
           EventDispatcher::DispatchDOMEvent(frameElement, nullptr, event,
                                             nullptr, nullptr);
         }
       }
     }
   }
 
   mFrameLoader = nullptr;
-  if (os && mBrowserHost) {
-    os->NotifyObservers(NS_ISUPPORTS_CAST(nsIRemoteTab*, mBrowserHost),
+
+  if (os) {
+    os->NotifyObservers(NS_ISUPPORTS_CAST(nsIRemoteTab*, this),
                         "ipc:browser-destroyed", nullptr);
   }
 }
 
 mozilla::ipc::IPCResult BrowserParent::RecvMoveFocus(
     const bool& aForward, const bool& aForDocumentNavigation) {
   LOGBROWSERFOCUS(("RecvMoveFocus %p, aForward: %d, aForDocumentNavigation: %d",
                    this, aForward, aForDocumentNavigation));
@@ -872,20 +879,19 @@ void BrowserParent::ResumeLoad(uint64_t 
   if (NS_WARN_IF(mIsDestroyed)) {
     return;
   }
 
   Unused << SendResumeLoad(aPendingSwitchID, GetShowInfo());
 }
 
 void BrowserParent::InitRendering() {
-  if (mRenderFrame.IsInitialized()) {
-    return;
-  }
+  MOZ_ASSERT(!mRenderFrame.IsInitialized());
   mRenderFrame.Initialize(this);
+  MOZ_ASSERT(mRenderFrame.IsInitialized());
 
   layers::LayersId layersId = mRenderFrame.GetLayersId();
   AddBrowserParentToTable(layersId, this);
 
   TextureFactoryIdentifier textureFactoryIdentifier;
   mRenderFrame.GetTextureFactoryIdentifier(&textureFactoryIdentifier);
   Unused << SendInitRendering(textureFactoryIdentifier, layersId,
                               mRenderFrame.GetCompositorOptions(),
@@ -895,35 +901,31 @@ void BrowserParent::InitRendering() {
 void BrowserParent::MaybeShowFrame() {
   RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
   if (!frameLoader) {
     return;
   }
   frameLoader->MaybeShowFrame();
 }
 
-bool BrowserParent::Show(const ScreenIntSize& size, bool aParentIsActive) {
+void BrowserParent::Show(const ScreenIntSize& size, bool aParentIsActive) {
   mDimensions = size;
   if (mIsDestroyed) {
-    return false;
+    return;
   }
 
   MOZ_ASSERT(mRenderFrame.IsInitialized());
-  if (!mRenderFrame.AttachLayerManager()) {
-    return false;
-  }
 
   nsCOMPtr<nsISupports> container = mFrameElement->OwnerDoc()->GetContainer();
   nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(container);
   nsCOMPtr<nsIWidget> mainWidget;
   baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
   mSizeMode = mainWidget ? mainWidget->SizeMode() : nsSizeMode_Normal;
 
   Unused << SendShow(size, GetShowInfo(), aParentIsActive, mSizeMode);
-  return true;
 }
 
 mozilla::ipc::IPCResult BrowserParent::RecvSetDimensions(const uint32_t& aFlags,
                                                          const int32_t& aX,
                                                          const int32_t& aY,
                                                          const int32_t& aCx,
                                                          const int32_t& aCy) {
   MOZ_ASSERT(!(aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER),
@@ -1044,16 +1046,31 @@ DimensionInfo BrowserParent::GetDimensio
 
 void BrowserParent::SizeModeChanged(const nsSizeMode& aSizeMode) {
   if (!mIsDestroyed && aSizeMode != mSizeMode) {
     mSizeMode = aSizeMode;
     Unused << SendSizeModeChanged(aSizeMode);
   }
 }
 
+void BrowserParent::UIResolutionChanged() {
+  if (!mIsDestroyed) {
+    // TryCacheDPIAndScale()'s cache is keyed off of
+    // mDPI being greater than 0, so this invalidates it.
+    mDPI = -1;
+    TryCacheDPIAndScale();
+    // If mDPI was set to -1 to invalidate it and then TryCacheDPIAndScale
+    // fails to cache the values, then mDefaultScale.scale might be invalid.
+    // We don't want to send that value to content. Just send -1 for it too in
+    // that case.
+    Unused << SendUIResolutionChanged(mDPI, mRounding,
+                                      mDPI < 0 ? -1.0 : mDefaultScale.scale);
+  }
+}
+
 void BrowserParent::ThemeChanged() {
   if (!mIsDestroyed) {
     // The theme has changed, and any cached values we had sent down
     // to the child have been invalidated. When this method is called,
     // LookAndFeel should have the up-to-date values, which we now
     // send down to the child. We do this for every remote tab for now,
     // but bug 1156934 has been filed to do it once per content process.
     Unused << SendThemeChanged(LookAndFeel::GetIntCache());
@@ -2958,19 +2975,19 @@ mozilla::ipc::IPCResult BrowserParent::R
 mozilla::ipc::IPCResult BrowserParent::RecvRespondStartSwipeEvent(
     const uint64_t& aInputBlockId, const bool& aStartSwipe) {
   if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
     widget->ReportSwipeStarted(aInputBlockId, aStartSwipe);
   }
   return IPC_OK();
 }
 
-bool BrowserParent::GetDocShellIsActive() { return mDocShellIsActive; }
-
-void BrowserParent::SetDocShellIsActive(bool isActive) {
+// defined in nsIRemoteTab
+NS_IMETHODIMP
+BrowserParent::SetDocShellIsActive(bool isActive) {
   mDocShellIsActive = isActive;
   SetRenderLayers(isActive);
   Unused << SendSetDocShellIsActive(isActive);
 
   // update active accessible documents on windows
 #if defined(XP_WIN) && defined(ACCESSIBILITY)
   if (a11y::Compatibility::IsDolphin()) {
     if (a11y::DocAccessibleParent* tabDoc = GetTopLevelDocAccessible()) {
@@ -2986,25 +3003,28 @@ void BrowserParent::SetDocShellIsActive(
     }
   }
 #endif
 
   // Keep track of how many active recording/replaying tabs there are.
   if (Manager()->IsRecordingOrReplaying()) {
     SetIsActiveRecordReplayTab(isActive);
   }
+
+  return NS_OK;
 }
 
-bool BrowserParent::GetHasPresented() { return mHasPresented; }
-
-bool BrowserParent::GetHasLayers() { return mHasLayers; }
-
-bool BrowserParent::GetRenderLayers() { return mRenderLayers; }
-
-void BrowserParent::SetRenderLayers(bool aEnabled) {
+NS_IMETHODIMP
+BrowserParent::GetDocShellIsActive(bool* aIsActive) {
+  *aIsActive = mDocShellIsActive;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+BrowserParent::SetRenderLayers(bool aEnabled) {
   if (mActiveInPriorityManager != aEnabled) {
     mActiveInPriorityManager = aEnabled;
     // Let's inform the priority manager. This operation can end up with the
     // changing of the process priority.
     ProcessPriorityManager::TabActivityChanged(this, aEnabled);
   }
 
   if (aEnabled == mRenderLayers) {
@@ -3017,28 +3037,64 @@ void BrowserParent::SetRenderLayers(bool
       LayersObserverEpoch epoch = mLayerTreeEpoch;
       NS_DispatchToMainThread(NS_NewRunnableFunction(
           "dom::BrowserParent::RenderLayers", [self, epoch]() {
             MOZ_ASSERT(NS_IsMainThread());
             self->LayerTreeUpdate(epoch, true);
           }));
     }
 
-    return;
+    return NS_OK;
   }
 
   // Preserve layers means that attempts to stop rendering layers
   // will be ignored.
   if (!aEnabled && mPreserveLayers) {
-    return;
+    return NS_OK;
   }
 
   mRenderLayers = aEnabled;
 
   SetRenderLayersInternal(aEnabled, false /* aForceRepaint */);
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+BrowserParent::GetRenderLayers(bool* aResult) {
+  *aResult = mRenderLayers;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+BrowserParent::GetHasLayers(bool* aResult) {
+  *aResult = mHasLayers;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+BrowserParent::Deprioritize() {
+  if (mActiveInPriorityManager) {
+    ProcessPriorityManager::TabActivityChanged(this, false);
+    mActiveInPriorityManager = false;
+  }
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+BrowserParent::ForceRepaint() {
+  if (!mActiveInPriorityManager) {
+    // If a tab is left and then returned to very rapidly, it can be
+    // deprioritized without losing its loaded status. In this case we won't
+    // go through SetRenderLayers.
+    mActiveInPriorityManager = true;
+    ProcessPriorityManager::TabActivityChanged(this, true);
+  }
+
+  SetRenderLayersInternal(true /* aEnabled */, true /* aForceRepaint */);
+  return NS_OK;
 }
 
 void BrowserParent::SetRenderLayersInternal(bool aEnabled, bool aForceRepaint) {
   // Increment the epoch so that layer tree updates from previous
   // RenderLayers requests are ignored.
   mLayerTreeEpoch = mLayerTreeEpoch.Next();
 
   Unused << SendRenderLayers(aEnabled, aForceRepaint, mLayerTreeEpoch);
@@ -3046,108 +3102,82 @@ void BrowserParent::SetRenderLayersInter
   // Ask the child to repaint using the PHangMonitor channel/thread (which may
   // be less congested).
   if (aEnabled) {
     Manager()->PaintTabWhileInterruptingJS(this, aForceRepaint,
                                            mLayerTreeEpoch);
   }
 }
 
-void BrowserParent::PreserveLayers(bool aPreserveLayers) {
+NS_IMETHODIMP
+BrowserParent::PreserveLayers(bool aPreserveLayers) {
   mPreserveLayers = aPreserveLayers;
-}
-
-void BrowserParent::ForceRepaint() {
-  if (!mActiveInPriorityManager) {
-    // If a tab is left and then returned to very rapidly, it can be
-    // deprioritized without losing its loaded status. In this case we won't
-    // go through SetRenderLayers.
-    mActiveInPriorityManager = true;
-    ProcessPriorityManager::TabActivityChanged(this, true);
-  }
-
-  SetRenderLayersInternal(true /* aEnabled */, true /* aForceRepaint */);
+  return NS_OK;
 }
 
-void BrowserParent::NotifyResolutionChanged() {
-  if (!mIsDestroyed) {
-    // TryCacheDPIAndScale()'s cache is keyed off of
-    // mDPI being greater than 0, so this invalidates it.
-    mDPI = -1;
-    TryCacheDPIAndScale();
-    // If mDPI was set to -1 to invalidate it and then TryCacheDPIAndScale
-    // fails to cache the values, then mDefaultScale.scale might be invalid.
-    // We don't want to send that value to content. Just send -1 for it too in
-    // that case.
-    Unused << SendUIResolutionChanged(mDPI, mRounding,
-                                      mDPI < 0 ? -1.0 : mDefaultScale.scale);
-  }
-}
-
-void BrowserParent::Deprioritize() {
-  if (mActiveInPriorityManager) {
-    ProcessPriorityManager::TabActivityChanged(this, false);
-    mActiveInPriorityManager = false;
-  }
-}
-
-bool BrowserParent::GetHasContentOpener() { return mHasContentOpener; }
-
-void BrowserParent::SetHasContentOpener(bool aHasContentOpener) {
-  mHasContentOpener = aHasContentOpener;
+NS_IMETHODIMP
+BrowserParent::SaveRecording(const nsAString& aFilename, bool* aRetval) {
+  nsCOMPtr<nsIFile> file;
+  nsresult rv = NS_NewLocalFile(aFilename, false, getter_AddRefs(file));
+  if (NS_FAILED(rv)) {
+    return rv;
+  }
+  return Manager()->SaveRecording(file, aRetval);
 }
 
-bool BrowserParent::GetHasBeforeUnload() { return mHasBeforeUnload; }
-
-bool BrowserParent::StartApzAutoscroll(float aAnchorX, float aAnchorY,
-                                       nsViewID aScrollId,
-                                       uint32_t aPresShellId) {
-  if (!AsyncPanZoomEnabled()) {
-    return false;
-  }
-
-  bool success = false;
-  if (mRenderFrame.IsInitialized()) {
-    layers::LayersId layersId = mRenderFrame.GetLayersId();
-    if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
-      SLGuidAndRenderRoot guid(layersId, aPresShellId, aScrollId,
-                               gfxUtils::GetContentRenderRoot());
-
-      // The anchor coordinates that are passed in are relative to the origin
-      // of the screen, but we are sending them to APZ which only knows about
-      // coordinates relative to the widget, so convert them accordingly.
-      CSSPoint anchorCss{aAnchorX, aAnchorY};
-      LayoutDeviceIntPoint anchor =
-          RoundedToInt(anchorCss * widget->GetDefaultScale());
-      anchor -= widget->WidgetToScreenOffset();
-
-      success = widget->StartAsyncAutoscroll(
-          ViewAs<ScreenPixel>(
-              anchor, PixelCastJustification::LayoutDeviceIsScreenForBounds),
-          guid);
-    }
-  }
-  return success;
+NS_IMETHODIMP
+BrowserParent::GetContentBlockingLog(Promise** aPromise) {
+  NS_ENSURE_ARG_POINTER(aPromise);
+
+  *aPromise = nullptr;
+  if (!mFrameElement) {
+    return NS_ERROR_FAILURE;
+  }
+
+  ErrorResult rv;
+  RefPtr<Promise> jsPromise =
+      Promise::Create(mFrameElement->OwnerDoc()->GetOwnerGlobal(), rv);
+  if (rv.Failed()) {
+    return NS_ERROR_FAILURE;
+  }
+
+  RefPtr<Promise> copy(jsPromise);
+  copy.forget(aPromise);
+
+  auto cblPromise = SendGetContentBlockingLog();
+  cblPromise->Then(
+      GetMainThreadSerialEventTarget(), __func__,
+      [jsPromise](Tuple<nsCString, bool>&& aResult) {
+        if (Get<1>(aResult)) {
+          NS_ConvertUTF8toUTF16 utf16(Get<0>(aResult));
+          jsPromise->MaybeResolve(std::move(utf16));
+        } else {
+          jsPromise->MaybeRejectWithUndefined();
+        }
+      },
+      [jsPromise](ResponseRejectReason&& aReason) {
+        jsPromise->MaybeRejectWithUndefined();
+      });
+
+  return NS_OK;
 }
 
-void BrowserParent::StopApzAutoscroll(nsViewID aScrollId,
-                                      uint32_t aPresShellId) {
-  if (!AsyncPanZoomEnabled()) {
-    return;
-  }
-
-  if (mRenderFrame.IsInitialized()) {
-    layers::LayersId layersId = mRenderFrame.GetLayersId();
-    if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
-      SLGuidAndRenderRoot guid(layersId, aPresShellId, aScrollId,
-                               gfxUtils::GetContentRenderRoot());
-
-      widget->StopAsyncAutoscroll(guid);
-    }
-  }
+NS_IMETHODIMP
+BrowserParent::MaybeCancelContentJSExecutionFromScript(
+    nsIRemoteTab::NavigationType aNavigationType,
+    JS::Handle<JS::Value> aCancelContentJSOptions, JSContext* aCx) {
+  dom::CancelContentJSOptions cancelContentJSOptions;
+  if (!cancelContentJSOptions.Init(aCx, aCancelContentJSOptions)) {
+    return NS_ERROR_INVALID_ARG;
+  }
+  if (StaticPrefs::dom_ipc_cancel_content_js_when_navigating()) {
+    Manager()->CancelContentJSExecutionIfRunning(this, aNavigationType,
+                                                 cancelContentJSOptions);
+  }
+  return NS_OK;
 }
 
 void BrowserParent::SuppressDisplayport(bool aEnabled) {
   if (IsDestroyed()) {
     return;
   }
 
 #ifdef DEBUG
@@ -3157,20 +3187,74 @@ void BrowserParent::SuppressDisplayport(
     mActiveSupressDisplayportCount--;
   }
   MOZ_ASSERT(mActiveSupressDisplayportCount >= 0);
 #endif
 
   Unused << SendSuppressDisplayport(aEnabled);
 }
 
+NS_IMETHODIMP
+BrowserParent::GetTabId(uint64_t* aId) {
+  *aId = GetTabId();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+BrowserParent::GetOsPid(int32_t* aId) {
+  *aId = Manager()->Pid();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+BrowserParent::GetHasContentOpener(bool* aResult) {
+  *aResult = mHasContentOpener;
+  return NS_OK;
+}
+
+void BrowserParent::SetHasContentOpener(bool aHasContentOpener) {
+  mHasContentOpener = aHasContentOpener;
+}
+
+NS_IMETHODIMP
+BrowserParent::GetHasPresented(bool* aResult) {
+  *aResult = mHasPresented;
+  return NS_OK;
+}
+
 void BrowserParent::NavigateByKey(bool aForward, bool aForDocumentNavigation) {
   Unused << SendNavigateByKey(aForward, aForDocumentNavigation);
 }
 
+NS_IMETHODIMP
+BrowserParent::GetWindowGlobalParents(
+    nsTArray<RefPtr<WindowGlobalParent>>& aWindowGlobalParents) {
+  VisitAll([&aWindowGlobalParents](BrowserParent* aBrowser) {
+    const auto& windowGlobalParents = aBrowser->ManagedPWindowGlobalParent();
+    for (auto iter = windowGlobalParents.ConstIter(); !iter.Done();
+         iter.Next()) {
+      WindowGlobalParent* windowGlobalParent =
+          static_cast<WindowGlobalParent*>(iter.Get()->GetKey());
+      aWindowGlobalParents.AppendElement(windowGlobalParent);
+    }
+  });
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+BrowserParent::TransmitPermissionsForPrincipal(nsIPrincipal* aPrincipal) {
+  return Manager()->TransmitPermissionsForPrincipal(aPrincipal);
+}
+
+NS_IMETHODIMP
+BrowserParent::GetHasBeforeUnload(bool* aResult) {
+  *aResult = mHasBeforeUnload;
+  return NS_OK;
+}
+
 void BrowserParent::LayerTreeUpdate(const LayersObserverEpoch& aEpoch,
                                     bool aActive) {
   // Ignore updates from old epochs. They might tell us that layers are
   // available when we've already sent a message to clear them. We can't trust
   // the update in that case since layers could disappear anytime after that.
   if (aEpoch != mLayerTreeEpoch || mIsDestroyed) {
     return;
   }
@@ -3578,16 +3662,68 @@ void BrowserParent::StartPersistence(
   bool ok = Manager()->SendPWebBrowserPersistDocumentConstructor(
       actor, this, aOuterWindowID);
   if (!ok) {
     aRv.Throw(NS_ERROR_FAILURE);
   }
   // (The actor will be destroyed on constructor failure.)
 }
 
+NS_IMETHODIMP
+BrowserParent::StartApzAutoscroll(float aAnchorX, float aAnchorY,
+                                  nsViewID aScrollId, uint32_t aPresShellId,
+                                  bool* aOutRetval) {
+  if (!AsyncPanZoomEnabled()) {
+    *aOutRetval = false;
+    return NS_OK;
+  }
+
+  bool success = false;
+  if (mRenderFrame.IsInitialized()) {
+    layers::LayersId layersId = mRenderFrame.GetLayersId();
+    if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
+      SLGuidAndRenderRoot guid(layersId, aPresShellId, aScrollId,
+                               gfxUtils::GetContentRenderRoot());
+
+      // The anchor coordinates that are passed in are relative to the origin
+      // of the screen, but we are sending them to APZ which only knows about
+      // coordinates relative to the widget, so convert them accordingly.
+      CSSPoint anchorCss{aAnchorX, aAnchorY};
+      LayoutDeviceIntPoint anchor =
+          RoundedToInt(anchorCss * widget->GetDefaultScale());
+      anchor -= widget->WidgetToScreenOffset();
+
+      success = widget->StartAsyncAutoscroll(
+          ViewAs<ScreenPixel>(
+              anchor, PixelCastJustification::LayoutDeviceIsScreenForBounds),
+          guid);
+    }
+  }
+  *aOutRetval = success;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+BrowserParent::StopApzAutoscroll(nsViewID aScrollId, uint32_t aPresShellId) {
+  if (!AsyncPanZoomEnabled()) {
+    return NS_OK;
+  }
+
+  if (mRenderFrame.IsInitialized()) {
+    layers::LayersId layersId = mRenderFrame.GetLayersId();
+    if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
+      SLGuidAndRenderRoot guid(layersId, aPresShellId, aScrollId,
+                               gfxUtils::GetContentRenderRoot());
+
+      widget->StopAsyncAutoscroll(guid);
+    }
+  }
+  return NS_OK;
+}
+
 void BrowserParent::SkipBrowsingContextDetach() {
   RefPtr<nsFrameLoader> fl = GetFrameLoader();
   MOZ_ASSERT(fl);
   fl->SkipBrowsingContextDetach();
 }
 
 mozilla::ipc::IPCResult BrowserParent::RecvLookUpDictionary(
     const nsString& aText, nsTArray<FontRange>&& aFontRangeArray,
@@ -3674,34 +3810,16 @@ mozilla::ipc::IPCResult BrowserParent::R
   return IPC_FAIL(this, "QueryVisitedState is Android-only");
 #endif
 }
 
 void BrowserParent::LiveResizeStarted() { SuppressDisplayport(true); }
 
 void BrowserParent::LiveResizeStopped() { SuppressDisplayport(false); }
 
-void BrowserParent::SetBrowserBridgeParent(BrowserBridgeParent* aBrowser) {
-  // We should not have either a browser bridge or browser host yet
-  MOZ_ASSERT(!mBrowserBridgeParent);
-  MOZ_ASSERT(!mBrowserHost);
-  // We should not have owner content yet
-  MOZ_ASSERT(!mFrameElement);
-  mBrowserBridgeParent = aBrowser;
-}
-
-void BrowserParent::SetBrowserHost(BrowserHost* aBrowser) {
-  // We should not have either a browser bridge or browser host yet
-  MOZ_ASSERT(!mBrowserBridgeParent);
-  MOZ_ASSERT(!mBrowserHost);
-  // We should not have owner content yet
-  MOZ_ASSERT(!mFrameElement);
-  mBrowserHost = aBrowser;
-}
-
 /* static */
 size_t BrowserParent::gNumActiveRecordReplayTabs;
 
 void BrowserParent::SetIsActiveRecordReplayTab(bool aIsActive) {
   if (aIsActive != mIsActiveRecordReplayTab) {
     gNumActiveRecordReplayTabs += aIsActive ? 1 : -1;
     mIsActiveRecordReplayTab = aIsActive;
   }
--- a/dom/ipc/BrowserParent.h
+++ b/dom/ipc/BrowserParent.h
@@ -68,67 +68,72 @@ class DataSourceSurface;
 
 namespace dom {
 
 class CanonicalBrowsingContext;
 class ClonedMessageData;
 class ContentParent;
 class Element;
 class DataTransfer;
-class BrowserHost;
-class BrowserBridgeParent;
 
 namespace ipc {
 class StructuredCloneData;
 }  // namespace ipc
 
 /**
  * BrowserParent implements the parent actor part of the PBrowser protocol. See
  * PBrowser for more information.
  */
 class BrowserParent final : public PBrowserParent,
                             public nsIDOMEventListener,
+                            public nsIRemoteTab,
                             public nsIAuthPromptProvider,
                             public nsIKeyEventInPluginCallback,
                             public nsSupportsWeakReference,
                             public TabContext,
                             public LiveResizeListener {
   typedef mozilla::dom::ClonedMessageData ClonedMessageData;
 
   friend class PBrowserParent;
+  friend class BrowserBridgeParent;  // for clearing mBrowserBridgeParent
 
   virtual ~BrowserParent();
 
  public:
   // Helper class for ContentParent::RecvCreateWindow.
   struct AutoUseNewTab;
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIAUTHPROMPTPROVIDER
+  // nsIRemoteTab
+  NS_DECL_NSIREMOTETAB
   // nsIDOMEventListener interfaces
   NS_DECL_NSIDOMEVENTLISTENER
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(BrowserParent, nsIDOMEventListener)
+  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(BrowserParent, nsIRemoteTab)
 
   BrowserParent(ContentParent* aManager, const TabId& aTabId,
                 const TabContext& aContext,
                 CanonicalBrowsingContext* aBrowsingContext,
-                uint32_t aChromeFlags);
+                uint32_t aChromeFlags,
+                BrowserBridgeParent* aBrowserBridgeParent = nullptr);
 
   // Call from LayoutStatics only
   static void InitializeStatics();
 
   /**
    * Returns the focused BrowserParent or nullptr if chrome or another app
    * is focused.
    */
   static BrowserParent* GetFocused();
 
   static BrowserParent* GetFrom(nsFrameLoader* aFrameLoader);
 
+  static BrowserParent* GetFrom(nsIRemoteTab* aBrowserParent);
+
   static BrowserParent* GetFrom(PBrowserParent* aBrowserParent);
 
   static BrowserParent* GetFrom(nsIContent* aContent);
 
   static BrowserParent* GetBrowserParentFromLayersId(
       layers::LayersId aLayersId);
 
   static TabId GetTabIdFrom(nsIDocShell* docshell);
@@ -144,16 +149,22 @@ class BrowserParent final : public PBrow
   CanonicalBrowsingContext* GetBrowsingContext() { return mBrowsingContext; }
 
   already_AddRefed<nsILoadContext> GetLoadContext();
 
   Element* GetOwnerElement() const { return mFrameElement; }
 
   nsIBrowserDOMWindow* GetBrowserDOMWindow() const { return mBrowserDOMWindow; }
 
+  // Returns the BrowserBridgeParent if this BrowserParent is for an
+  // out-of-process iframe and nullptr otherwise.
+  BrowserBridgeParent* GetBrowserBridgeParent() const {
+    return mBrowserBridgeParent;
+  }
+
   already_AddRefed<nsPIDOMWindowOuter> GetParentWindowOuter();
 
   already_AddRefed<nsIWidget> GetTopLevelWidget();
 
   // Returns the closest widget for our frameloader's content.
   already_AddRefed<nsIWidget> GetWidget() const;
 
   // Returns the top-level widget for our frameloader's document.
@@ -163,24 +174,16 @@ class BrowserParent final : public PBrow
 
   /**
    * Return the top level doc accessible parent for this tab.
    */
   a11y::DocAccessibleParent* GetTopLevelDocAccessible() const;
 
   layout::RenderFrame* GetRenderFrame();
 
-  // Returns the BrowserBridgeParent if this BrowserParent is for an
-  // out-of-process iframe and nullptr otherwise.
-  BrowserBridgeParent* GetBrowserBridgeParent() const;
-
-  // Returns the BrowserHost if this BrowserParent is for a top-level browser
-  // and nullptr otherwise.
-  BrowserHost* GetBrowserHost() const;
-
   ShowInfo GetShowInfo();
 
   /**
    * Let managees query if Destroy() is already called so they don't send out
    * messages when the PBrowser actor is being destroyed.
    */
   bool IsDestroyed() const { return mIsDestroyed; }
 
@@ -455,26 +458,31 @@ class BrowserParent final : public PBrow
 
   void LoadURL(nsIURI* aURI);
 
   void ResumeLoad(uint64_t aPendingSwitchID);
 
   void InitRendering();
   void MaybeShowFrame();
 
-  bool Show(const ScreenIntSize& aSize, bool aParentIsActive);
+  // XXX/cjones: it's not clear what we gain by hiding these
+  // message-sending functions under a layer of indirection and
+  // eating the return values
+  void Show(const ScreenIntSize& aSize, bool aParentIsActive);
 
   void UpdateDimensions(const nsIntRect& aRect, const ScreenIntSize& aSize);
 
   DimensionInfo GetDimensionInfo();
 
   nsresult UpdatePosition();
 
   void SizeModeChanged(const nsSizeMode& aSizeMode);
 
+  void UIResolutionChanged();
+
   void ThemeChanged();
 
   void HandleAccessKey(const WidgetKeyboardEvent& aEvent,
                        nsTArray<uint32_t>& aCharCodes);
 
   void Activate();
 
   void Deactivate();
@@ -668,43 +676,17 @@ class BrowserParent final : public PBrow
 
   void SetReadyToHandleInputEvents() { mIsReadyToHandleInputEvents = true; }
   bool IsReadyToHandleInputEvents() { return mIsReadyToHandleInputEvents; }
 
   void NavigateByKey(bool aForward, bool aForDocumentNavigation);
 
   void SkipBrowsingContextDetach();
 
-  bool GetDocShellIsActive();
-  void SetDocShellIsActive(bool aDocShellIsActive);
-
-  bool GetHasPresented();
-  bool GetHasLayers();
-  bool GetRenderLayers();
-  void SetRenderLayers(bool aRenderLayers);
-  void PreserveLayers(bool aPreserveLayers);
-  void ForceRepaint();
-  void NotifyResolutionChanged();
-
-  void Deprioritize();
-
-  bool GetHasContentOpener();
-  bool GetHasBeforeUnload();
-
-  bool StartApzAutoscroll(float aAnchorX, float aAnchorY, nsViewID aScrollId,
-                          uint32_t aPresShellId);
-  void StopApzAutoscroll(nsViewID aScrollId, uint32_t aPresShellId);
-
  protected:
-  friend BrowserBridgeParent;
-  friend BrowserHost;
-
-  void SetBrowserBridgeParent(BrowserBridgeParent* aBrowser);
-  void SetBrowserHost(BrowserHost* aBrowser);
-
   bool ReceiveMessage(
       const nsString& aMessage, bool aSync, ipc::StructuredCloneData* aData,
       mozilla::jsipc::CpowHolder* aCpows, nsIPrincipal* aPrincipal,
       nsTArray<ipc::StructuredCloneData>* aJSONRetVal = nullptr);
 
   mozilla::ipc::IPCResult RecvAsyncAuthPrompt(const nsCString& aUri,
                                               const nsString& aRealm,
                                               const uint64_t& aCallbackId);
@@ -805,20 +787,16 @@ class BrowserParent final : public PBrow
   RefPtr<nsFrameLoader> mFrameLoader;
   uint32_t mChromeFlags;
 
   // Pointer back to BrowserBridgeParent if there is one associated with
   // this BrowserParent. This is non-owning to avoid cycles and is managed
   // by the BrowserBridgeParent instance, which has the strong reference
   // to this BrowserParent.
   BrowserBridgeParent* mBrowserBridgeParent;
-  // Pointer to the BrowserHost that owns us, if any. This is mutually
-  // exclusive with mBrowserBridgeParent, and one is guaranteed to be
-  // non-null.
-  BrowserHost* mBrowserHost;
 
   ContentCacheInParent mContentCache;
 
   layout::RenderFrame mRenderFrame;
   LayersObserverEpoch mLayerTreeEpoch;
 
   Maybe<LayoutDeviceToLayoutDeviceMatrix4x4> mChildToParentConversionMatrix;
 
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -25,17 +25,16 @@
 #include "mozilla/Unused.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/TelemetryIPC.h"
 #include "mozilla/VideoDecoderManagerChild.h"
 #include "mozilla/devtools/HeapSnapshotTempFileHelperChild.h"
 #include "mozilla/docshell/OfflineCacheUpdateChild.h"
 #include "mozilla/dom/BrowsingContext.h"
 #include "mozilla/dom/BrowsingContextGroup.h"
-#include "mozilla/dom/BrowserBridgeHost.h"
 #include "mozilla/dom/ClientManager.h"
 #include "mozilla/dom/ClientOpenWindowOpActors.h"
 #include "mozilla/dom/ChildProcessMessageManager.h"
 #include "mozilla/dom/ContentProcessMessageManager.h"
 #include "mozilla/dom/DOMPrefs.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/DataTransfer.h"
 #include "mozilla/dom/DocGroup.h"
@@ -127,17 +126,16 @@
 #  endif
 #endif
 
 #include "mozilla/Unused.h"
 
 #include "mozInlineSpellChecker.h"
 #include "nsDocShell.h"
 #include "nsDocShellLoadState.h"
-#include "nsIDocShellTreeOwner.h"
 #include "nsIConsoleListener.h"
 #include "nsIContentViewer.h"
 #include "nsICycleCollectorListener.h"
 #include "nsIIdlePeriod.h"
 #include "nsIDragService.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIMemoryReporter.h"
 #include "nsIMemoryInfoDumper.h"
@@ -240,17 +238,16 @@
 
 #include "ClearOnShutdown.h"
 #include "ProcessUtils.h"
 #include "URIUtils.h"
 #include "nsContentUtils.h"
 #include "nsIPrincipal.h"
 #include "DomainPolicy.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
-#include "mozilla/dom/TabContext.h"
 #include "mozilla/ipc/CrashReporterClient.h"
 #include "mozilla/net/NeckoMessageUtils.h"
 #include "mozilla/widget/PuppetBidiKeyboard.h"
 #include "mozilla/RemoteSpellCheckEngineChild.h"
 #include "GMPServiceChild.h"
 #include "GfxInfoBase.h"
 #include "gfxPlatform.h"
 #include "gfxPlatformFontList.h"
@@ -2003,68 +2000,16 @@ mozilla::ipc::IPCResult ContentChild::Re
 
 void ContentChild::UpdateCookieStatus(nsIChannel* aChannel) {
   RefPtr<CookieServiceChild> csChild = CookieServiceChild::GetSingleton();
   NS_ASSERTION(csChild, "Couldn't get CookieServiceChild");
 
   csChild->TrackCookieLoad(aChannel);
 }
 
-already_AddRefed<RemoteBrowser> ContentChild::CreateBrowser(
-    nsFrameLoader* aFrameLoader, const TabContext& aContext,
-    const nsString& aRemoteType, BrowsingContext* aBrowsingContext) {
-  MOZ_ASSERT(XRE_IsContentProcess());
-
-  // Determine our embedder's BrowserChild actor.
-  RefPtr<Element> owner = aFrameLoader->GetOwnerContent();
-  MOZ_DIAGNOSTIC_ASSERT(owner);
-
-  nsCOMPtr<nsIDocShell> docShell = do_GetInterface(owner->GetOwnerGlobal());
-  MOZ_DIAGNOSTIC_ASSERT(docShell);
-
-  RefPtr<BrowserChild> browserChild = BrowserChild::GetFrom(docShell);
-  MOZ_DIAGNOSTIC_ASSERT(browserChild);
-
-  uint32_t chromeFlags = 0;
-
-  nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
-  if (docShell) {
-    docShell->GetTreeOwner(getter_AddRefs(treeOwner));
-  }
-  if (treeOwner) {
-    nsCOMPtr<nsIWebBrowserChrome> wbc = do_GetInterface(treeOwner);
-    if (wbc) {
-      wbc->GetChromeFlags(&chromeFlags);
-    }
-  }
-
-  // Checking that this actually does something useful is
-  // https://bugzilla.mozilla.org/show_bug.cgi?id=1542710
-  nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(docShell);
-  if (loadContext && loadContext->UsePrivateBrowsing()) {
-    chromeFlags |= nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW;
-  }
-  if (docShell->GetAffectPrivateSessionLifetime()) {
-    chromeFlags |= nsIWebBrowserChrome::CHROME_PRIVATE_LIFETIME;
-  }
-
-  RefPtr<BrowserBridgeChild> browserBridge =
-      new BrowserBridgeChild(aFrameLoader, aBrowsingContext);
-  // Reference is freed in BrowserChild::DeallocPBrowserBridgeChild.
-  browserChild->SendPBrowserBridgeConstructor(
-      do_AddRef(browserBridge).take(),
-      PromiseFlatString(aContext.PresentationURL()), aRemoteType,
-      aBrowsingContext, chromeFlags);
-  browserBridge->mIPCOpen = true;
-
-  RefPtr<BrowserBridgeHost> browserBridgeHost =
-      new BrowserBridgeHost(browserBridge);
-  return browserBridgeHost.forget();
-}
-
 PScriptCacheChild* ContentChild::AllocPScriptCacheChild(
     const FileDescOrError& cacheFile, const bool& wantCacheData) {
   return new loader::ScriptCacheChild();
 }
 
 bool ContentChild::DeallocPScriptCacheChild(PScriptCacheChild* cache) {
   delete static_cast<loader::ScriptCacheChild*>(cache);
   return true;
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -5,20 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_ContentChild_h
 #define mozilla_dom_ContentChild_h
 
 #include "base/shared_memory.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/Attributes.h"
-#include "mozilla/dom/BrowserBridgeChild.h"
 #include "mozilla/dom/PBrowserOrId.h"
 #include "mozilla/dom/PContentChild.h"
-#include "mozilla/dom/RemoteBrowser.h"
 #include "mozilla/dom/CPOWManagerGetter.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/ipc/Shmem.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
 #include "nsAutoPtr.h"
 #include "nsHashKeys.h"
 #include "nsIObserver.h"
 #include "nsTHashtable.h"
@@ -35,17 +33,16 @@
 struct ChromePackage;
 class nsIObserver;
 struct SubstitutionMapping;
 struct OverrideMapping;
 class nsIDomainPolicy;
 class nsIURIClassifierCallback;
 struct LookAndFeelInt;
 class nsDocShellLoadState;
-class nsFrameLoader;
 
 namespace mozilla {
 class RemoteSpellcheckEngineChild;
 class ChildProfilerController;
 
 using mozilla::loader::PScriptCacheChild;
 
 #if !defined(XP_WIN)
@@ -75,17 +72,16 @@ namespace ipc {
 class SharedMap;
 }
 
 class AlertObserver;
 class ConsoleListener;
 class ClonedMessageData;
 class BrowserChild;
 class GetFilesHelperChild;
-class TabContext;
 
 class ContentChild final : public PContentChild,
                            public nsIWindowProvider,
                            public CPOWManagerGetter,
                            public mozilla::ipc::IShmemAllocator {
   typedef mozilla::dom::ClonedMessageData ClonedMessageData;
   typedef mozilla::ipc::FileDescriptor FileDescriptor;
   typedef mozilla::ipc::PFileDescriptorSetChild PFileDescriptorSetChild;
@@ -158,20 +154,16 @@ class ContentChild final : public PConte
   bool IsShuttingDown() const;
 
   ipc::SharedMap* SharedData() { return mSharedData; };
 
   static void AppendProcessId(nsACString& aName);
 
   static void UpdateCookieStatus(nsIChannel* aChannel);
 
-  static already_AddRefed<RemoteBrowser> CreateBrowser(
-      nsFrameLoader* aFrameLoader, const TabContext& aContext,
-      const nsString& aRemoteType, BrowsingContext* aBrowsingContext);
-
   mozilla::ipc::IPCResult RecvInitGMPService(
       Endpoint<PGMPServiceChild>&& aGMPService);
 
   mozilla::ipc::IPCResult RecvInitProfiler(
       Endpoint<PProfilerChild>&& aEndpoint);
 
   mozilla::ipc::IPCResult RecvGMPsChanged(
       nsTArray<GMPCapabilityData>&& capabilities);
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -1078,41 +1078,42 @@ mozilla::ipc::IPCResult ContentParent::R
       *aRv = NS_ERROR_NOT_AVAILABLE;
     }
   }
 
   return IPC_OK();
 }
 
 /*static*/
-already_AddRefed<RemoteBrowser> ContentParent::CreateBrowser(
-    const TabContext& aContext, Element* aFrameElement,
-    BrowsingContext* aBrowsingContext, ContentParent* aOpenerContentParent,
-    BrowserParent* aSameTabGroupAs, uint64_t aNextRemoteTabId) {
+BrowserParent* ContentParent::CreateBrowser(const TabContext& aContext,
+                                            Element* aFrameElement,
+                                            BrowsingContext* aBrowsingContext,
+                                            ContentParent* aOpenerContentParent,
+                                            BrowserParent* aSameTabGroupAs,
+                                            uint64_t aNextRemoteTabId) {
   AUTO_PROFILER_LABEL("ContentParent::CreateBrowser", OTHER);
 
   if (!sCanLaunchSubprocesses) {
     return nullptr;
   }
 
   nsAutoString remoteType;
   if (!aFrameElement->GetAttr(kNameSpaceID_None, nsGkAtoms::RemoteType,
                               remoteType)) {
     remoteType.AssignLiteral(DEFAULT_REMOTE_TYPE);
   }
 
   if (aNextRemoteTabId) {
     if (BrowserParent* parent =
             sNextBrowserParents.GetAndRemove(aNextRemoteTabId)
                 .valueOr(nullptr)) {
-      RefPtr<BrowserHost> browserHost = new BrowserHost(parent);
       MOZ_ASSERT(!parent->GetOwnerElement(),
                  "Shouldn't have an owner elemnt before");
       parent->SetOwnerElement(aFrameElement);
-      return browserHost.forget();
+      return parent;
     }
   }
 
   ProcessPriority initialPriority = GetInitialProcessPriority(aFrameElement);
   TabId tabId(nsContentUtils::GenerateTabId());
 
   nsIDocShell* docShell = GetOpenerDocShellHelper(aFrameElement);
   TabId openerTabId;
@@ -1210,19 +1211,18 @@ already_AddRefed<RemoteBrowser> ContentP
     }
 
     if (remoteType.EqualsLiteral(LARGE_ALLOCATION_REMOTE_TYPE)) {
       // Tell the BrowserChild object that it was created due to a
       // Large-Allocation request.
       Unused << browserParent->SendAwaitLargeAlloc();
     }
 
-    RefPtr<BrowserHost> browserHost = new BrowserHost(browserParent);
     browserParent->SetOwnerElement(aFrameElement);
-    return browserHost.forget();
+    return browserParent;
   }
   return nullptr;
 }
 
 void ContentParent::GetAll(nsTArray<ContentParent*>& aArray) {
   aArray.Clear();
 
   for (auto* cp : AllProcesses(eLive)) {
@@ -4678,36 +4678,33 @@ bool ContentParent::DeallocPWebBrowserPe
   return true;
 }
 
 mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
     PBrowserParent* aThisTab, bool aSetOpener, const uint32_t& aChromeFlags,
     const bool& aCalledFromJS, const bool& aPositionSpecified,
     const bool& aSizeSpecified, nsIURI* aURIToLoad, const nsCString& aFeatures,
     const float& aFullZoom, uint64_t aNextRemoteTabId, const nsString& aName,
-    nsresult& aResult, nsCOMPtr<nsIRemoteTab>& aNewRemoteTab,
+    nsresult& aResult, nsCOMPtr<nsIRemoteTab>& aNewBrowserParent,
     bool* aWindowIsNew, int32_t& aOpenLocation,
     nsIPrincipal* aTriggeringPrincipal, nsIReferrerInfo* aReferrerInfo,
     bool aLoadURI, nsIContentSecurityPolicy* aCsp)
 
 {
   // The content process should never be in charge of computing whether or
   // not a window should be private or remote - the parent will do that.
   const uint32_t badFlags = nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW |
                             nsIWebBrowserChrome::CHROME_NON_PRIVATE_WINDOW |
                             nsIWebBrowserChrome::CHROME_PRIVATE_LIFETIME |
                             nsIWebBrowserChrome::CHROME_REMOTE_WINDOW;
   if (!!(aChromeFlags & badFlags)) {
     return IPC_FAIL(this, "Forbidden aChromeFlags passed");
   }
 
   BrowserParent* thisBrowserParent = BrowserParent::GetFrom(aThisTab);
-  BrowserHost* thisBrowserHost =
-      thisBrowserParent ? thisBrowserParent->GetBrowserHost() : nullptr;
-  MOZ_ASSERT(!thisBrowserParent == !thisBrowserHost);
   nsCOMPtr<nsIContent> frame;
   if (thisBrowserParent) {
     frame = thisBrowserParent->GetOwnerElement();
 
     if (NS_WARN_IF(thisBrowserParent->IsMozBrowser())) {
       return IPC_FAIL(this, "aThisTab is not a MozBrowser");
     }
   }
@@ -4747,18 +4744,18 @@ mozilla::ipc::IPCResult ContentParent::C
       outerWin, aChromeFlags, aCalledFromJS, aPositionSpecified,
       aSizeSpecified);
 
   MOZ_ASSERT(aOpenLocation == nsIBrowserDOMWindow::OPEN_NEWTAB ||
              aOpenLocation == nsIBrowserDOMWindow::OPEN_NEWWINDOW);
 
   // Read the origin attributes for the tab from the opener browserParent.
   OriginAttributes openerOriginAttributes;
-  if (thisBrowserHost) {
-    nsCOMPtr<nsILoadContext> loadContext = thisBrowserHost->GetLoadContext();
+  if (thisBrowserParent) {
+    nsCOMPtr<nsILoadContext> loadContext = thisBrowserParent->GetLoadContext();
     loadContext->GetOriginAttributes(openerOriginAttributes);
   } else if (Preferences::GetBool("browser.privatebrowsing.autostart")) {
     openerOriginAttributes.mPrivateBrowsingId = 1;
   }
 
   if (aOpenLocation == nsIBrowserDOMWindow::OPEN_NEWTAB) {
     if (NS_WARN_IF(!browserDOMWin)) {
       aResult = NS_ERROR_ABORT;
@@ -4784,17 +4781,17 @@ mozilla::ipc::IPCResult ContentParent::C
       aResult = browserDOMWin->CreateContentWindowInFrame(
           aURIToLoad, params, aOpenLocation, nsIBrowserDOMWindow::OPEN_NEW,
           aNextRemoteTabId, aName, getter_AddRefs(el));
     }
     RefPtr<nsFrameLoaderOwner> frameLoaderOwner = do_QueryObject(el);
     if (NS_SUCCEEDED(aResult) && frameLoaderOwner) {
       RefPtr<nsFrameLoader> frameLoader = frameLoaderOwner->GetFrameLoader();
       if (frameLoader) {
-        aNewRemoteTab = frameLoader->GetRemoteTab();
+        aNewBrowserParent = frameLoader->GetRemoteTab();
         // At this point, it's possible the inserted frameloader hasn't gone
         // through layout yet. To ensure that the dimensions that we send down
         // when telling the frameloader to display will be correct (instead of
         // falling back to a 10x10 default), we force layout if necessary to get
         // the most up-to-date dimensions. See bug 1358712 for details.
         frameLoader->ForceLayoutIfNecessary();
       }
     } else if (NS_SUCCEEDED(aResult) && !frameLoaderOwner) {
@@ -4814,66 +4811,67 @@ mozilla::ipc::IPCResult ContentParent::C
 
   nsCOMPtr<nsPIWindowWatcher> pwwatch =
       do_GetService(NS_WINDOWWATCHER_CONTRACTID, &aResult);
   if (NS_WARN_IF(NS_FAILED(aResult))) {
     return IPC_OK();
   }
 
   aResult = pwwatch->OpenWindowWithRemoteTab(
-      thisBrowserHost, aFeatures, aCalledFromJS, aFullZoom, aNextRemoteTabId,
-      !aSetOpener, getter_AddRefs(aNewRemoteTab));
+      thisBrowserParent, aFeatures, aCalledFromJS, aFullZoom, aNextRemoteTabId,
+      !aSetOpener, getter_AddRefs(aNewBrowserParent));
   if (NS_WARN_IF(NS_FAILED(aResult))) {
     return IPC_OK();
   }
 
-  MOZ_ASSERT(aNewRemoteTab);
-  BrowserHost* newBrowserHost = BrowserHost::GetFrom(aNewRemoteTab.get());
-  BrowserParent* newBrowserParent = newBrowserHost->GetActor();
+  MOZ_ASSERT(aNewBrowserParent);
 
   // At this point, it's possible the inserted frameloader hasn't gone through
   // layout yet. To ensure that the dimensions that we send down when telling
   // the frameloader to display will be correct (instead of falling back to a
   // 10x10 default), we force layout if necessary to get the most up-to-date
   // dimensions. See bug 1358712 for details.
   //
   // This involves doing a bit of gymnastics in order to get at the FrameLoader,
   // so we scope this to avoid polluting the main function scope.
   {
-    nsCOMPtr<Element> frameElement = newBrowserHost->GetOwnerElement();
+    nsCOMPtr<Element> frameElement =
+        BrowserParent::GetFrom(aNewBrowserParent)->GetOwnerElement();
     MOZ_ASSERT(frameElement);
     RefPtr<nsFrameLoaderOwner> frameLoaderOwner = do_QueryObject(frameElement);
     MOZ_ASSERT(frameLoaderOwner);
     RefPtr<nsFrameLoader> frameLoader = frameLoaderOwner->GetFrameLoader();
     MOZ_ASSERT(frameLoader);
     frameLoader->ForceLayoutIfNecessary();
   }
 
   // If we were passed a name for the window which would override the default,
   // we should send it down to the new tab.
   if (nsContentUtils::IsOverridingWindowName(aName)) {
-    Unused << newBrowserParent->SendSetWindowName(aName);
+    Unused
+        << BrowserParent::GetFrom(aNewBrowserParent)->SendSetWindowName(aName);
   }
 
   // Don't send down the OriginAttributes if the content process is handling
   // setting up the window for us. We only want to send them in the async case.
   //
   // If we send it down in the non-async case, then we might set the
   // OriginAttributes after the document has already navigated.
   if (!aSetOpener) {
-    Unused << newBrowserParent->SendSetOriginAttributes(openerOriginAttributes);
+    Unused << BrowserParent::GetFrom(aNewBrowserParent)
+                  ->SendSetOriginAttributes(openerOriginAttributes);
   }
 
   if (aURIToLoad && aLoadURI) {
     nsCOMPtr<mozIDOMWindowProxy> openerWindow;
     if (aSetOpener && thisBrowserParent) {
       openerWindow = thisBrowserParent->GetParentWindowOuter();
     }
     nsCOMPtr<nsIBrowserDOMWindow> newBrowserDOMWin =
-        newBrowserParent->GetBrowserDOMWindow();
+        BrowserParent::GetFrom(aNewBrowserParent)->GetBrowserDOMWindow();
     if (NS_WARN_IF(!newBrowserDOMWin)) {
       aResult = NS_ERROR_ABORT;
       return IPC_OK();
     }
     nsCOMPtr<mozIDOMWindowProxy> win;
     aResult = newBrowserDOMWin->OpenURI(
         aURIToLoad, openerWindow, nsIBrowserDOMWindow::OPEN_CURRENTWINDOW,
         nsIBrowserDOMWindow::OPEN_NEW, aTriggeringPrincipal, aCsp,
@@ -4943,18 +4941,17 @@ mozilla::ipc::IPCResult ContentParent::R
 
   if (NS_WARN_IF(NS_FAILED(rv)) || !newRemoteTab) {
     return IPC_OK();
   }
 
   if (sNextBrowserParents.GetAndRemove(nextRemoteTabId).valueOr(nullptr)) {
     cwi.windowOpened() = false;
   }
-  MOZ_ASSERT(BrowserHost::GetFrom(newRemoteTab.get()) ==
-             newTab->GetBrowserHost());
+  MOZ_ASSERT(BrowserParent::GetFrom(newRemoteTab) == newTab);
 
   newTab->SwapFrameScriptsFrom(cwi.frameScripts());
   newTab->MaybeShowFrame();
 
   nsCOMPtr<nsIWidget> widget = newTab->GetWidget();
   if (widget) {
     cwi.maxTouchPoints() = widget->GetMaxTouchPoints();
     cwi.dimensions() = newTab->GetDimensionInfo();
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_ContentParent_h
 #define mozilla_dom_ContentParent_h
 
 #include "mozilla/dom/PContentParent.h"
 #include "mozilla/dom/CPOWManagerGetter.h"
 #include "mozilla/dom/ipc/IdType.h"
-#include "mozilla/dom/RemoteBrowser.h"
 #include "mozilla/gfx/gfxVarReceiver.h"
 #include "mozilla/gfx/GPUProcessListener.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/GeckoChildProcessHost.h"
 #include "mozilla/ipc/PParentToChildStreamParent.h"
 #include "mozilla/ipc/PChildToParentStreamParent.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/FileUtils.h"
@@ -204,20 +203,22 @@ class ContentParent final : public PCont
   static already_AddRefed<ContentParent> GetNewOrUsedJSPluginProcess(
       uint32_t aPluginID, const hal::ProcessPriority& aPriority);
 
   /**
    * Get or create a content process for the given TabContext.  aFrameElement
    * should be the frame/iframe element with which this process will
    * associated.
    */
-  static already_AddRefed<RemoteBrowser> CreateBrowser(
-      const TabContext& aContext, Element* aFrameElement,
-      BrowsingContext* aBrowsingContext, ContentParent* aOpenerContentParent,
-      BrowserParent* aSameTabGroupAs, uint64_t aNextRemoteTabId);
+  static BrowserParent* CreateBrowser(const TabContext& aContext,
+                                      Element* aFrameElement,
+                                      BrowsingContext* aBrowsingContext,
+                                      ContentParent* aOpenerContentParent,
+                                      BrowserParent* aSameTabGroupAs,
+                                      uint64_t aNextRemoteTabId);
 
   static void GetAll(nsTArray<ContentParent*>& aArray);
 
   static void GetAllEvenIfDead(nsTArray<ContentParent*>& aArray);
 
   static void BroadcastStringBundle(const StringBundleDescriptor&);
 
   static void BroadcastFontListChanged();
@@ -676,17 +677,17 @@ class ContentParent final : public PCont
   // window. aURIToLoad should always be provided, if available, to ensure
   // compatibility with GeckoView.
   mozilla::ipc::IPCResult CommonCreateWindow(
       PBrowserParent* aThisTab, bool aSetOpener, const uint32_t& aChromeFlags,
       const bool& aCalledFromJS, const bool& aPositionSpecified,
       const bool& aSizeSpecified, nsIURI* aURIToLoad,
       const nsCString& aFeatures, const float& aFullZoom,
       uint64_t aNextRemoteTabId, const nsString& aName, nsresult& aResult,
-      nsCOMPtr<nsIRemoteTab>& aNewRemoteTab, bool* aWindowIsNew,
+      nsCOMPtr<nsIRemoteTab>& aNewBrowserParent, bool* aWindowIsNew,
       int32_t& aOpenLocation, nsIPrincipal* aTriggeringPrincipal,
       nsIReferrerInfo* aReferrerInfo, bool aLoadUri,
       nsIContentSecurityPolicy* aCsp);
 
   enum RecordReplayState { eNotRecordingOrReplaying, eRecording, eReplaying };
 
   explicit ContentParent(int32_t aPluginID)
       : ContentParent(nullptr, EmptyString(), eNotRecordingOrReplaying,
--- a/dom/ipc/JSWindowActorChild.cpp
+++ b/dom/ipc/JSWindowActorChild.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 "mozilla/dom/JSWindowActorBinding.h"
 #include "mozilla/dom/JSWindowActorChild.h"
-#include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/WindowGlobalChild.h"
 #include "mozilla/dom/WindowGlobalParent.h"
 #include "mozilla/dom/MessageManagerBinding.h"
 #include "mozilla/dom/BrowsingContext.h"
 #include "nsGlobalWindowInner.h"
 
 namespace mozilla {
 namespace dom {
--- a/dom/ipc/JSWindowActorParent.cpp
+++ b/dom/ipc/JSWindowActorParent.cpp
@@ -67,17 +67,17 @@ void JSWindowActorParent::SendRawMessage
     nsCOMPtr<nsIRunnable> runnable =
         new AsyncMessageToChild(aMeta, std::move(aData), wgc);
     NS_DispatchToMainThread(runnable.forget());
     return;
   }
 
   // Cross-process case - send data over WindowGlobalParent to other side.
   ClonedMessageData msgData;
-  RefPtr<BrowserParent> browserParent = mManager->GetBrowserParent();
+  RefPtr<BrowserParent> browserParent = mManager->GetRemoteTab();
   ContentParent* cp = browserParent->Manager();
   if (NS_WARN_IF(!aData.BuildClonedMessageDataForParent(cp, msgData))) {
     aRv.Throw(NS_ERROR_DOM_DATA_CLONE_ERR);
     return;
   }
 
   if (NS_WARN_IF(!mManager->SendRawMessage(aMeta, msgData))) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -3,17 +3,16 @@
 /* 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 "ProcessPriorityManager.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/Element.h"
-#include "mozilla/dom/BrowserHost.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/Hal.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Unused.h"
 #include "mozilla/Logging.h"
@@ -679,27 +678,30 @@ void ParticularProcessPriorityManager::O
   nsCOMPtr<nsIObserverService> os = services::GetObserverService();
   if (os) {
     os->RemoveObserver(this, "remote-browser-shown");
   }
 }
 
 void ParticularProcessPriorityManager::OnBrowserParentDestroyed(
     nsISupports* aSubject) {
-  nsCOMPtr<nsIRemoteTab> remoteTab = do_QueryInterface(aSubject);
-  NS_ENSURE_TRUE_VOID(remoteTab);
-  BrowserHost* browserHost = BrowserHost::GetFrom(remoteTab.get());
-  BrowserParent* browserParent = browserHost->GetActor();
+  nsCOMPtr<nsIRemoteTab> tp = do_QueryInterface(aSubject);
+  NS_ENSURE_TRUE_VOID(tp);
 
   MOZ_ASSERT(XRE_IsParentProcess());
-  if (browserParent->Manager() != mContentParent) {
+  if (BrowserParent::GetFrom(tp)->Manager() != mContentParent) {
     return;
   }
 
-  mActiveBrowserParents.RemoveEntry(browserParent->GetTabId());
+  uint64_t tabId;
+  if (NS_WARN_IF(NS_FAILED(tp->GetTabId(&tabId)))) {
+    return;
+  }
+
+  mActiveBrowserParents.RemoveEntry(tabId);
 
   ResetPriority();
 }
 
 void ParticularProcessPriorityManager::ResetPriority() {
   ProcessPriority processPriority = ComputePriority();
   if (mPriority == PROCESS_PRIORITY_UNKNOWN || mPriority > processPriority) {
     // Apps set at a perceivable background priority are often playing media.
deleted file mode 100644
--- a/dom/ipc/RemoteBrowser.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 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/. */
-
-#ifndef mozilla_dom_ipc_RemoteBrowser_h
-#define mozilla_dom_ipc_RemoteBrowser_h
-
-#include "mozilla/dom/BrowsingContext.h"
-#include "mozilla/dom/ipc/IdType.h"
-#include "mozilla/layers/LayersTypes.h"
-#include "nsILoadContext.h"
-#include "nsISupports.h"
-#include "nsISupportsImpl.h"
-#include "nsIURI.h"
-#include "nsRect.h"
-#include "Units.h"
-
-namespace mozilla {
-namespace dom {
-
-class BrowserHost;
-class BrowserBridgeHost;
-
-/**
- * An interface to control a browser hosted in another process.
- *
- * This is used by nsFrameLoader to abstract between hosting a top-level remote
- * browser in the chrome process and hosting an OOP-iframe in a content process.
- *
- * There are two concrete implementations that are used depending on whether
- * the nsFrameLoader is in the chrome or content process. A chrome process
- * nsFrameLoader will use BrowserHost, and a content process nsFrameLoader will
- * use BrowserBridgeHost.
- */
-class RemoteBrowser : public nsISupports {
- public:
-  typedef mozilla::layers::LayersId LayersId;
-
-  // Try to cast this RemoteBrowser to a BrowserHost, may return null
-  virtual BrowserHost* AsBrowserHost() = 0;
-  // Try to cast this RemoteBrowser to a BrowserBridgeHost, may return null
-  virtual BrowserBridgeHost* AsBrowserBridgeHost() = 0;
-
-  virtual LayersId GetLayersId() const = 0;
-  virtual BrowsingContext* GetBrowsingContext() const = 0;
-  virtual nsILoadContext* GetLoadContext() const = 0;
-
-  virtual void LoadURL(nsIURI* aURI) = 0;
-  virtual void ResumeLoad(uint64_t aPendingSwitchId) = 0;
-  virtual void DestroyStart() = 0;
-  virtual void DestroyComplete() = 0;
-
-  virtual bool Show(const ScreenIntSize& aSize, bool aParentIsActive) = 0;
-  virtual void UpdateDimensions(const nsIntRect& aRect,
-                                const ScreenIntSize& aSize) = 0;
-};
-
-}  // namespace dom
-}  // namespace mozilla
-
-#endif  // mozilla_dom_ipc_RemoteBrowser_h
--- a/dom/ipc/WindowGlobalParent.cpp
+++ b/dom/ipc/WindowGlobalParent.cpp
@@ -6,17 +6,16 @@
 
 #include "mozilla/dom/WindowGlobalParent.h"
 
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/ipc/InProcessParent.h"
 #include "mozilla/dom/BrowserBridgeParent.h"
 #include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/ContentParent.h"
-#include "mozilla/dom/BrowserHost.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/dom/WindowGlobalActorsBinding.h"
 #include "mozilla/dom/WindowGlobalChild.h"
 #include "mozilla/dom/ChromeUtils.h"
 #include "mozilla/dom/ipc/IdType.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozJSComponentLoader.h"
 #include "nsContentUtils.h"
@@ -139,17 +138,17 @@ already_AddRefed<WindowGlobalParent> Win
 already_AddRefed<WindowGlobalChild> WindowGlobalParent::GetChildActor() {
   if (mIPCClosed) {
     return nullptr;
   }
   IProtocol* otherSide = InProcessParent::ChildActorFor(this);
   return do_AddRef(static_cast<WindowGlobalChild*>(otherSide));
 }
 
-already_AddRefed<BrowserParent> WindowGlobalParent::GetBrowserParent() {
+already_AddRefed<BrowserParent> WindowGlobalParent::GetRemoteTab() {
   if (IsInProcess() || mIPCClosed) {
     return nullptr;
   }
   return do_AddRef(static_cast<BrowserParent*>(Manager()));
 }
 
 IPCResult WindowGlobalParent::RecvUpdateDocumentURI(nsIURI* aURI) {
   // XXX(nika): Assert that the URI change was one which makes sense (either
@@ -160,17 +159,17 @@ IPCResult WindowGlobalParent::RecvUpdate
 
 IPCResult WindowGlobalParent::RecvBecomeCurrentWindowGlobal() {
   mBrowsingContext->SetCurrentWindowGlobal(this);
   return IPC_OK();
 }
 
 IPCResult WindowGlobalParent::RecvDestroy() {
   if (!mIPCClosed) {
-    RefPtr<BrowserParent> browserParent = GetBrowserParent();
+    RefPtr<BrowserParent> browserParent = GetRemoteTab();
     if (!browserParent || !browserParent->IsDestroyed()) {
       // Make a copy so that we can avoid potential iterator invalidation when
       // calling the user-provided Destroy() methods.
       nsTArray<RefPtr<JSWindowActorParent>> windowActors(mWindowActors.Count());
       for (auto iter = mWindowActors.Iter(); !iter.Done(); iter.Next()) {
         windowActors.AppendElement(iter.UserData());
       }
 
@@ -196,17 +195,17 @@ void WindowGlobalParent::ReceiveRawMessa
   RefPtr<JSWindowActorParent> actor =
       GetActor(aMeta.actorName(), IgnoreErrors());
   if (actor) {
     actor->ReceiveRawMessage(aMeta, std::move(aData));
   }
 }
 
 const nsAString& WindowGlobalParent::GetRemoteType() {
-  if (RefPtr<BrowserParent> browserParent = GetBrowserParent()) {
+  if (RefPtr<BrowserParent> browserParent = GetRemoteTab()) {
     return browserParent->Manager()->GetRemoteType();
   }
 
   return VoidString();
 }
 
 already_AddRefed<JSWindowActorParent> WindowGlobalParent::GetActor(
     const nsAString& aName, ErrorResult& aRv) {
@@ -249,17 +248,17 @@ IPCResult WindowGlobalParent::RecvDidEmb
   MOZ_ASSERT(aContext);
   aContext->Canonical()->SetEmbedderWindowGlobal(this);
   return IPC_OK();
 }
 
 already_AddRefed<Promise> WindowGlobalParent::ChangeFrameRemoteness(
     dom::BrowsingContext* aBc, const nsAString& aRemoteType,
     uint64_t aPendingSwitchId, ErrorResult& aRv) {
-  RefPtr<BrowserParent> browserParent = GetBrowserParent();
+  RefPtr<BrowserParent> browserParent = GetRemoteTab();
   if (NS_WARN_IF(!browserParent)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsIGlobalObject* global = xpc::NativeGlobal(xpc::PrivilegedJunkScope());
   RefPtr<Promise> promise = Promise::Create(global, aRv);
   if (aRv.Failed()) {
@@ -273,23 +272,22 @@ already_AddRefed<Promise> WindowGlobalPa
         RefPtr<BrowserBridgeParent> bridge =
             static_cast<BrowserBridgeParent*>(Get<1>(aResult));
         if (NS_FAILED(rv)) {
           promise->MaybeReject(rv);
           return;
         }
 
         // If we got a BrowserBridgeParent, the frame is out-of-process, so pull
-        // our target content process off of it. Otherwise, it's an in-process
+        // our target BrowserParent off of it. Otherwise, it's an in-process
         // frame, so we can directly use ours.
         if (bridge) {
-          promise->MaybeResolve(
-              bridge->GetBrowserParent()->Manager()->ChildID());
+          promise->MaybeResolve(bridge->GetBrowserParent());
         } else {
-          promise->MaybeResolve(browserParent->Manager()->ChildID());
+          promise->MaybeResolve(browserParent);
         }
       };
 
   auto reject = [=](ResponseRejectReason aReason) {
     promise->MaybeReject(NS_ERROR_FAILURE);
   };
 
   SendChangeFrameRemoteness(aBc, PromiseFlatString(aRemoteType),
--- a/dom/ipc/WindowGlobalParent.h
+++ b/dom/ipc/WindowGlobalParent.h
@@ -59,17 +59,17 @@ class WindowGlobalParent final : public 
   already_AddRefed<WindowGlobalChild> GetChildActor();
 
   // Get a JS actor object by name.
   already_AddRefed<JSWindowActorParent> GetActor(const nsAString& aName,
                                                  ErrorResult& aRv);
 
   // Get this actor's manager if it is not an in-process actor. Returns
   // |nullptr| if the actor has been torn down, or is in-process.
-  already_AddRefed<BrowserParent> GetBrowserParent();
+  already_AddRefed<BrowserParent> GetRemoteTab();
 
   void ReceiveRawMessage(const JSWindowActorMessageMeta& aMeta,
                          ipc::StructuredCloneData&& aData);
 
   // The principal of this WindowGlobal. This value will not change over the
   // lifetime of the WindowGlobal object, even to reflect changes in
   // |document.domain|.
   nsIPrincipal* DocumentPrincipal() { return mDocumentPrincipal; }
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -30,20 +30,18 @@ EXPORTS.mozilla.dom.ipc += [
     'SharedMapChangeEvent.h',
     'SharedStringMap.h',
     'StringTable.h',
     'StructuredCloneData.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'BrowserBridgeChild.h',
-    'BrowserBridgeHost.h',
     'BrowserBridgeParent.h',
     'BrowserChild.h',
-    'BrowserHost.h',
     'BrowserParent.h',
     'CoalescedInputData.h',
     'CoalescedMouseData.h',
     'CoalescedWheelData.h',
     'ContentChild.h',
     'ContentParent.h',
     'ContentProcess.h',
     'ContentProcessManager.h',
@@ -53,17 +51,16 @@ EXPORTS.mozilla.dom += [
     'FilePickerParent.h',
     'JSWindowActor.h',
     'JSWindowActorChild.h',
     'JSWindowActorParent.h',
     'JSWindowActorService.h',
     'MemoryReportRequest.h',
     'PermissionMessageUtils.h',
     'ReferrerInfoUtils.h',
-    'RemoteBrowser.h',
     'RemoteWebProgress.h',
     'RemoteWebProgressRequest.h',
     'TabContext.h',
     'TabMessageUtils.h',
     'URLClassifierChild.h',
     'URLClassifierParent.h',
     'WindowGlobalActor.h',
     'WindowGlobalChild.h',
@@ -74,20 +71,18 @@ EXPORTS.mozilla += [
     'PreallocatedProcessManager.h',
     'ProcessHangMonitor.h',
     'ProcessHangMonitorIPC.h',
     'ProcessPriorityManager.h',
 ]
 
 UNIFIED_SOURCES += [
     'BrowserBridgeChild.cpp',
-    'BrowserBridgeHost.cpp',
     'BrowserBridgeParent.cpp',
     'BrowserChild.cpp',
-    'BrowserHost.cpp',
     'BrowserParent.cpp',
     'CoalescedMouseData.cpp',
     'CoalescedWheelData.cpp',
     'ColorPickerParent.cpp',
     'ContentParent.cpp',
     'ContentProcess.cpp',
     'ContentProcessManager.cpp',
     'CSPMessageUtils.cpp',
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1388,18 +1388,18 @@ bool nsPresContext::UIResolutionChangedS
     // that has an out-of-date resolution (it's on a different screen, but
     // currently hidden, and will not be updated until shown): bug 1249279.
     double scale = *static_cast<double*>(aData);
     pc->UIResolutionChangedInternalScale(scale);
   }
   return true;
 }
 
-static void NotifyTabUIResolutionChanged(nsIRemoteTab* aTab, void* aArg) {
-  aTab->NotifyResolutionChanged();
+static void NotifyTabUIResolutionChanged(BrowserParent* aTab, void* aArg) {
+  aTab->UIResolutionChanged();
 }
 
 static void NotifyChildrenUIResolutionChanged(nsPIDOMWindowOuter* aWindow) {
   nsCOMPtr<Document> doc = aWindow->GetExtantDoc();
   RefPtr<nsPIWindowRoot> topLevelWin = nsContentUtils::GetWindowRoot(doc);
   if (!topLevelWin) {
     return;
   }
--- a/netwerk/protocol/http/HttpChannelParentListener.cpp
+++ b/netwerk/protocol/http/HttpChannelParentListener.cpp
@@ -3,18 +3,16 @@
 /* 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/. */
 
 // HttpLog.h should generally be included first
 #include "HttpLog.h"
 
 #include "HttpChannelParentListener.h"
-#include "mozilla/dom/ContentParent.h"
-#include "mozilla/dom/ContentProcessManager.h"
 #include "mozilla/dom/ServiceWorkerInterceptController.h"
 #include "mozilla/dom/ServiceWorkerUtils.h"
 #include "mozilla/net/HttpChannelParent.h"
 #include "mozilla/net/RedirectChannelRegistrar.h"
 #include "mozilla/Unused.h"
 #include "nsIAuthPrompt.h"
 #include "nsIAuthPrompt2.h"
 #include "nsIHttpHeaderVisitor.h"
@@ -155,24 +153,23 @@ HttpChannelParentListener::GetInterface(
 nsresult HttpChannelParentListener::TriggerCrossProcessRedirect(
     nsIChannel* aChannel, nsILoadInfo* aLoadInfo, uint64_t aIdentifier) {
   RefPtr<HttpChannelParent> channelParent = do_QueryObject(mNextListener);
   MOZ_ASSERT(channelParent);
   channelParent->CancelChildCrossProcessRedirect();
 
   nsCOMPtr<nsIChannel> channel = aChannel;
   RefPtr<nsHttpChannel> httpChannel = do_QueryObject(channel);
-  RefPtr<nsHttpChannel::ContentProcessIdPromise> p =
-      httpChannel->TakeRedirectContentProcessIdPromise();
+  RefPtr<nsHttpChannel::TabPromise> p = httpChannel->TakeRedirectTabPromise();
   nsCOMPtr<nsILoadInfo> loadInfo = aLoadInfo;
 
   RefPtr<HttpChannelParentListener> self = this;
   p->Then(
       GetMainThreadSerialEventTarget(), __func__,
-      [=](uint64_t cpId) {
+      [=](nsCOMPtr<nsIRemoteTab> tp) {
         nsresult rv;
 
         // Register the new channel and obtain id for it
         nsCOMPtr<nsIRedirectChannelRegistrar> registrar =
             RedirectChannelRegistrar::GetOrCreate();
         MOZ_ASSERT(registrar);
         rv = registrar->RegisterChannel(channel, &self->mRedirectChannelId);
         NS_ENSURE_SUCCESS(rv, rv);
@@ -197,23 +194,18 @@ nsresult HttpChannelParentListener::Trig
 
         uint32_t redirectMode = nsIHttpChannelInternal::REDIRECT_MODE_FOLLOW;
         nsCOMPtr<nsIHttpChannelInternal> internalChannel =
             do_QueryInterface(channel);
         if (internalChannel) {
           MOZ_ALWAYS_SUCCEEDS(internalChannel->GetRedirectMode(&redirectMode));
         }
 
-        dom::ContentParent* cp =
-            dom::ContentProcessManager::GetSingleton()->GetContentProcessById(
-                ContentParentId{cpId});
-        if (!cp) {
-          return NS_ERROR_UNEXPECTED;
-        }
-        auto result = cp->SendCrossProcessRedirect(
+        dom::BrowserParent* browserParent = dom::BrowserParent::GetFrom(tp);
+        auto result = browserParent->Manager()->SendCrossProcessRedirect(
             self->mRedirectChannelId, uri, newLoadFlags, loadInfoArgs,
             channelId, originalURI, aIdentifier, redirectMode);
 
         MOZ_ASSERT(result, "SendCrossProcessRedirect failed");
 
         return result ? NS_OK : NS_ERROR_UNEXPECTED;
       },
       [httpChannel](nsresult aStatus) {
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -123,17 +123,16 @@
 #include "mozilla/dom/ServiceWorkerUtils.h"
 #include "mozilla/net/AsyncUrlChannelClassifier.h"
 #include "mozilla/net/NeckoChannelParams.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
 #include "nsIWebNavigation.h"
 #include "HttpTrafficAnalyzer.h"
 #include "mozilla/dom/CanonicalBrowsingContext.h"
 #include "mozilla/dom/WindowGlobalParent.h"
-#include "js/Conversions.h"
 
 #ifdef MOZ_TASK_TRACER
 #  include "GeckoTaskTracer.h"
 #endif
 
 #ifdef MOZ_GECKO_PROFILER
 #  include "ProfilerMarkerPayload.h"
 #endif
@@ -2565,17 +2564,17 @@ nsresult nsHttpChannel::ContinueProcessR
     return NS_OK;
   }
 
   rv = NS_OK;
   if (!mCanceled) {
     // notify "http-on-may-change-process" observers
     gHttpHandler->OnMayChangeProcess(this);
 
-    if (mRedirectContentProcessIdPromise) {
+    if (mRedirectTabPromise) {
       MOZ_ASSERT(!mOnStartRequestCalled);
 
       PushRedirectAsyncFunc(&nsHttpChannel::ContinueProcessResponse2);
       rv = StartCrossProcessRedirect();
       if (NS_SUCCEEDED(rv)) {
         return NS_OK;
       }
       PopRedirectAsyncFunc(&nsHttpChannel::ContinueProcessResponse2);
@@ -7240,66 +7239,67 @@ nsHttpChannel::GetRequestMethod(nsACStri
 //-----------------------------------------------------------------------------
 // nsHttpChannel::nsIRequestObserver
 //-----------------------------------------------------------------------------
 
 // This class is used to convert from a DOM promise to a MozPromise.
 class DomPromiseListener final : dom::PromiseNativeHandler {
   NS_DECL_ISUPPORTS
 
-  static RefPtr<nsHttpChannel::ContentProcessIdPromise> Create(
-      dom::Promise* aDOMPromise) {
+  static RefPtr<nsHttpChannel::TabPromise> Create(dom::Promise* aDOMPromise) {
     MOZ_ASSERT(aDOMPromise);
     RefPtr<DomPromiseListener> handler = new DomPromiseListener();
-    RefPtr<nsHttpChannel::ContentProcessIdPromise> promise =
+    RefPtr<nsHttpChannel::TabPromise> promise =
         handler->mPromiseHolder.Ensure(__func__);
     aDOMPromise->AppendNativeHandler(handler);
     return promise;
   }
 
   virtual void ResolvedCallback(JSContext* aCx,
                                 JS::Handle<JS::Value> aValue) override {
-    uint64_t cpId;
-    if (!JS::ToUint64(aCx, aValue, &cpId)) {
-      mPromiseHolder.Reject(NS_ERROR_FAILURE, __func__);
+    nsCOMPtr<nsIRemoteTab> browserParent;
+    JS::Rooted<JSObject*> obj(aCx, &aValue.toObject());
+    nsresult rv =
+        UnwrapArg<nsIRemoteTab>(aCx, obj, getter_AddRefs(browserParent));
+    if (NS_FAILED(rv)) {
+      mPromiseHolder.Reject(rv, __func__);
       return;
     }
-    mPromiseHolder.Resolve(cpId, __func__);
+    mPromiseHolder.Resolve(browserParent, __func__);
   }
 
   virtual void RejectedCallback(JSContext* aCx,
                                 JS::Handle<JS::Value> aValue) override {
     if (!aValue.isInt32()) {
       mPromiseHolder.Reject(NS_ERROR_DOM_NOT_NUMBER_ERR, __func__);
       return;
     }
     mPromiseHolder.Reject((nsresult)aValue.toInt32(), __func__);
   }
 
  private:
   DomPromiseListener() = default;
   ~DomPromiseListener() = default;
-  MozPromiseHolder<nsHttpChannel::ContentProcessIdPromise> mPromiseHolder;
+  MozPromiseHolder<nsHttpChannel::TabPromise> mPromiseHolder;
 };
 
 NS_IMPL_ISUPPORTS0(DomPromiseListener)
 
-NS_IMETHODIMP nsHttpChannel::SwitchProcessTo(
-    dom::Promise* aContentProcessIdPromise, uint64_t aIdentifier) {
+NS_IMETHODIMP nsHttpChannel::SwitchProcessTo(dom::Promise* aTabPromise,
+                                             uint64_t aIdentifier) {
   MOZ_ASSERT(NS_IsMainThread());
-  NS_ENSURE_ARG(aContentProcessIdPromise);
+  NS_ENSURE_ARG(aTabPromise);
 
   LOG(("nsHttpChannel::SwitchProcessTo [this=%p]", this));
   LogCallingScriptLocation(this);
 
   // We cannot do this after OnStartRequest of the listener has been called.
   NS_ENSURE_FALSE(mOnStartRequestCalled, NS_ERROR_NOT_AVAILABLE);
 
-  mRedirectContentProcessIdPromise =
-      DomPromiseListener::Create(aContentProcessIdPromise);
+  mRedirectTabPromise = DomPromiseListener::Create(aTabPromise);
   mCrossProcessRedirectIdentifier = aIdentifier;
   return NS_OK;
 }
 
 nsresult nsHttpChannel::StartCrossProcessRedirect() {
   nsresult rv;
 
   LOG(("nsHttpChannel::StartCrossProcessRedirect [this=%p]", this));
@@ -7640,17 +7640,17 @@ nsHttpChannel::OnStartRequest(nsIRequest
 
   // before we check for redirects, check if the load should be shifted into a
   // new process.
   rv = NS_OK;
   if (!mCanceled) {
     // notify "http-on-may-change-process" observers
     gHttpHandler->OnMayChangeProcess(this);
 
-    if (mRedirectContentProcessIdPromise) {
+    if (mRedirectTabPromise) {
       PushRedirectAsyncFunc(&nsHttpChannel::ContinueOnStartRequest1);
       rv = StartCrossProcessRedirect();
       if (NS_SUCCEEDED(rv)) {
         return NS_OK;
       }
       PopRedirectAsyncFunc(&nsHttpChannel::ContinueOnStartRequest1);
     }
   }
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -281,20 +281,19 @@ class nsHttpChannel final : public HttpB
 
  public:
   void SetConnectionInfo(nsHttpConnectionInfo*);  // clones the argument
   void SetTransactionObserver(TransactionObserver* arg) {
     mTransactionObserver = arg;
   }
   TransactionObserver* GetTransactionObserver() { return mTransactionObserver; }
 
-  typedef MozPromise<uint64_t, nsresult, false> ContentProcessIdPromise;
-  already_AddRefed<ContentProcessIdPromise>
-  TakeRedirectContentProcessIdPromise() {
-    return mRedirectContentProcessIdPromise.forget();
+  typedef MozPromise<nsCOMPtr<nsIRemoteTab>, nsresult, false> TabPromise;
+  already_AddRefed<TabPromise> TakeRedirectTabPromise() {
+    return mRedirectTabPromise.forget();
   }
   uint64_t CrossProcessRedirectIdentifier() {
     return mCrossProcessRedirectIdentifier;
   }
 
   CacheDisposition mCacheDisposition;
 
  protected:
@@ -572,17 +571,17 @@ class nsHttpChannel final : public HttpB
   // auth specific data
   nsCOMPtr<nsIHttpChannelAuthProvider> mAuthProvider;
   nsCOMPtr<nsIURI> mRedirectURI;
   nsCOMPtr<nsIChannel> mRedirectChannel;
   nsCOMPtr<nsIChannel> mPreflightChannel;
 
   // The associated childChannel is getting relocated to another process.
   // This promise will be resolved when that process is set up.
-  RefPtr<ContentProcessIdPromise> mRedirectContentProcessIdPromise;
+  RefPtr<TabPromise> mRedirectTabPromise;
   // This identifier is passed to the childChannel in order to identify it.
   uint64_t mCrossProcessRedirectIdentifier = 0;
 
   // nsChannelClassifier checks this channel's URI against
   // the URI classifier service.
   // nsChannelClassifier will be invoked twice in InitLocalBlockList() and
   // BeginConnectActual(), so save the nsChannelClassifier here to keep the
   // state of whether tracking protection is enabled or not.
--- a/netwerk/test/browser/browser_cross_process_redirect.js
+++ b/netwerk/test/browser/browser_cross_process_redirect.js
@@ -65,17 +65,17 @@ ProcessChooser.prototype = {
       if (self.rejectPromise) {
         info("rejecting");
         reject(Cr.NS_ERROR_NOT_AVAILABLE);
         return;
       }
       // Can asyncly create a tab, or can resolve with a tab that was
       // previously created.
       info("resolving");
-      resolve(self.remoteTab.contentProcessId);
+      resolve(self.remoteTab);
     });
 
     info("calling switchprocessto");
     aChannel.switchProcessTo(tabPromise, identifier);
   },
 
   observe(aSubject, aTopic, aData) {
     switch (aTopic) {
--- a/toolkit/components/extensions/webrequest/ChannelWrapper.cpp
+++ b/toolkit/components/extensions/webrequest/ChannelWrapper.cpp
@@ -17,17 +17,17 @@
 
 #include "mozilla/AddonManagerWebAPI.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/ErrorNames.h"
 #include "mozilla/ResultExtensions.h"
 #include "mozilla/Unused.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h"
-#include "mozilla/dom/BrowserHost.h"
+#include "mozilla/dom/BrowserParent.h"
 #include "nsIContentPolicy.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIHttpHeaderVisitor.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsILoadContext.h"
 #include "nsILoadGroup.h"
 #include "nsIProxiedChannel.h"
@@ -135,20 +135,20 @@ already_AddRefed<ChannelWrapper> Channel
     }
   }
 
   return wrapper.forget();
 }
 
 already_AddRefed<ChannelWrapper> ChannelWrapper::GetRegisteredChannel(
     const GlobalObject& global, uint64_t aChannelId,
-    const WebExtensionPolicy& aAddon, nsIRemoteTab* aRemoteTab) {
+    const WebExtensionPolicy& aAddon, nsIRemoteTab* aBrowserParent) {
   ContentParent* contentParent = nullptr;
-  if (BrowserHost* host = BrowserHost::GetFrom(aRemoteTab)) {
-    contentParent = host->GetActor()->Manager();
+  if (BrowserParent* parent = static_cast<BrowserParent*>(aBrowserParent)) {
+    contentParent = parent->Manager();
   }
 
   auto& webreq = WebRequestService::GetSingleton();
 
   nsCOMPtr<nsITraceableChannel> channel =
       webreq.GetTraceableChannel(aChannelId, aAddon.Id(), contentParent);
   if (!channel) {
     return nullptr;
@@ -677,22 +677,22 @@ void ChannelWrapper::RegisterTraceableCh
   if (!mChannelEntry) {
     mChannelEntry = WebRequestService::GetSingleton().RegisterChannel(this);
     CheckEventListeners();
   }
 }
 
 already_AddRefed<nsITraceableChannel> ChannelWrapper::GetTraceableChannel(
     nsAtom* aAddonId, dom::ContentParent* aContentParent) const {
-  nsCOMPtr<nsIRemoteTab> remoteTab;
-  if (mAddonEntries.Get(aAddonId, getter_AddRefs(remoteTab))) {
+  nsCOMPtr<nsIRemoteTab> browserParent;
+  if (mAddonEntries.Get(aAddonId, getter_AddRefs(browserParent))) {
     ContentParent* contentParent = nullptr;
-    if (remoteTab) {
+    if (browserParent) {
       contentParent =
-          BrowserHost::GetFrom(remoteTab.get())->GetActor()->Manager();
+          static_cast<BrowserParent*>(browserParent.get())->Manager();
     }
 
     if (contentParent == aContentParent) {
       nsCOMPtr<nsITraceableChannel> chan = QueryChannel();
       return chan.forget();
     }
   }
   return nullptr;
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp
@@ -61,17 +61,16 @@
 #include "nsSimpleEnumerator.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Storage.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/BrowserParent.h"
-#include "mozilla/dom/BrowserHost.h"
 #include "mozilla/dom/DocGroup.h"
 #include "mozilla/dom/TabGroup.h"
 #include "nsIXULWindow.h"
 #include "nsIXULBrowserWindow.h"
 #include "nsGlobalWindow.h"
 #include "ReferrerInfo.h"
 
 using namespace mozilla;
@@ -472,17 +471,17 @@ nsWindowWatcher::OpenWindowWithRemoteTab
   bool isFissionWindow = Preferences::GetBool("fission.autostart");
   bool isPrivateBrowsingWindow =
       Preferences::GetBool("browser.privatebrowsing.autostart");
 
   nsCOMPtr<nsPIDOMWindowOuter> parentWindowOuter;
   if (aRemoteTab) {
     // We need to examine the window that aRemoteTab belongs to in
     // order to inform us of what kind of window we're going to open.
-    BrowserHost* openingTab = BrowserHost::GetFrom(aRemoteTab);
+    BrowserParent* openingTab = BrowserParent::GetFrom(aRemoteTab);
     parentWindowOuter = openingTab->GetParentWindowOuter();
 
     // Propagate the privacy & fission status of the parent window, if
     // available, to the child.
     nsCOMPtr<nsILoadContext> parentContext = openingTab->GetLoadContext();
     if (parentContext) {
       isFissionWindow = parentContext->UseRemoteSubframes();
       isPrivateBrowsingWindow =
--- a/widget/nsBaseDragService.cpp
+++ b/widget/nsBaseDragService.cpp
@@ -561,18 +561,19 @@ nsresult nsBaseDragService::DrawDrag(nsI
   }
 
   *aPresContext = presShell->GetPresContext();
 
   RefPtr<nsFrameLoaderOwner> flo = do_QueryObject(dragNode);
   if (flo) {
     RefPtr<nsFrameLoader> fl = flo->GetFrameLoader();
     if (fl) {
-      auto* bp = fl->GetBrowserParent();
-      if (bp && bp->TakeDragVisualization(*aSurface, aScreenDragRect)) {
+      auto* tp =
+          static_cast<mozilla::dom::BrowserParent*>(fl->GetRemoteBrowser());
+      if (tp && tp->TakeDragVisualization(*aSurface, aScreenDragRect)) {
         if (mImage) {
           // Just clear the surface if chrome has overridden it with an image.
           *aSurface = nullptr;
         }
 
         return NS_OK;
       }
     }
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -54,17 +54,16 @@
 #include "prenv.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/dom/BarProps.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/ScriptSettings.h"
-#include "mozilla/dom/BrowserHost.h"
 #include "mozilla/dom/BrowserParent.h"
 
 #ifdef MOZ_NEW_XULSTORE
 #  include "mozilla/XULStore.h"
 #endif
 
 using namespace mozilla;
 using dom::AutoNoJSAPI;
@@ -348,18 +347,19 @@ nsXULWindow::GetOuterToInnerWidthDiffere
   *aResult = GetOuterToInnerSizeDifferenceInCSSPixels(mWindow).width;
   return NS_OK;
 }
 
 nsTArray<RefPtr<mozilla::LiveResizeListener>>
 nsXULWindow::GetLiveResizeListeners() {
   nsTArray<RefPtr<mozilla::LiveResizeListener>> listeners;
   if (mPrimaryBrowserParent) {
-    BrowserHost* host = BrowserHost::GetFrom(mPrimaryBrowserParent.get());
-    listeners.AppendElement(host->GetActor());
+    BrowserParent* parent =
+        static_cast<BrowserParent*>(mPrimaryBrowserParent.get());
+    listeners.AppendElement(parent);
   }
   return listeners;
 }
 
 NS_IMETHODIMP nsXULWindow::AddChildWindow(nsIXULWindow* aChild) {
   // we're not really keeping track of this right now
   return NS_OK;
 }
@@ -1859,19 +1859,19 @@ nsXULWindow::GetPrimaryContentSize(int32
   } else if (mPrimaryContentShell) {
     return GetPrimaryContentShellSize(aWidth, aHeight);
   }
   return NS_ERROR_UNEXPECTED;
 }
 
 nsresult nsXULWindow::GetPrimaryRemoteTabSize(int32_t* aWidth,
                                               int32_t* aHeight) {
-  BrowserHost* host = BrowserHost::GetFrom(mPrimaryBrowserParent.get());
+  BrowserParent* browserParent = BrowserParent::GetFrom(mPrimaryBrowserParent);
   // Need strong ref, since Client* can run script.
-  nsCOMPtr<Element> element = host->GetOwnerElement();
+  nsCOMPtr<Element> element = browserParent->GetOwnerElement();
   NS_ENSURE_STATE(element);
 
   *aWidth = element->ClientWidth();
   *aHeight = element->ClientHeight();
   return NS_OK;
 }
 
 nsresult nsXULWindow::GetPrimaryContentShellSize(int32_t* aWidth,