Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future audit burndown. r=nika
authorKannan Vijayan <kvijayan@mozilla.com>
Fri, 26 Jul 2019 16:48:31 +0000
changeset 484903 f2d3ccb209c52f9fe15697bb44aa81db5f391185
parent 484902 226098b73429a4ad79f3916ee8c01fc9b4cb963a
child 484904 90a13bb83261b6af8f77b71112818e00642e52b8
push id113785
push userbtara@mozilla.com
push dateFri, 26 Jul 2019 21:44:19 +0000
treeherdermozilla-inbound@7c83496f6c48 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1559414
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future audit burndown. r=nika Differential Revision: https://phabricator.services.mozilla.com/D39378
accessible/android/DocAccessibleWrap.cpp
accessible/base/DocManager.cpp
accessible/base/Logging.cpp
accessible/base/nsAccUtils.cpp
accessible/base/nsCoreUtils.cpp
accessible/generic/Accessible.cpp
accessible/generic/DocAccessible.cpp
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsDocShellEnumerator.cpp
docshell/base/nsDocShellTreeOwner.cpp
docshell/base/nsIDocShell.idl
docshell/base/nsIDocShellTreeItem.idl
docshell/shistory/nsSHistory.cpp
dom/audiochannel/AudioChannelAgent.cpp
dom/audiochannel/AudioChannelService.cpp
dom/base/DocGroup.cpp
dom/base/Document.cpp
dom/base/Document.h
dom/base/PostMessageEvent.cpp
dom/base/ScreenOrientation.cpp
dom/base/TabGroup.cpp
dom/base/ThirdPartyUtil.cpp
dom/base/nsCCUncollectableMarker.cpp
dom/base/nsContentPermissionHelper.cpp
dom/base/nsContentUtils.cpp
dom/base/nsDOMNavigationTiming.cpp
dom/base/nsFocusManager.cpp
dom/base/nsFrameLoader.cpp
dom/base/nsGlobalWindowInner.cpp
dom/base/nsGlobalWindowInner.h
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsGlobalWindowOuter.h
dom/base/nsHistory.cpp
dom/base/nsJSEnvironment.cpp
dom/base/nsObjectLoadingContent.cpp
dom/base/nsPIDOMWindow.h
dom/base/nsScreen.cpp
dom/base/nsWindowMemoryReporter.cpp
dom/browser-element/BrowserElementParent.cpp
dom/events/EventStateManager.cpp
dom/html/HTMLCanvasElement.cpp
dom/html/HTMLFormElement.cpp
dom/html/HTMLMediaElement.cpp
dom/html/nsHTMLDocument.cpp
dom/ipc/ContentChild.cpp
dom/jsurl/nsJSProtocolHandler.cpp
dom/media/AutoplayPolicy.cpp
dom/media/BackgroundVideoDecodingPermissionObserver.cpp
dom/media/MediaManager.cpp
dom/media/eme/MediaKeys.cpp
dom/payments/PaymentRequest.cpp
dom/payments/PaymentRequestManager.cpp
dom/performance/PerformanceTiming.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/presentation/PresentationRequest.cpp
dom/script/ScriptLoader.cpp
dom/security/FramingChecker.cpp
dom/security/nsCSPContext.cpp
dom/security/nsMixedContentBlocker.cpp
dom/system/nsDeviceSensors.cpp
dom/websocket/WebSocket.cpp
dom/workers/WorkerDebugger.cpp
dom/workers/WorkerPrivate.cpp
dom/xhr/XMLHttpRequestMainThread.cpp
dom/xul/XULPersist.cpp
editor/spellchecker/EditorSpellCheck.cpp
image/ImageCacheKey.cpp
layout/base/AccessibleCaretEventHub.cpp
layout/base/PresShell.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsDocumentViewer.cpp
layout/base/nsLayoutUtils.cpp
layout/base/nsPresContext.cpp
layout/generic/nsPluginFrame.cpp
layout/printing/PrintPreviewUserEventSuppressor.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsMediaFeatures.cpp
layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
layout/xul/nsXULPopupManager.cpp
netwerk/base/LoadInfo.cpp
parser/html/nsHtml5TreeOpExecutor.cpp
security/manager/ssl/nsSecureBrowserUIImpl.cpp
toolkit/components/antitracking/AntiTrackingCommon.cpp
toolkit/components/browser/nsWebBrowser.cpp
toolkit/components/extensions/ExtensionPolicyService.cpp
toolkit/components/extensions/WebExtensionPolicy.cpp
toolkit/components/satchel/nsFormFillController.cpp
toolkit/components/sessionstore/SessionStoreUtils.cpp
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
toolkit/components/windowwatcher/nsWindowWatcher.cpp
toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
uriloader/base/nsDocLoader.cpp
widget/SharedWidgetUtils.cpp
--- a/accessible/android/DocAccessibleWrap.cpp
+++ b/accessible/android/DocAccessibleWrap.cpp
@@ -24,17 +24,17 @@ const uint32_t kCacheRefreshInterval = 5
 // DocAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
 DocAccessibleWrap::DocAccessibleWrap(Document* aDocument, PresShell* aPresShell)
     : DocAccessible(aDocument, aPresShell) {
   nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocument->GetDocShell());
 
   nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
-  treeItem->GetParent(getter_AddRefs(parentTreeItem));
+  treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem));
 
   if (treeItem->ItemType() == nsIDocShellTreeItem::typeContent &&
       (!parentTreeItem ||
        parentTreeItem->ItemType() == nsIDocShellTreeItem::typeChrome)) {
     // The top-level content document gets this special ID.
     mID = kNoID;
   } else {
     mID = AcquireID();
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -444,17 +444,17 @@ DocAccessible* DocManager::CreateDocOrRo
   }
 
   bool isRootDoc = nsCoreUtils::IsRootDocument(aDocument);
 
   DocAccessible* parentDocAcc = nullptr;
   if (!isRootDoc) {
     // XXXaaronl: ideally we would traverse the presshell chain. Since there's
     // no easy way to do that, we cheat and use the document hierarchy.
-    parentDocAcc = GetDocAccessible(aDocument->GetParentDocument());
+    parentDocAcc = GetDocAccessible(aDocument->GetInProcessParentDocument());
     NS_ASSERTION(parentDocAcc, "Can't create an accessible for the document!");
     if (!parentDocAcc) return nullptr;
   }
 
   // We only create root accessibles for the true root, otherwise create a
   // doc accessible.
   RefPtr<DocAccessible> docAcc =
       isRootDoc ? new RootAccessibleWrap(aDocument, presShell)
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -116,17 +116,17 @@ static void LogDocType(dom::Document* aD
     printf("document type: [failed]");
   }
 }
 
 static void LogDocShellTree(dom::Document* aDocumentNode) {
   if (aDocumentNode->IsActive()) {
     nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell());
     nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
-    treeItem->GetParent(getter_AddRefs(parentTreeItem));
+    treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem));
     nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
     treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
     printf("docshell hierarchy, parent: %p, root: %p, is tab document: %s;",
            static_cast<void*>(parentTreeItem), static_cast<void*>(rootTreeItem),
            (nsCoreUtils::IsTabDocument(aDocumentNode) ? "yes" : "no"));
   }
 }
 
@@ -177,17 +177,17 @@ static void LogPresShell(dom::Document* 
 }
 
 static void LogDocLoadGroup(dom::Document* aDocumentNode) {
   nsCOMPtr<nsILoadGroup> loadGroup = aDocumentNode->GetDocumentLoadGroup();
   printf("load group: %p", static_cast<void*>(loadGroup));
 }
 
 static void LogDocParent(dom::Document* aDocumentNode) {
-  dom::Document* parentDoc = aDocumentNode->GetParentDocument();
+  dom::Document* parentDoc = aDocumentNode->GetInProcessParentDocument();
   printf("parent DOM document: %p", static_cast<void*>(parentDoc));
   if (parentDoc) {
     printf(", parent acc document: %p",
            static_cast<void*>(GetExistingDocAccessible(parentDoc)));
     printf("\n    parent ");
     LogDocURI(parentDoc);
     printf("\n");
   }
--- a/accessible/base/nsAccUtils.cpp
+++ b/accessible/base/nsAccUtils.cpp
@@ -506,22 +506,23 @@ bool nsAccUtils::IsARIALive(const Access
 
     // Allow ARIA live region markup from outer documents to override.
     nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = doc->GetDocShell();
     if (!docShellTreeItem) {
       break;
     }
 
     nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
-    docShellTreeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
+    docShellTreeItem->GetInProcessSameTypeParent(
+        getter_AddRefs(sameTypeParent));
     if (!sameTypeParent || sameTypeParent == docShellTreeItem) {
       break;
     }
 
-    dom::Document* parentDoc = doc->GetParentDocument();
+    dom::Document* parentDoc = doc->GetInProcessParentDocument();
     if (!parentDoc) {
       break;
     }
 
     startContent = parentDoc->FindContentForSubDocument(doc);
   }
 
   return !live.IsEmpty() && !live.EqualsLiteral("off");
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -337,33 +337,33 @@ already_AddRefed<nsIDocShell> nsCoreUtil
   return docShell.forget();
 }
 
 bool nsCoreUtils::IsRootDocument(Document* aDocument) {
   nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell();
   NS_ASSERTION(docShellTreeItem, "No document shell for document!");
 
   nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
-  docShellTreeItem->GetParent(getter_AddRefs(parentTreeItem));
+  docShellTreeItem->GetInProcessParent(getter_AddRefs(parentTreeItem));
 
   return !parentTreeItem;
 }
 
 bool nsCoreUtils::IsContentDocument(Document* aDocument) {
   nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = aDocument->GetDocShell();
   NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!");
 
   return (docShellTreeItem->ItemType() == nsIDocShellTreeItem::typeContent);
 }
 
 bool nsCoreUtils::IsTabDocument(Document* aDocumentNode) {
   nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocumentNode->GetDocShell());
 
   nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
-  treeItem->GetParent(getter_AddRefs(parentTreeItem));
+  treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem));
 
   // Tab document running in own process doesn't have parent.
   if (XRE_IsContentProcess()) return !parentTreeItem;
 
   // Parent of docshell for tab document running in chrome process is root.
   nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
   treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
 
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -1072,20 +1072,21 @@ already_AddRefed<nsIPersistentProperties
     nsAccUtils::SetLiveContainerAttributes(attributes, startContent,
                                            doc->GetRootElement());
 
     // Allow ARIA live region markup from outer documents to override
     nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = doc->GetDocShell();
     if (!docShellTreeItem) break;
 
     nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
-    docShellTreeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
+    docShellTreeItem->GetInProcessSameTypeParent(
+        getter_AddRefs(sameTypeParent));
     if (!sameTypeParent || sameTypeParent == docShellTreeItem) break;
 
-    dom::Document* parentDoc = doc->GetParentDocument();
+    dom::Document* parentDoc = doc->GetInProcessParentDocument();
     if (!parentDoc) break;
 
     startContent = parentDoc->FindContentForSubDocument(doc);
   }
 
   if (!mContent->IsElement()) return attributes.forget();
 
   nsAutoString id;
@@ -1783,17 +1784,17 @@ Relation Accessible::RelationByType(Rela
       return Relation(mDoc);
 
     case RelationType::CONTAINING_TAB_PANE: {
       nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(GetNode());
       if (docShell) {
         // Walk up the parent chain without crossing the boundary at which item
         // types change, preventing us from walking up out of tab content.
         nsCOMPtr<nsIDocShellTreeItem> root;
-        docShell->GetSameTypeRootTreeItem(getter_AddRefs(root));
+        docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
         if (root) {
           // If the item type is typeContent, we assume we are in browser tab
           // content. Note, this includes content such as about:addons,
           // for consistency.
           if (root->ItemType() == nsIDocShellTreeItem::typeContent) {
             return Relation(nsAccUtils::GetDocAccessibleFor(root));
           }
         }
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -188,17 +188,17 @@ ENameValueFlag DocAccessible::Name(nsStr
   return eNameOK;
 }
 
 // Accessible public method
 role DocAccessible::NativeRole() const {
   nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(mDocumentNode);
   if (docShell) {
     nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
-    docShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
+    docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
     int32_t itemType = docShell->ItemType();
     if (sameTypeRoot == docShell) {
       // Root of content or chrome tree
       if (itemType == nsIDocShellTreeItem::typeChrome)
         return roles::CHROME_WINDOW;
 
       if (itemType == nsIDocShellTreeItem::typeContent) {
 #ifdef MOZ_XUL
@@ -493,17 +493,17 @@ nsRect DocAccessible::RelativeBounds(nsI
       // this document, but we're intersecting rectangles derived from
       // multiple documents and assuming they're all in the same coordinate
       // system. See bug 514117.
       bounds.IntersectRect(scrollPort, bounds);
     } else {  // First time through loop
       bounds = scrollPort;
     }
 
-    document = parentDoc = document->GetParentDocument();
+    document = parentDoc = document->GetInProcessParentDocument();
   }
 
   return bounds;
 }
 
 // DocAccessible protected member
 nsresult DocAccessible::AddEventListeners() {
   nsCOMPtr<nsIDocShell> docShell(mDocumentNode->GetDocShell());
@@ -2271,17 +2271,17 @@ void DocAccessible::ShutdownChildrenInSu
   UnbindFromDocument(aAccessible);
 }
 
 bool DocAccessible::IsLoadEventTarget() const {
   nsCOMPtr<nsIDocShellTreeItem> treeItem = mDocumentNode->GetDocShell();
   NS_ASSERTION(treeItem, "No document shell for document!");
 
   nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
-  treeItem->GetParent(getter_AddRefs(parentTreeItem));
+  treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem));
 
   // Not a root document.
   if (parentTreeItem) {
     // Return true if it's either:
     // a) tab document;
     nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
     treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
     if (parentTreeItem == rootTreeItem) return true;
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -774,17 +774,17 @@ nsDocShell::LoadURI(nsDocShellLoadState*
   return InternalLoad(aLoadState,
                       nullptr,   // no nsIDocShell
                       nullptr);  // no nsIRequest
 }
 
 void nsDocShell::MaybeHandleSubframeHistory(nsDocShellLoadState* aLoadState) {
   // First, verify if this is a subframe.
   nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
-  GetSameTypeParent(getter_AddRefs(parentAsItem));
+  GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
   nsCOMPtr<nsIDocShell> parentDS(do_QueryInterface(parentAsItem));
 
   if (!parentDS || parentDS == static_cast<nsIDocShell*>(this)) {
     // This is the root docshell. If we got here while
     // executing an onLoad Handler,this load will not go
     // into session history.
     bool inOnLoadHandler = false;
     GetIsExecutingOnLoadHandler(&inOnLoadHandler);
@@ -1207,17 +1207,17 @@ bool nsDocShell::SetCurrentURI(nsIURI* a
     mHasLoadedNonBlankURI = true;
   }
 
   bool isRoot = false;      // Is this the root docshell
   bool isSubFrame = false;  // Is this a subframe navigation?
 
   nsCOMPtr<nsIDocShellTreeItem> root;
 
-  GetSameTypeRootTreeItem(getter_AddRefs(root));
+  GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
   if (root.get() == static_cast<nsIDocShellTreeItem*>(this)) {
     // This is the root docshell
     isRoot = true;
   }
   if (mLSHE) {
     isSubFrame = mLSHE->GetIsSubFrame();
   }
 
@@ -1847,17 +1847,17 @@ nsDocShell::GetFullscreenAllowed(bool* a
         return NS_OK;
       }
     }
   }
 
   // If we have no parent then we're the root docshell; no ancestor of the
   // original docshell doesn't have a allowfullscreen attribute, so
   // report fullscreen as allowed.
-  RefPtr<nsDocShell> parent = GetParentDocshell();
+  RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
   if (!parent) {
     *aFullscreenAllowed = true;
     return NS_OK;
   }
 
   // Otherwise, we have a parent, continue the checking for
   // mozFullscreenAllowed in the parent docshell's ancestors.
   return parent->GetFullscreenAllowed(aFullscreenAllowed);
@@ -2210,46 +2210,46 @@ nsresult nsDocShell::PopProfileTimelineM
 
 nsresult nsDocShell::Now(DOMHighResTimeStamp* aWhen) {
   *aWhen = (TimeStamp::Now() - TimeStamp::ProcessCreation()).ToMilliseconds();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::SetWindowDraggingAllowed(bool aValue) {
-  RefPtr<nsDocShell> parent = GetParentDocshell();
+  RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
   if (!aValue && mItemType == typeChrome && !parent) {
     // Window dragging is always allowed for top level
     // chrome docshells.
     return NS_ERROR_FAILURE;
   }
   mWindowDraggingAllowed = aValue;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetWindowDraggingAllowed(bool* aValue) {
   // window dragging regions in CSS (-moz-window-drag:drag)
   // can be slow. Default behavior is to only allow it for
   // chrome top level windows.
-  RefPtr<nsDocShell> parent = GetParentDocshell();
+  RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
   if (mItemType == typeChrome && !parent) {
     // Top level chrome window
     *aValue = true;
   } else {
     *aValue = mWindowDraggingAllowed;
   }
   return NS_OK;
 }
 
 nsIDOMStorageManager* nsDocShell::TopSessionStorageManager() {
   nsresult rv;
 
   nsCOMPtr<nsIDocShellTreeItem> topItem;
-  rv = GetSameTypeRootTreeItem(getter_AddRefs(topItem));
+  rv = GetInProcessSameTypeRootTreeItem(getter_AddRefs(topItem));
   if (NS_FAILED(rv)) {
     return nullptr;
   }
 
   if (!topItem) {
     return nullptr;
   }
 
@@ -2457,28 +2457,35 @@ nsDocShell::GetItemType(int32_t* aItemTy
 
   MOZ_DIAGNOSTIC_ASSERT(
       (mBrowsingContext->IsContent() ? typeContent : typeChrome) == mItemType);
   *aItemType = mItemType;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocShell::GetParent(nsIDocShellTreeItem** aParent) {
+nsDocShell::GetInProcessParent(nsIDocShellTreeItem** aParent) {
   if (!mParent) {
     *aParent = nullptr;
   } else {
     CallQueryInterface(mParent, aParent);
   }
   // Note that in the case when the parent is not an nsIDocShellTreeItem we
   // don't want to throw; we just want to return null.
   return NS_OK;
 }
 
-already_AddRefed<nsDocShell> nsDocShell::GetParentDocshell() {
+// With Fission, related nsDocShell objects may exist in a different process. In
+// that case, this method will return `nullptr`, despite a parent nsDocShell
+// object existing.
+//
+// Prefer using `BrowsingContext::Parent()`, which will succeed even if the
+// parent entry is not in the current process, and handle the case where the
+// parent nsDocShell is inaccessible.
+already_AddRefed<nsDocShell> nsDocShell::GetInProcessParentDocshell() {
   nsCOMPtr<nsIDocShell> docshell = do_QueryInterface(GetAsSupports(mParent));
   return docshell.forget().downcast<nsDocShell>();
 }
 
 void nsDocShell::MaybeCreateInitialClientSource(nsIPrincipal* aPrincipal) {
   MOZ_ASSERT(!mIsBeingDestroyed);
 
   // If there is an existing document then there is no need to create
@@ -2529,17 +2536,17 @@ void nsDocShell::MaybeCreateInitialClien
 
   // Mark the initial client as execution ready, but owned by the docshell.
   // If the client is actually used this will cause ClientSource to force
   // the creation of the initial about:blank by calling
   // nsDocShell::GetDocument().
   mInitialClientSource->DocShellExecutionReady(this);
 
   // Next, check to see if the parent is controlled.
-  nsCOMPtr<nsIDocShell> parent = GetParentDocshell();
+  nsCOMPtr<nsIDocShell> parent = GetInProcessParentDocshell();
   nsPIDOMWindowOuter* parentOuter = parent ? parent->GetWindow() : nullptr;
   nsPIDOMWindowInner* parentInner =
       parentOuter ? parentOuter->GetCurrentInnerWindow() : nullptr;
   if (!parentInner) {
     return;
   }
 
   nsCOMPtr<nsIURI> uri;
@@ -2572,17 +2579,17 @@ Maybe<ClientInfo> nsDocShell::GetInitial
     return Maybe<ClientInfo>();
   }
 
   return innerWindow->GetClientInfo();
 }
 
 void nsDocShell::RecomputeCanExecuteScripts() {
   bool old = mCanExecuteScripts;
-  RefPtr<nsDocShell> parent = GetParentDocshell();
+  RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
 
   // If we have no tree owner, that means that we've been detached from the
   // docshell tree (this is distinct from having no parent docshell, which
   // is the case for root docshells). It would be nice to simply disallow
   // script in detached docshells, but bug 986542 demonstrates that this
   // behavior breaks at least one website.
   //
   // So instead, we use our previous value, unless mAllowJavascript has been
@@ -2736,17 +2743,17 @@ void nsDocShell::MaybeClearStorageAccess
       if (child) {
         static_cast<nsDocShell*>(child.get())->MaybeClearStorageAccessFlag();
       }
     }
   }
 }
 
 NS_IMETHODIMP
-nsDocShell::GetSameTypeParent(nsIDocShellTreeItem** aParent) {
+nsDocShell::GetInProcessSameTypeParent(nsIDocShellTreeItem** aParent) {
   NS_ENSURE_ARG_POINTER(aParent);
   *aParent = nullptr;
 
   if (nsIDocShell::GetIsMozBrowser()) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> parent =
@@ -2779,38 +2786,39 @@ nsDocShell::GetSameTypeParentIgnoreBrows
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetRootTreeItem(nsIDocShellTreeItem** aRootTreeItem) {
   NS_ENSURE_ARG_POINTER(aRootTreeItem);
 
   RefPtr<nsDocShell> root = this;
-  RefPtr<nsDocShell> parent = root->GetParentDocshell();
+  RefPtr<nsDocShell> parent = root->GetInProcessParentDocshell();
   while (parent) {
     root = parent;
-    parent = root->GetParentDocshell();
+    parent = root->GetInProcessParentDocshell();
   }
 
   root.forget(aRootTreeItem);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocShell::GetSameTypeRootTreeItem(nsIDocShellTreeItem** aRootTreeItem) {
+nsDocShell::GetInProcessSameTypeRootTreeItem(
+    nsIDocShellTreeItem** aRootTreeItem) {
   NS_ENSURE_ARG_POINTER(aRootTreeItem);
   *aRootTreeItem = static_cast<nsIDocShellTreeItem*>(this);
 
   nsCOMPtr<nsIDocShellTreeItem> parent;
-  NS_ENSURE_SUCCESS(GetSameTypeParent(getter_AddRefs(parent)),
+  NS_ENSURE_SUCCESS(GetInProcessSameTypeParent(getter_AddRefs(parent)),
                     NS_ERROR_FAILURE);
   while (parent) {
     *aRootTreeItem = parent;
     NS_ENSURE_SUCCESS(
-        (*aRootTreeItem)->GetSameTypeParent(getter_AddRefs(parent)),
+        (*aRootTreeItem)->GetInProcessSameTypeParent(getter_AddRefs(parent)),
         NS_ERROR_FAILURE);
   }
   NS_ADDREF(*aRootTreeItem);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetSameTypeRootTreeItemIgnoreBrowserBoundaries(
@@ -2879,21 +2887,22 @@ bool nsDocShell::CanAccessItem(nsIDocShe
   }
 
   if (targetDS->GetIsInIsolatedMozBrowserElement() !=
       accessingDS->GetIsInIsolatedMozBrowserElement()) {
     return false;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> accessingRoot;
-  aAccessingItem->GetSameTypeRootTreeItem(getter_AddRefs(accessingRoot));
+  aAccessingItem->GetInProcessSameTypeRootTreeItem(
+      getter_AddRefs(accessingRoot));
   nsCOMPtr<nsIDocShell> accessingRootDS = do_QueryInterface(accessingRoot);
 
   nsCOMPtr<nsIDocShellTreeItem> targetRoot;
-  aTargetItem->GetSameTypeRootTreeItem(getter_AddRefs(targetRoot));
+  aTargetItem->GetInProcessSameTypeRootTreeItem(getter_AddRefs(targetRoot));
   nsCOMPtr<nsIDocShell> targetRootDS = do_QueryInterface(targetRoot);
 
   OriginAttributes targetOA =
       static_cast<nsDocShell*>(targetDS.get())->GetOriginAttributes();
   OriginAttributes accessingOA =
       static_cast<nsDocShell*>(accessingDS.get())->GetOriginAttributes();
 
   // When the first party isolation is on, the top-level docShell may not have
@@ -2945,17 +2954,17 @@ bool nsDocShell::CanAccessItem(nsIDocShe
   // Check if aAccessingItem can navigate one of aTargetItem's ancestors.
   nsCOMPtr<nsIDocShellTreeItem> target = aTargetItem;
   do {
     if (ValidateOrigin(aAccessingItem, target)) {
       return true;
     }
 
     nsCOMPtr<nsIDocShellTreeItem> parent;
-    target->GetSameTypeParent(getter_AddRefs(parent));
+    target->GetInProcessSameTypeParent(getter_AddRefs(parent));
     parent.swap(target);
   } while (target);
 
   if (aTargetItem != targetRoot) {
     // target is a subframe, not in accessor's frame hierarchy, and all its
     // ancestors have origins different from that of the accessor. Don't
     // allow access.
     return false;
@@ -3022,22 +3031,22 @@ nsDocShell::FindItemWithName(const nsASt
     nsCOMPtr<nsIDocShellTreeItem> foundItem;
     if (aName.LowerCaseEqualsLiteral("_self")) {
       foundItem = this;
     } else if (aName.LowerCaseEqualsLiteral("_blank")) {
       // Just return null.  Caller must handle creating a new window with
       // a blank name himself.
       return NS_OK;
     } else if (aName.LowerCaseEqualsLiteral("_parent")) {
-      GetSameTypeParent(getter_AddRefs(foundItem));
+      GetInProcessSameTypeParent(getter_AddRefs(foundItem));
       if (!foundItem) {
         foundItem = this;
       }
     } else if (aName.LowerCaseEqualsLiteral("_top")) {
-      GetSameTypeRootTreeItem(getter_AddRefs(foundItem));
+      GetInProcessSameTypeRootTreeItem(getter_AddRefs(foundItem));
       NS_ASSERTION(foundItem, "Must have this; worst case it's us!");
     } else {
       // Do the search for item by an actual name.
       DoFindItemWithName(aName, aRequestor, aOriginalRequestor, aSkipTabGroup,
                          getter_AddRefs(foundItem));
     }
 
     if (foundItem && !CanAccessItem(foundItem, aOriginalRequestor)) {
@@ -3098,18 +3107,18 @@ nsresult nsDocShell::DoFindItemWithName(
   nsCOMPtr<nsIDocShellTreeItem> parentAsTreeItem =
       do_QueryInterface(GetAsSupports(mParent));
   if (parentAsTreeItem) {
     if (parentAsTreeItem == aRequestor) {
       return NS_OK;
     }
 
     // If we have a same-type parent, respecting browser and app boundaries.
-    // NOTE: Could use GetSameTypeParent if the issues described in bug 1310344
-    // are fixed.
+    // NOTE: Could use GetInProcessSameTypeParent if the issues described in
+    // bug 1310344 are fixed.
     if (!GetIsMozBrowser() && parentAsTreeItem->ItemType() == mItemType) {
       return parentAsTreeItem->FindItemWithName(aName, this, aOriginalRequestor,
                                                 /* aSkipTabGroup = */ false,
                                                 aResult);
     }
   }
 
   // If we have a null parent or the parent is not of the same type, we need to
@@ -3146,25 +3155,26 @@ bool nsDocShell::IsSandboxedFrom(nsIDocS
 
   // If no flags, we are not sandboxed at all.
   if (!sandboxFlags) {
     return false;
   }
 
   // If aTargetDocShell has an ancestor, it is not top level.
   nsCOMPtr<nsIDocShellTreeItem> ancestorOfTarget;
-  aTargetDocShell->GetSameTypeParent(getter_AddRefs(ancestorOfTarget));
+  aTargetDocShell->GetInProcessSameTypeParent(getter_AddRefs(ancestorOfTarget));
   if (ancestorOfTarget) {
     do {
       // We are not sandboxed if we are an ancestor of target.
       if (ancestorOfTarget == this) {
         return false;
       }
       nsCOMPtr<nsIDocShellTreeItem> tempTreeItem;
-      ancestorOfTarget->GetSameTypeParent(getter_AddRefs(tempTreeItem));
+      ancestorOfTarget->GetInProcessSameTypeParent(
+          getter_AddRefs(tempTreeItem));
       tempTreeItem.swap(ancestorOfTarget);
     } while (ancestorOfTarget);
 
     // Otherwise, we are sandboxed from aTargetDocShell.
     return true;
   }
 
   // aTargetDocShell is top level, are we the "one permitted sandboxed
@@ -3175,17 +3185,17 @@ bool nsDocShell::IsSandboxedFrom(nsIDocS
   if (permittedNavigator == this) {
     return false;
   }
 
   // If SANDBOXED_TOPLEVEL_NAVIGATION flag is not on, we are not sandboxed
   // from our top.
   if (!(sandboxFlags & SANDBOXED_TOPLEVEL_NAVIGATION)) {
     nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
-    GetSameTypeRootTreeItem(getter_AddRefs(rootTreeItem));
+    GetInProcessSameTypeRootTreeItem(getter_AddRefs(rootTreeItem));
     if (SameCOMIdentity(aTargetDocShell, rootTreeItem)) {
       return false;
     }
   }
 
   // Otherwise, we are sandboxed from aTargetDocShell.
   return true;
 }
@@ -3287,17 +3297,17 @@ const nsID nsDocShell::HistoryID() { ret
 
 NS_IMETHODIMP
 nsDocShell::GetIsInUnload(bool* aIsInUnload) {
   *aIsInUnload = mFiredUnloadEvent;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocShell::GetChildCount(int32_t* aChildCount) {
+nsDocShell::GetInProcessChildCount(int32_t* aChildCount) {
   NS_ENSURE_ARG_POINTER(aChildCount);
   *aChildCount = mChildList.Length();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::AddChild(nsIDocShellTreeItem* aChild) {
   NS_ENSURE_ARG_POINTER(aChild);
@@ -3409,17 +3419,17 @@ nsDocShell::RemoveChild(nsIDocShellTreeI
   NS_ENSURE_SUCCESS(rv, rv);
 
   aChild->SetTreeOwner(nullptr);
 
   return nsDocLoader::AddDocLoaderAsChildOfRoot(childAsDocLoader);
 }
 
 NS_IMETHODIMP
-nsDocShell::GetChildAt(int32_t aIndex, nsIDocShellTreeItem** aChild) {
+nsDocShell::GetInProcessChildAt(int32_t aIndex, nsIDocShellTreeItem** aChild) {
   NS_ENSURE_ARG_POINTER(aChild);
 
 #ifdef DEBUG
   if (aIndex < 0) {
     NS_WARNING("Negative index passed to GetChildAt");
   } else if (static_cast<uint32_t>(aIndex) >= mChildList.Length()) {
     NS_WARNING("Too large an index passed to GetChildAt");
   }
@@ -3659,17 +3669,17 @@ NS_IMETHODIMP
 nsDocShell::GetUseGlobalHistory(bool* aUseGlobalHistory) {
   *aUseGlobalHistory = mUseGlobalHistory;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::RemoveFromSessionHistory() {
   nsCOMPtr<nsIDocShellTreeItem> root;
-  GetSameTypeRootTreeItem(getter_AddRefs(root));
+  GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
   nsCOMPtr<nsIWebNavigation> rootAsWebnav = do_QueryInterface(root);
   if (!rootAsWebnav) {
     return NS_OK;
   }
   RefPtr<ChildSHistory> sessionHistory = rootAsWebnav->GetSessionHistory();
   if (!sessionHistory) {
     return NS_OK;
   }
@@ -4809,17 +4819,17 @@ nsDocShell::GetCurrentURI(nsIURI** aURI)
 
 NS_IMETHODIMP
 nsDocShell::InitSessionHistory() {
   MOZ_ASSERT(!mIsBeingDestroyed);
 
   // Make sure that we are the root DocShell, and set a handle to root docshell
   // in the session history.
   nsCOMPtr<nsIDocShellTreeItem> root;
-  GetSameTypeRootTreeItem(getter_AddRefs(root));
+  GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
   if (root != this) {
     return NS_ERROR_FAILURE;
   }
 
   mSessionHistory = new ChildSHistory(this);
   return NS_OK;
 }
 
@@ -5322,17 +5332,17 @@ nsDocShell::GetVisibility(bool* aVisibil
     return NS_OK;
   }
 
   // otherwise, we must walk up the document and view trees checking
   // for a hidden view, unless we're an off screen browser, which
   // would make this test meaningless.
 
   RefPtr<nsDocShell> docShell = this;
-  RefPtr<nsDocShell> parentItem = docShell->GetParentDocshell();
+  RefPtr<nsDocShell> parentItem = docShell->GetInProcessParentDocshell();
   while (parentItem) {
     // Null-check for crash in bug 267804
     if (!parentItem->GetPresShell()) {
       MOZ_ASSERT_UNREACHABLE("parent docshell has null pres shell");
       return NS_OK;
     }
 
     vm = docShell->GetPresShell()->GetViewManager();
@@ -5353,17 +5363,17 @@ nsDocShell::GetVisibility(bool* aVisibil
     if (frame &&
         !frame->IsVisibleConsideringAncestors(
             nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY) &&
         !isDocShellOffScreen) {
       return NS_OK;
     }
 
     docShell = parentItem;
-    parentItem = docShell->GetParentDocshell();
+    parentItem = docShell->GetInProcessParentDocshell();
   }
 
   nsCOMPtr<nsIBaseWindow> treeOwnerAsWin(do_QueryInterface(mTreeOwner));
   if (!treeOwnerAsWin) {
     *aVisibility = true;
     return NS_OK;
   }
 
@@ -5401,17 +5411,17 @@ nsDocShell::SetIsActive(bool aIsActive) 
 
   // Tell the window about it
   if (mScriptGlobal) {
     mScriptGlobal->SetIsBackground(!aIsActive);
     if (RefPtr<Document> doc = mScriptGlobal->GetExtantDoc()) {
       // Update orientation when the top-level browsing context becomes active.
       if (aIsActive) {
         nsCOMPtr<nsIDocShellTreeItem> parent;
-        GetSameTypeParent(getter_AddRefs(parent));
+        GetInProcessSameTypeParent(getter_AddRefs(parent));
         if (!parent) {
           // We only care about the top-level browsing context.
           uint16_t orientation = OrientationLock();
           ScreenOrientation::UpdateActiveOrientationLock(orientation);
         }
       }
 
       doc->PostVisibilityUpdateEvent();
@@ -5551,17 +5561,17 @@ nsDocShell::GetDefaultLoadFlags(uint32_t
 
 NS_IMETHODIMP
 nsDocShell::SetMixedContentChannel(nsIChannel* aMixedContentChannel) {
 #ifdef DEBUG
   // if the channel is non-null
   if (aMixedContentChannel) {
     // Get the root docshell.
     nsCOMPtr<nsIDocShellTreeItem> root;
-    GetSameTypeRootTreeItem(getter_AddRefs(root));
+    GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
     NS_WARNING_ASSERTION(root.get() == static_cast<nsIDocShellTreeItem*>(this),
                          "Setting mMixedContentChannel on a docshell that is "
                          "not the root docshell");
   }
 #endif
   mMixedContentChannel = aMixedContentChannel;
   return NS_OK;
 }
@@ -5589,17 +5599,17 @@ NS_IMETHODIMP
 nsDocShell::GetAllowMixedContentAndConnectionData(
     bool* aRootHasSecureConnection, bool* aAllowMixedContent,
     bool* aIsRootDocShell) {
   *aRootHasSecureConnection = true;
   *aAllowMixedContent = false;
   *aIsRootDocShell = false;
 
   nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
-  GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
+  GetInProcessSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
   NS_ASSERTION(
       sameTypeRoot,
       "No document shell root tree item from document shell tree item!");
   *aIsRootDocShell =
       sameTypeRoot.get() == static_cast<nsIDocShellTreeItem*>(this);
 
   // now get the document from sameTypeRoot
   RefPtr<Document> rootDoc = sameTypeRoot->GetDocument();
@@ -5676,17 +5686,17 @@ nsDocShell::SetTitle(const nsAString& aT
     return NS_OK;
   }
 
   // Store local title
   mTitle = aTitle;
   mTitleValidForCurrentURI = true;
 
   nsCOMPtr<nsIDocShellTreeItem> parent;
-  GetSameTypeParent(getter_AddRefs(parent));
+  GetInProcessSameTypeParent(getter_AddRefs(parent));
 
   // When title is set on the top object it should then be passed to the
   // tree owner.
   if (!parent) {
     nsCOMPtr<nsIBaseWindow> treeOwnerAsWin(do_QueryInterface(mTreeOwner));
     if (treeOwnerAsWin) {
       treeOwnerAsWin->SetTitle(aTitle);
     }
@@ -6725,17 +6735,17 @@ nsresult nsDocShell::EndPageLoad(nsIWebP
   }
   // if there's a refresh header in the channel, this method
   // will set it up for us.
   if (mIsActive || !mDisableMetaRefreshWhenInactive) RefreshURIFromQueue();
 
   // Test whether this is the top frame or a subframe
   bool isTopFrame = true;
   nsCOMPtr<nsIDocShellTreeItem> targetParentTreeItem;
-  rv = GetSameTypeParent(getter_AddRefs(targetParentTreeItem));
+  rv = GetInProcessSameTypeParent(getter_AddRefs(targetParentTreeItem));
   if (NS_SUCCEEDED(rv) && targetParentTreeItem) {
     isTopFrame = false;
   }
 
   //
   // If the page load failed, then deal with the error condition...
   // Errors are handled as follows:
   //   1. Check to see if it's a file not found error or bad content
@@ -6769,17 +6779,17 @@ nsresult nsDocShell::EndPageLoad(nsIWebP
 
       frameElement = thisWindow->GetFrameElement();
       if (!frameElement) {
         return NS_OK;
       }
 
       // Parent window
       nsCOMPtr<nsIDocShellTreeItem> parentItem;
-      GetSameTypeParent(getter_AddRefs(parentItem));
+      GetInProcessSameTypeParent(getter_AddRefs(parentItem));
       if (!parentItem) {
         return NS_OK;
       }
 
       RefPtr<Document> parentDoc;
       parentDoc = parentItem->GetDocument();
       if (!parentDoc) {
         return NS_OK;
@@ -7010,17 +7020,17 @@ nsresult nsDocShell::EnsureContentViewer
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIContentSecurityPolicy> cspToInheritForAboutBlank;
   nsCOMPtr<nsIURI> baseURI;
   nsIPrincipal* principal = GetInheritedPrincipal(false);
   nsIPrincipal* storagePrincipal = GetInheritedPrincipal(false, true);
   nsCOMPtr<nsIDocShellTreeItem> parentItem;
-  GetSameTypeParent(getter_AddRefs(parentItem));
+  GetInProcessSameTypeParent(getter_AddRefs(parentItem));
   if (parentItem) {
     if (nsCOMPtr<nsPIDOMWindowOuter> domWin = GetWindow()) {
       nsCOMPtr<Element> parentElement = domWin->GetFrameElementInternal();
       if (parentElement) {
         baseURI = parentElement->GetBaseURI();
         cspToInheritForAboutBlank = parentElement->GetCsp();
       }
     }
@@ -7261,17 +7271,17 @@ bool nsDocShell::CanSavePresentation(uin
   // Avoid doing the work of saving the presentation state in the case where
   // the content viewer cache is disabled.
   if (nsSHistory::GetMaxTotalViewers() == 0) {
     return false;
   }
 
   // Don't cache the content viewer if we're in a subframe.
   nsCOMPtr<nsIDocShellTreeItem> root;
-  GetSameTypeParent(getter_AddRefs(root));
+  GetInProcessSameTypeParent(getter_AddRefs(root));
   if (root && root != this) {
     return false;  // this is a subframe load
   }
 
   // If the document does not want its presentation cached, then don't.
   RefPtr<Document> doc = mScriptGlobal->GetExtantDoc();
 
   uint16_t bfCacheCombo = 0;
@@ -7897,17 +7907,17 @@ nsresult nsDocShell::RestoreFromHistory(
   if (oldCv && newCv) {
     newCv->SetTextZoom(textZoom);
     newCv->SetFullZoom(pageZoom);
     newCv->SetOverrideDPPX(overrideDPPX);
     newCv->SetAuthorStyleDisabled(styleDisabled);
   }
 
   if (document) {
-    RefPtr<nsDocShell> parent = GetParentDocshell();
+    RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
     if (parent) {
       RefPtr<Document> d = parent->GetDocument();
       if (d) {
         if (d->EventHandlingSuppressed()) {
           document->SuppressEventHandling(d->EventHandlingSuppressed());
         }
       }
     }
@@ -8309,17 +8319,17 @@ nsresult nsDocShell::CreateContentViewer
   if (DocGroup::TryToLoadIframesInBackground()) {
     if ((!mContentViewer || GetDocument()->IsInitialDocument()) && IsFrame()) {
       // At this point, we know we just created a new iframe document based on
       // the response from the server, and we check if it's a cross-domain
       // iframe
 
       RefPtr<Document> newDoc = viewer->GetDocument();
 
-      RefPtr<nsDocShell> parent = GetParentDocshell();
+      RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
       nsCOMPtr<nsIPrincipal> parentPrincipal =
           parent->GetDocument()->NodePrincipal();
       nsCOMPtr<nsIPrincipal> thisPrincipal = newDoc->NodePrincipal();
 
       SiteIdentifier parentSite;
       SiteIdentifier thisSite;
 
       nsresult rv =
@@ -8440,17 +8450,17 @@ nsresult nsDocShell::SetupNewViewer(nsIC
   int32_t cx = 0;
   int32_t cy = 0;
 
   // This will get the size from the current content viewer or from the
   // Init settings
   DoGetPositionAndSize(&x, &y, &cx, &cy);
 
   nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
-  NS_ENSURE_SUCCESS(GetSameTypeParent(getter_AddRefs(parentAsItem)),
+  NS_ENSURE_SUCCESS(GetInProcessSameTypeParent(getter_AddRefs(parentAsItem)),
                     NS_ERROR_FAILURE);
   nsCOMPtr<nsIDocShell> parent(do_QueryInterface(parentAsItem));
 
   const Encoding* forceCharset = nullptr;
   const Encoding* hintCharset = nullptr;
   int32_t hintCharsetSource = kCharsetUninitialized;
   float textZoom = 1.0;
   float pageZoom = 1.0;
@@ -8637,17 +8647,17 @@ nsresult nsDocShell::CheckLoadingPermiss
     }
 
     if (nsContentUtils::SubjectPrincipal()->Subsumes(p)) {
       // Same origin, permit load
       return NS_OK;
     }
 
     nsCOMPtr<nsIDocShellTreeItem> tmp;
-    item->GetSameTypeParent(getter_AddRefs(tmp));
+    item->GetInProcessSameTypeParent(getter_AddRefs(tmp));
     item.swap(tmp);
   } while (item);
 
   return NS_ERROR_DOM_PROP_ACCESS_DENIED;
 }
 
 //*****************************************************************************
 // nsDocShell: Site Loading
@@ -9435,17 +9445,17 @@ nsresult nsDocShell::InternalLoad(nsDocS
     }
     // If principalToInherit is still null (e.g. if some of the conditions of
     // were not satisfied), then no inheritance of any sort will happen: the
     // load will just get a principal based on the URI being loaded.
   }
 
   // If this docshell is owned by a frameloader, make sure to cancel
   // possible frameloader initialization before loading a new page.
-  nsCOMPtr<nsIDocShellTreeItem> parent = GetParentDocshell();
+  nsCOMPtr<nsIDocShellTreeItem> parent = GetInProcessParentDocshell();
   if (parent) {
     RefPtr<Document> doc = parent->GetDocument();
     if (doc) {
       doc->TryCancelFrameLoaderInitialization(this);
     }
   }
 
   bool loadFromExternal = false;
@@ -9623,17 +9633,17 @@ nsresult nsDocShell::InternalLoad(nsDocS
 
   // Whenever a top-level browsing context is navigated, the user agent MUST
   // lock the orientation of the document to the document's default
   // orientation. We don't explicitly check for a top-level browsing context
   // here because orientation is only set on top-level browsing contexts.
   if (OrientationLock() != hal::eScreenOrientation_None) {
 #ifdef DEBUG
     nsCOMPtr<nsIDocShellTreeItem> parent;
-    GetSameTypeParent(getter_AddRefs(parent));
+    GetInProcessSameTypeParent(getter_AddRefs(parent));
     MOZ_ASSERT(!parent);
 #endif
     SetOrientationLock(hal::eScreenOrientation_None);
     if (mIsActive) {
       ScreenOrientation::UpdateActiveOrientationLock(
           hal::eScreenOrientation_None);
     }
   }
@@ -9776,17 +9786,17 @@ nsIPrincipal* nsDocShell::GetInheritedPr
 
   if (aConsiderCurrentDocument && mContentViewer) {
     document = mContentViewer->GetDocument();
     inheritedFromCurrent = true;
   }
 
   if (!document) {
     nsCOMPtr<nsIDocShellTreeItem> parentItem;
-    GetSameTypeParent(getter_AddRefs(parentItem));
+    GetInProcessSameTypeParent(getter_AddRefs(parentItem));
     if (parentItem) {
       document = parentItem->GetDocument();
     }
   }
 
   if (!document) {
     if (!aConsiderCurrentDocument) {
       return nullptr;
@@ -11570,17 +11580,17 @@ nsresult nsDocShell::AddToSessionHistory
   }
 #endif
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsISHEntry> entry;
 
   // Get a handle to the root docshell
   nsCOMPtr<nsIDocShellTreeItem> root;
-  GetSameTypeRootTreeItem(getter_AddRefs(root));
+  GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
   /*
    * If this is a LOAD_FLAGS_REPLACE_HISTORY in a subframe, we use
    * the existing SH entry in the page and replace the url and
    * other vitalities.
    */
   if (LOAD_TYPE_HAS_FLAGS(mLoadType, LOAD_FLAGS_REPLACE_HISTORY) &&
       root != static_cast<nsIDocShellTreeItem*>(this)) {
     // This is a subframe
@@ -11964,17 +11974,17 @@ void nsDocShell::SetHistoryEntry(nsCOMPt
     // newRootEntry is now the new root entry.
     // Find the old root entry as well.
 
     // Need a strong ref. on |oldRootEntry| so it isn't destroyed when
     // SetChildHistoryEntry() does SwapHistoryEntries() (bug 304639).
     nsCOMPtr<nsISHEntry> oldRootEntry = nsSHistory::GetRootSHEntry(*aPtr);
     if (oldRootEntry) {
       nsCOMPtr<nsIDocShellTreeItem> rootAsItem;
-      GetSameTypeRootTreeItem(getter_AddRefs(rootAsItem));
+      GetInProcessSameTypeRootTreeItem(getter_AddRefs(rootAsItem));
       nsCOMPtr<nsIDocShell> rootShell = do_QueryInterface(rootAsItem);
       if (rootShell) {  // if we're the root just set it, nothing to swap
         nsSHistory::SwapEntriesData data = {this, newRootEntry};
         nsIDocShell* rootIDocShell = static_cast<nsIDocShell*>(rootShell);
         nsDocShell* rootDocShell = static_cast<nsDocShell*>(rootIDocShell);
 
 #ifdef DEBUG
         nsresult rv =
@@ -11986,17 +11996,17 @@ void nsDocShell::SetHistoryEntry(nsCOMPt
     }
   }
 
   *aPtr = aEntry;
 }
 
 already_AddRefed<ChildSHistory> nsDocShell::GetRootSessionHistory() {
   nsCOMPtr<nsIDocShellTreeItem> root;
-  nsresult rv = GetSameTypeRootTreeItem(getter_AddRefs(root));
+  nsresult rv = GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return nullptr;
   }
   nsCOMPtr<nsIWebNavigation> webnav = do_QueryInterface(root);
   if (!webnav) {
     return nullptr;
   }
   return webnav->GetSessionHistory();
@@ -12498,31 +12508,31 @@ nsDocShell::GetAssociatedWindow(mozIDOMW
   CallGetInterface(this, aWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetTopWindow(mozIDOMWindowProxy** aWindow) {
   nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow();
   if (win) {
-    win = win->GetTop();
+    win = win->GetInProcessTop();
   }
   win.forget(aWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::GetTopFrameElement(Element** aElement) {
   *aElement = nullptr;
   nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow();
   if (!win) {
     return NS_OK;
   }
 
-  nsCOMPtr<nsPIDOMWindowOuter> top = win->GetScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> top = win->GetInProcessScriptableTop();
   NS_ENSURE_TRUE(top, NS_ERROR_FAILURE);
 
   // GetFrameElementInternal, /not/ GetScriptableFrameElement -- if |top| is
   // inside <iframe mozbrowser>, we want to return the iframe, not null.
   // And we want to cross the content/chrome boundary.
   RefPtr<Element> elt = top->GetFrameElementInternal();
   elt.forget(aElement);
   return NS_OK;
@@ -12541,17 +12551,17 @@ nsDocShell::GetUseTrackingProtection(boo
   if (mUseTrackingProtection ||
       StaticPrefs::privacy_trackingprotection_enabled() ||
       (UsePrivateBrowsing() &&
        StaticPrefs::privacy_trackingprotection_pbmode_enabled())) {
     *aUseTrackingProtection = true;
     return NS_OK;
   }
 
-  RefPtr<nsDocShell> parent = GetParentDocshell();
+  RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
   if (parent) {
     return parent->GetUseTrackingProtection(aUseTrackingProtection);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -13170,17 +13180,17 @@ NS_IMETHODIMP nsDocShell::GetIsMozBrowse
 }
 
 uint32_t nsDocShell::GetInheritedFrameType() {
   if (mFrameType != FRAME_TYPE_REGULAR) {
     return mFrameType;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
-  GetSameTypeParent(getter_AddRefs(parentAsItem));
+  GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
 
   nsCOMPtr<nsIDocShell> parent = do_QueryInterface(parentAsItem);
   if (!parent) {
     return FRAME_TYPE_REGULAR;
   }
 
   return static_cast<nsDocShell*>(parent.get())->GetInheritedFrameType();
 }
@@ -13214,17 +13224,17 @@ NS_IMETHODIMP nsDocShell::GetIsInMozBrow
 
 /* [infallible] */
 NS_IMETHODIMP nsDocShell::GetIsTopLevelContentDocShell(
     bool* aIsTopLevelContentDocShell) {
   *aIsTopLevelContentDocShell = false;
 
   if (mItemType == typeContent) {
     nsCOMPtr<nsIDocShellTreeItem> root;
-    GetSameTypeRootTreeItem(getter_AddRefs(root));
+    GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
     *aIsTopLevelContentDocShell =
         root.get() == static_cast<nsIDocShellTreeItem*>(this);
   }
 
   return NS_OK;
 }
 
 // Implements nsILoadContext.originAttributes
@@ -13274,17 +13284,17 @@ bool nsDocShell::ServiceWorkerAllowedToC
   MOZ_ASSERT(aPrincipal);
   MOZ_ASSERT(aURI);
 
   if (UsePrivateBrowsing() || mSandboxFlags) {
     return false;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> parent;
-  GetSameTypeParent(getter_AddRefs(parent));
+  GetInProcessSameTypeParent(getter_AddRefs(parent));
   nsPIDOMWindowOuter* parentOuter = parent ? parent->GetWindow() : nullptr;
   nsPIDOMWindowInner* parentInner =
       parentOuter ? parentOuter->GetCurrentInnerWindow() : nullptr;
 
   StorageAccess storage =
       StorageAllowedForNewWindow(aPrincipal, aURI, parentInner);
 
   return storage == StorageAccess::eAllow;
@@ -13398,24 +13408,24 @@ nsDocShell::GetAsyncPanZoomEnabled(bool*
 
   // If we don't have a presShell, fall back to the default platform value of
   // whether or not APZ is enabled.
   *aOut = gfxPlatform::AsyncPanZoomEnabled();
   return NS_OK;
 }
 
 bool nsDocShell::HasUnloadedParent() {
-  RefPtr<nsDocShell> parent = GetParentDocshell();
+  RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
   while (parent) {
     bool inUnload = false;
     parent->GetIsInUnload(&inUnload);
     if (inUnload) {
       return true;
     }
-    parent = parent->GetParentDocshell();
+    parent = parent->GetInProcessParentDocshell();
   }
   return false;
 }
 
 void nsDocShell::UpdateGlobalHistoryTitle(nsIURI* aURI) {
   if (mUseGlobalHistory && !UsePrivateBrowsing()) {
     nsCOMPtr<IHistory> history = services::GetHistoryService();
     if (history) {
@@ -13514,17 +13524,17 @@ nsDocShell::ChannelIntercepted(nsIInterc
 }
 
 bool nsDocShell::InFrameSwap() {
   RefPtr<nsDocShell> shell = this;
   do {
     if (shell->mInFrameSwap) {
       return true;
     }
-    shell = shell->GetParentDocshell();
+    shell = shell->GetInProcessParentDocshell();
   } while (shell);
   return false;
 }
 
 UniquePtr<ClientSource> nsDocShell::TakeInitialClientSource() {
   return std::move(mInitialClientSource);
 }
 
@@ -13569,17 +13579,17 @@ NS_IMETHODIMP
 nsDocShell::GetIsOnlyToplevelInTabGroup(bool* aResult) {
   MOZ_ASSERT(aResult);
 
   nsPIDOMWindowOuter* outer = GetWindow();
   MOZ_ASSERT(outer);
 
   // If we are not toplevel then we are not the only toplevel window in the
   // tab group.
-  if (outer->GetScriptableParentOrNull()) {
+  if (outer->GetInProcessScriptableParentOrNull()) {
     *aResult = false;
     return NS_OK;
   }
 
   // If we have any other toplevel windows in our tab group, then we are not
   // the only toplevel window in the tab group.
   nsTArray<nsPIDOMWindowOuter*> toplevelWindows =
       outer->TabGroup()->GetTopLevelWindows();
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -323,17 +323,17 @@ class nsDocShell final : public nsDocLoa
                          LOCATION_CHANGE_SAME_DOCUMENT);
   }
 
   // This function is created exclusively for dom.background_loading_iframe is
   // set. As soon as the current DocShell knows itself can be treated as
   // background loading, it triggers the parent docshell to see if the parent
   // document can fire load event earlier.
   void TriggerParentCheckDocShellIsEmpty() {
-    RefPtr<nsDocShell> parent = GetParentDocshell();
+    RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
     if (parent) {
       parent->DocLoaderIsEmpty(true);
     }
   }
 
   nsresult HistoryEntryRemoved(int32_t aIndex);
 
   // Notify Scroll observers when an async panning/zooming transform
@@ -929,17 +929,17 @@ class nsDocShell final : public nsDocLoa
   // searching for FindItemWithName.
   nsresult DoFindItemWithName(const nsAString& aName,
                               nsIDocShellTreeItem* aRequestor,
                               nsIDocShellTreeItem* aOriginalRequestor,
                               bool aSkipTabGroup,
                               nsIDocShellTreeItem** aResult);
 
   // Convenience method for getting our parent docshell. Can return null
-  already_AddRefed<nsDocShell> GetParentDocshell();
+  already_AddRefed<nsDocShell> GetInProcessParentDocshell();
 
   // Helper assertion to enforce that mInPrivateBrowsing is in sync with
   // OriginAttributes.mPrivateBrowsingId
   void AssertOriginAttributesMatchPrivateBrowsing();
 
   // Notify consumers of a search being loaded through the observer service:
   void MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
                                        const nsString& aKeyword);
--- a/docshell/base/nsDocShellEnumerator.cpp
+++ b/docshell/base/nsDocShellEnumerator.cpp
@@ -117,24 +117,24 @@ nsresult nsDocShellForwardsEnumerator::B
   if (mDocShellType == nsIDocShellTreeItem::typeAll ||
       aItem->ItemType() == mDocShellType) {
     if (!aItemArray.AppendElement(do_GetWeakReference(aItem))) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
   }
 
   int32_t numChildren;
-  rv = aItem->GetChildCount(&numChildren);
+  rv = aItem->GetInProcessChildCount(&numChildren);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   for (int32_t i = 0; i < numChildren; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> curChild;
-    rv = aItem->GetChildAt(i, getter_AddRefs(curChild));
+    rv = aItem->GetInProcessChildAt(i, getter_AddRefs(curChild));
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     rv = BuildArrayRecursive(curChild, aItemArray);
     if (NS_FAILED(rv)) {
       return rv;
     }
@@ -143,24 +143,24 @@ nsresult nsDocShellForwardsEnumerator::B
   return NS_OK;
 }
 
 nsresult nsDocShellBackwardsEnumerator::BuildArrayRecursive(
     nsIDocShellTreeItem* aItem, nsTArray<nsWeakPtr>& aItemArray) {
   nsresult rv;
 
   int32_t numChildren;
-  rv = aItem->GetChildCount(&numChildren);
+  rv = aItem->GetInProcessChildCount(&numChildren);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   for (int32_t i = numChildren - 1; i >= 0; --i) {
     nsCOMPtr<nsIDocShellTreeItem> curChild;
-    rv = aItem->GetChildAt(i, getter_AddRefs(curChild));
+    rv = aItem->GetInProcessChildAt(i, getter_AddRefs(curChild));
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     rv = BuildArrayRecursive(curChild, aItemArray);
     if (NS_FAILED(rv)) {
       return rv;
     }
--- a/docshell/base/nsDocShellTreeOwner.cpp
+++ b/docshell/base/nsDocShellTreeOwner.cpp
@@ -1218,17 +1218,17 @@ bool ChromeTooltipListener::WebProgressS
       return true;
     }
     // We can't use the docshell hierarchy here, because when the parent
     // docshell is navigated, the child docshell is disconnected (ie its
     // references to the parent are nulled out) despite it still being
     // alive here. So we use the document hierarchy instead:
     Document* document = lastUsed->GetDocument();
     if (document) {
-      document = document->GetParentDocument();
+      document = document->GetInProcessParentDocument();
     }
     if (!document) {
       break;
     }
     lastUsed = document->GetDocShell();
   }
   return false;
 }
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -774,22 +774,26 @@ interface nsIDocShell : nsIDocShellTreeI
   /**
    * Returns true if this docshell is the top level content docshell.
    */
   [infallible] readonly attribute boolean isTopLevelContentDocShell;
 
   /**
    * Like nsIDocShellTreeItem::GetSameTypeParent, except this ignores <iframe
    * mozbrowser> boundaries.
+   *
+   * @deprecated: Use `BrowsingContext::GetParent()` in the future.
    */
   nsIDocShell getSameTypeParentIgnoreBrowserBoundaries();
 
   /**
    * Like nsIDocShellTreeItem::GetSameTypeRootTreeItem, except this ignores
    * <iframe mozbrowser> boundaries.
+   *
+   * @deprecated: Use `BrowsingContext::Top()` in the future.
    */
   nsIDocShell getSameTypeRootTreeItemIgnoreBrowserBoundaries();
 
   /**
    * True iff asynchronous panning and zooming is enabled for this
    * docshell.
    */
   readonly attribute bool asyncPanZoomEnabled;
--- a/docshell/base/nsIDocShellTreeItem.idl
+++ b/docshell/base/nsIDocShellTreeItem.idl
@@ -6,16 +6,17 @@
 
 #include "nsISupports.idl"
 
 interface mozIDOMWindowProxy;
 interface nsIDocShellTreeOwner;
 interface nsPIDOMWindowOuter;
 
 webidl Document;
+webidl BrowsingContext;
 
 /**
  * The nsIDocShellTreeItem supplies the methods that are required of any item
  * that wishes to be able to live within the docshell tree either as a middle
  * node or a leaf.
  */
 
 [scriptable, builtinclass, uuid(9b7c586f-9214-480c-a2c4-49b526fff1a6)]
@@ -48,38 +49,51 @@ interface nsIDocShellTreeItem : nsISuppo
 	/*
 	The type this item is.
 	*/
 	readonly attribute long itemType;
 	[noscript,notxpcom,nostdcall] long ItemType();
 
 	/*
 	Parent DocShell.
+
+	@deprecated: Use `BrowsingContext::GetParent()` instead.
+	(NOTE: `BrowsingContext::GetParent()` will not cross isolation boundaries)
 	*/
+	[binaryname(InProcessParent)]
 	readonly attribute nsIDocShellTreeItem parent;
 
 	/*
 	This getter returns the same thing parent does however if the parent
 	is of a different itemType, or if the parent is an <iframe mozbrowser>.
 	It will instead return nullptr.  This call is a convience function for
 	Ithose wishing to not cross the boundaries at which item types change.
+
+	@deprecated: Use `BrowsingContext::GetParent()` instead.
 	*/
+	[binaryname(InProcessSameTypeParent)]
 	readonly attribute nsIDocShellTreeItem sameTypeParent;
 
 	/*
 	Returns the root DocShellTreeItem.  This is a convience equivalent to
 	getting the parent and its parent until there isn't a parent.
+
+	@deprecated: Use `BrowsingContext::Top()` instead.
+	(NOTE: `BrowsingContext::Top()` will not cross isolation boundaries)
 	*/
 	readonly attribute nsIDocShellTreeItem rootTreeItem;
 
 	/*
 	Returns the root DocShellTreeItem of the same type.  This is a convience
 	equivalent to getting the parent of the same type and its parent until
 	there isn't a parent.
+
+	@deprecated: Use `BrowsingContext::Top()` instead.
 	*/
+	[binaryname(InProcessSameTypeRootTreeItem)]
 	readonly attribute nsIDocShellTreeItem sameTypeRootTreeItem;
 
 	/*
 	Returns the docShellTreeItem with the specified name.  Search order is as
 	follows...
 	1.)  Check name of self, if it matches return it.
 	2.)  For each immediate child.
 		a.) Check name of child and if it matches return it.
@@ -129,40 +143,51 @@ interface nsIDocShellTreeItem : nsISuppo
 	addref'd before handing it to them.
 	*/
 	readonly attribute nsIDocShellTreeOwner treeOwner;
 	[noscript] void setTreeOwner(in nsIDocShellTreeOwner treeOwner);
 
 	/*
 	The current number of DocShells which are immediate children of the
 	this object.
+
+
+	@deprecated: Prefer using `BrowsingContext::Children()`, as this count will
+	not include out-of-process iframes.
 	*/
+	[binaryname(InProcessChildCount)]
 	readonly attribute long childCount;
 
 	/*
 	Add a new child DocShellTreeItem.  Adds to the end of the list.
 	Note that this does NOT take a reference to the child.  The child stays
 	alive only as long as it's referenced from outside the docshell tree.
+
 	@throws NS_ERROR_ILLEGAL_VALUE if child corresponds to the same
 	        object as this treenode or an ancestor of this treenode
 	@throws NS_ERROR_UNEXPECTED if this node is a leaf in the tree.
 	*/
-	void addChild(in nsIDocShellTreeItem child);
+	[noscript] void addChild(in nsIDocShellTreeItem child);
 
 	/*
 	Removes a child DocShellTreeItem.
+
 	@throws NS_ERROR_UNEXPECTED if this node is a leaf in the tree.
 	*/
-	void removeChild(in nsIDocShellTreeItem child);
+	[noscript] void removeChild(in nsIDocShellTreeItem child);
 
 	/**
 	 * Return the child at the index requested.  This is 0-based.
 	 *
+	 * @deprecated: Prefer using `BrowsingContext::Children()`, as this will not
+	 * include out-of-process iframes.
+	 *
 	 * @throws NS_ERROR_UNEXPECTED if the index is out of range
 	 */
+	[binaryname(GetInProcessChildAt)]
 	nsIDocShellTreeItem getChildAt(in long index);
 
 	/*
 	Return the child DocShellTreeItem with the specified name.
 	aName - This is the name of the item that is trying to be found.
 	aRecurse - Is used to tell the function to recurse through children.
 		Note, recursion will only happen through items of the same type.
 	aSameType - If this is set only children of the same type will be returned.
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -380,20 +380,20 @@ nsresult nsSHistory::WalkHistoryEntries(
       continue;
     }
 
     nsDocShell* childShell = nullptr;
     if (aRootShell) {
       // Walk the children of aRootShell and see if one of them
       // has srcChild as a SHEntry.
       int32_t length;
-      aRootShell->GetChildCount(&length);
+      aRootShell->GetInProcessChildCount(&length);
       for (int32_t i = 0; i < length; i++) {
         nsCOMPtr<nsIDocShellTreeItem> item;
-        nsresult rv = aRootShell->GetChildAt(i, getter_AddRefs(item));
+        nsresult rv = aRootShell->GetInProcessChildAt(i, getter_AddRefs(item));
         NS_ENSURE_SUCCESS(rv, rv);
         nsDocShell* child = static_cast<nsDocShell*>(item.get());
         if (child->HasHistoryEntry(childEntry)) {
           childShell = child;
           break;
         }
       }
     }
@@ -1386,23 +1386,23 @@ nsresult nsSHistory::LoadDifferingEntrie
     aNextEntry->SetIsSubFrame(aParent != mRootDocShell);
     return InitiateLoad(aNextEntry, aParent, aLoadType);
   }
 
   // The entries are the same, so compare any child frames
   int32_t pcnt = aPrevEntry->GetChildCount();
   int32_t ncnt = aNextEntry->GetChildCount();
   int32_t dsCount = 0;
-  aParent->GetChildCount(&dsCount);
+  aParent->GetInProcessChildCount(&dsCount);
 
   // Create an array for child docshells.
   nsCOMArray<nsIDocShell> docshells;
   for (int32_t i = 0; i < dsCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> treeItem;
-    aParent->GetChildAt(i, getter_AddRefs(treeItem));
+    aParent->GetInProcessChildAt(i, getter_AddRefs(treeItem));
     nsCOMPtr<nsIDocShell> shell = do_QueryInterface(treeItem);
     if (shell) {
       docshells.AppendElement(shell.forget());
     }
   }
 
   // Search for something to load next.
   for (int32_t i = 0; i < ncnt; ++i) {
--- a/dom/audiochannel/AudioChannelAgent.cpp
+++ b/dom/audiochannel/AudioChannelAgent.cpp
@@ -59,29 +59,29 @@ AudioChannelAgent::Init(mozIDOMWindow* a
 NS_IMETHODIMP
 AudioChannelAgent::InitWithWeakCallback(
     mozIDOMWindow* aWindow, nsIAudioChannelAgentCallback* aCallback) {
   return InitInternal(nsPIDOMWindowInner::From(aWindow), aCallback,
                       /* useWeakRef = */ true);
 }
 
 nsresult AudioChannelAgent::FindCorrectWindow(nsPIDOMWindowInner* aWindow) {
-  mWindow = aWindow->GetScriptableTop();
+  mWindow = aWindow->GetInProcessScriptableTop();
   if (NS_WARN_IF(!mWindow)) {
     return NS_OK;
   }
 
   // From here we do an hack for nested iframes.
   // The system app doesn't have access to the nested iframe objects so it
   // cannot control the volume of the agents running in nested apps. What we do
   // here is to assign those Agents to the top scriptable window of the parent
   // iframe (what is controlled by the system app).
   // For doing this we go recursively back into the chain of windows until we
   // find apps that are not the system one.
-  nsCOMPtr<nsPIDOMWindowOuter> outerParent = mWindow->GetParent();
+  nsCOMPtr<nsPIDOMWindowOuter> outerParent = mWindow->GetInProcessParent();
   if (!outerParent || outerParent == mWindow) {
     return NS_OK;
   }
 
   nsCOMPtr<nsPIDOMWindowInner> parent = outerParent->GetCurrentInnerWindow();
   if (!parent) {
     return NS_OK;
   }
--- a/dom/audiochannel/AudioChannelService.cpp
+++ b/dom/audiochannel/AudioChannelService.cpp
@@ -341,17 +341,18 @@ AudioPlaybackConfig AudioChannelService:
     }
 
     config.mVolume *= window->GetAudioVolume();
     config.mMuted = config.mMuted || window->GetAudioMuted();
     if (window->GetMediaSuspend() != nsISuspendedTypes::NONE_SUSPENDED) {
       config.mSuspend = window->GetMediaSuspend();
     }
 
-    nsCOMPtr<nsPIDOMWindowOuter> win = window->GetScriptableParentOrNull();
+    nsCOMPtr<nsPIDOMWindowOuter> win =
+        window->GetInProcessScriptableParentOrNull();
     if (!win) {
       break;
     }
 
     window = win;
 
     // If there is no parent, or we are the toplevel we don't continue.
   } while (window && window != aWindow);
@@ -414,17 +415,17 @@ AudioChannelService::Observe(nsISupports
   return NS_OK;
 }
 
 void AudioChannelService::RefreshAgents(
     nsPIDOMWindowOuter* aWindow,
     const std::function<void(AudioChannelAgent*)>& aFunc) {
   MOZ_ASSERT(aWindow);
 
-  nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetInProcessScriptableTop();
   if (!topWindow) {
     return;
   }
 
   AudioChannelWindow* winData = GetWindowData(topWindow->WindowID());
   if (!winData) {
     return;
   }
@@ -453,17 +454,17 @@ void AudioChannelService::SetWindowAudio
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aWindow);
 
   MOZ_LOG(GetAudioChannelLog(), LogLevel::Debug,
           ("AudioChannelService, SetWindowAudioCaptured, window = %p, "
            "aCapture = %d\n",
            aWindow, aCapture));
 
-  nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetInProcessScriptableTop();
   if (!topWindow) {
     return;
   }
 
   AudioChannelWindow* winData = GetWindowData(topWindow->WindowID());
 
   // This can happen, but only during shutdown, because the the outer window
   // changes ScriptableTop, so that its ID is different.
@@ -510,17 +511,17 @@ AudioChannelService::AudioChannelWindow*
   }
 
   return nullptr;
 }
 
 bool AudioChannelService::IsWindowActive(nsPIDOMWindowOuter* aWindow) {
   MOZ_ASSERT(NS_IsMainThread());
 
-  auto* window = nsPIDOMWindowOuter::From(aWindow)->GetScriptableTop();
+  auto* window = nsPIDOMWindowOuter::From(aWindow)->GetInProcessScriptableTop();
   if (!window) {
     return false;
   }
 
   AudioChannelWindow* winData = GetWindowData(window->WindowID());
   if (!winData) {
     return false;
   }
@@ -541,17 +542,17 @@ void AudioChannelService::RefreshAgentsA
     }
   }
 }
 
 void AudioChannelService::NotifyMediaResumedFromBlock(
     nsPIDOMWindowOuter* aWindow) {
   MOZ_ASSERT(aWindow);
 
-  nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetInProcessScriptableTop();
   if (!topWindow) {
     return;
   }
 
   AudioChannelWindow* winData = GetWindowData(topWindow->WindowID());
   if (!winData) {
     return;
   }
--- a/dom/base/DocGroup.cpp
+++ b/dom/base/DocGroup.cpp
@@ -101,17 +101,17 @@ RefPtr<PerformanceInfoPromise> DocGroup:
     if (host.IsEmpty()) {
       host = docURI->GetSpecOrDefault();
     }
     // looking for the top level document URI
     nsPIDOMWindowOuter* win = doc->GetWindow();
     if (!win) {
       continue;
     }
-    top = win->GetTop();
+    top = win->GetInProcessTop();
     if (!top) {
       continue;
     }
     windowID = top->WindowID();
     isTopLevel = win->IsTopLevelWindow();
     mainThread = AbstractMainThreadFor(TaskCategory::Performance);
     break;
   }
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -2244,17 +2244,17 @@ void Document::DeleteAllPropertiesFor(ns
 }
 
 bool Document::IsVisibleConsideringAncestors() const {
   const Document* parent = this;
   do {
     if (!parent->IsVisible()) {
       return false;
     }
-  } while ((parent = parent->GetParentDocument()));
+  } while ((parent = parent->GetInProcessParentDocument()));
 
   return true;
 }
 
 void Document::Reset(nsIChannel* aChannel, nsILoadGroup* aLoadGroup) {
   nsCOMPtr<nsIURI> uri;
   nsCOMPtr<nsIPrincipal> principal;
   nsCOMPtr<nsIPrincipal> storagePrincipal;
@@ -2473,21 +2473,22 @@ already_AddRefed<nsIPrincipal> Document:
                           "an expanded principal");
 
     auto* expanded = basePrin->As<ExpandedPrincipal>();
     return do_AddRef(expanded->AllowList().LastElement());
   }
 
   if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
     // We basically want the parent document here, but because this is very
-    // early in the load, GetParentDocument() returns null, so we use the
-    // docshell hierarchy to get this information instead.
+    // early in the load, GetInProcessParentDocument() returns null, so we use
+    // the docshell hierarchy to get this information instead.
     if (mDocumentContainer) {
       nsCOMPtr<nsIDocShellTreeItem> parentDocShellItem;
-      mDocumentContainer->GetParent(getter_AddRefs(parentDocShellItem));
+      mDocumentContainer->GetInProcessParent(
+          getter_AddRefs(parentDocShellItem));
       nsCOMPtr<nsIDocShell> parentDocShell =
           do_QueryInterface(parentDocShellItem);
       if (parentDocShell) {
         nsCOMPtr<Document> parentDoc;
         parentDoc = parentDocShell->GetDocument();
         if (!parentDoc ||
             !nsContentUtils::IsSystemPrincipal(parentDoc->NodePrincipal())) {
           nsCOMPtr<nsIPrincipal> nullPrincipal =
@@ -2817,25 +2818,26 @@ static void WarnIfSandboxIneffective(nsI
   // attribute) and both the allow-scripts and allow-same-origin
   // keywords are supplied, the sandboxed document can call into its
   // parent document and remove its sandboxing entirely - we print a
   // warning to the web console in this case.
   if (aSandboxFlags & SANDBOXED_NAVIGATION &&
       !(aSandboxFlags & SANDBOXED_SCRIPTS) &&
       !(aSandboxFlags & SANDBOXED_ORIGIN)) {
     nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
-    aDocShell->GetSameTypeParent(getter_AddRefs(parentAsItem));
+    aDocShell->GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
     nsCOMPtr<nsIDocShell> parentDocShell = do_QueryInterface(parentAsItem);
     if (!parentDocShell) {
       return;
     }
 
     // Don't warn if our parent is not the top-level document.
     nsCOMPtr<nsIDocShellTreeItem> grandParentAsItem;
-    parentDocShell->GetSameTypeParent(getter_AddRefs(grandParentAsItem));
+    parentDocShell->GetInProcessSameTypeParent(
+        getter_AddRefs(grandParentAsItem));
     if (grandParentAsItem) {
       return;
     }
 
     nsCOMPtr<nsIChannel> parentChannel;
     parentDocShell->GetCurrentDocumentChannel(getter_AddRefs(parentChannel));
     if (!parentChannel) {
       return;
@@ -2961,17 +2963,17 @@ nsresult Document::StartDocumentLoad(con
   }
 
   // The CSP directive upgrade-insecure-requests not only applies to the
   // toplevel document, but also to nested documents. Let's propagate that
   // flag from the parent to the nested document.
   nsCOMPtr<nsIDocShellTreeItem> treeItem = this->GetDocShell();
   if (treeItem) {
     nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
-    treeItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
+    treeItem->GetInProcessSameTypeParent(getter_AddRefs(sameTypeParent));
     if (sameTypeParent) {
       Document* doc = sameTypeParent->GetDocument();
       mBlockAllMixedContent = doc->GetBlockAllMixedContent(false);
       // if the parent document makes use of block-all-mixed-content
       // then subdocument preloads should always be blocked.
       mBlockAllMixedContentPreloads =
           mBlockAllMixedContent || doc->GetBlockAllMixedContent(true);
 
@@ -3004,17 +3006,17 @@ nsresult Document::StartDocumentLoad(con
   }
 
   // Let's take the CookieSettings from the loadInfo or from the parent
   // document.
   if (loadInfo) {
     rv = loadInfo->GetCookieSettings(getter_AddRefs(mCookieSettings));
     NS_ENSURE_SUCCESS(rv, rv);
   } else {
-    nsCOMPtr<Document> parentDocument = GetParentDocument();
+    nsCOMPtr<Document> parentDocument = GetInProcessParentDocument();
     if (parentDocument) {
       mCookieSettings = parentDocument->CookieSettings();
     }
   }
 
   return NS_OK;
 }
 
@@ -3821,17 +3823,17 @@ bool Document::HasFocus(ErrorResult& rv)
   if (!focusedWindow) {
     return false;
   }
 
   nsPIDOMWindowOuter* piWindow = nsPIDOMWindowOuter::From(focusedWindow);
 
   // Are we an ancestor of the focused DOMWindow?
   for (Document* currentDoc = piWindow->GetDoc(); currentDoc;
-       currentDoc = currentDoc->GetParentDocument()) {
+       currentDoc = currentDoc->GetInProcessParentDocument()) {
     if (currentDoc == this) {
       // Yes, we are an ancestor
       return true;
     }
   }
 
   return false;
 }
@@ -4934,17 +4936,17 @@ void Document::QueryCommandValue(const n
   // return "" in that case anyway (bug 738385), so we just return NS_OK
   // regardless.
   nsAutoCString result;
   params->GetCString("state_attribute", result);
   CopyUTF8toUTF16(result, aValue);
 }
 
 bool Document::IsEditingOnAfterFlush() {
-  RefPtr<Document> doc = GetParentDocument();
+  RefPtr<Document> doc = GetInProcessParentDocument();
   if (doc) {
     // Make sure frames are up to date, since that can affect whether
     // we're editable.
     doc->FlushPendingNotifications(FlushType::Frames);
   }
 
   return IsEditingOn();
 }
@@ -7096,17 +7098,17 @@ void Document::DispatchContentLoadedEven
 
           if (RefPtr<nsPresContext> context = parent->GetPresContext()) {
             EventDispatcher::Dispatch(ToSupports(parent), context, innerEvent,
                                       event, &status);
           }
         }
       }
 
-      parent = parent->GetParentDocument();
+      parent = parent->GetInProcessParentDocument();
     } while (parent);
   }
 
   // If the document has a manifest attribute, fire a MozApplicationManifest
   // event.
   Element* root = GetRootElement();
   if (root && root->HasAttr(kNameSpaceID_None, nsGkAtoms::manifest)) {
     nsContentUtils::DispatchChromeEvent(
@@ -9332,17 +9334,17 @@ nsINode* Document::AdoptNode(nsINode& aA
       do {
         if (nsPIDOMWindowOuter* win = doc->GetWindow()) {
           nsCOMPtr<nsINode> node = win->GetFrameElementInternal();
           if (node && node->IsInclusiveDescendantOf(adoptedNode)) {
             rv.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
             return nullptr;
           }
         }
-      } while ((doc = doc->GetParentDocument()));
+      } while ((doc = doc->GetInProcessParentDocument()));
 
       // Remove from parent.
       nsCOMPtr<nsINode> parent = adoptedNode->GetParentNode();
       if (parent) {
         parent->RemoveChildNode(adoptedNode->AsContent(), true);
       } else {
         MOZ_ASSERT(!adoptedNode->IsInUncomposedDoc());
 
@@ -11723,17 +11725,17 @@ static already_AddRefed<nsPIDOMWindowOut
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> window = document->GetWindow();
   if (!window) {
     return nullptr;
   }
 
   // Trying to find the top window (equivalent to window.top).
-  if (nsCOMPtr<nsPIDOMWindowOuter> top = window->GetTop()) {
+  if (nsCOMPtr<nsPIDOMWindowOuter> top = window->GetInProcessTop()) {
     window = top.forget();
   }
   return window.forget();
 }
 
 /**
  * nsAutoFocusEvent is used to dispatch a focus event for an
  * nsGenericHTMLFormElement with the autofocus attribute enabled.
@@ -12916,17 +12918,17 @@ class PendingFullscreenChangeList {
             // Always automatically drop fullscreen changes which are
             // from a document detached from the doc shell.
             UniquePtr<T> change = TakeAndNextInternal();
             change->MayRejectPromise();
             continue;
           }
           while (docShell && docShell != mRootShellForIteration) {
             nsCOMPtr<nsIDocShellTreeItem> parent;
-            docShell->GetParent(getter_AddRefs(parent));
+            docShell->GetInProcessParent(getter_AddRefs(parent));
             docShell = parent.forget();
           }
           if (docShell) {
             break;
           }
         }
         // The current one either don't have matched type, or isn't
         // inside the given subtree, so skip this item.
@@ -13160,26 +13162,26 @@ void Document::RestorePreviousFullscreen
     return;
   }
 
   nsCOMPtr<Document> fullScreenDoc = GetFullscreenLeaf(this);
   AutoTArray<Element*, 8> exitElements;
 
   Document* doc = fullScreenDoc;
   // Collect all subdocuments.
-  for (; doc != this; doc = doc->GetParentDocument()) {
+  for (; doc != this; doc = doc->GetInProcessParentDocument()) {
     Element* fsElement = doc->FullscreenStackTop();
     MOZ_ASSERT(fsElement,
                "Parent document of "
                "a fullscreen document without fullscreen element?");
     exitElements.AppendElement(fsElement);
   }
   MOZ_ASSERT(doc == this, "Must have reached this doc");
   // Collect all ancestor documents which we are going to change.
-  for (; doc; doc = doc->GetParentDocument()) {
+  for (; doc; doc = doc->GetInProcessParentDocument()) {
     MOZ_ASSERT(!doc->mFullscreenStack.IsEmpty(),
                "Ancestor of fullscreen document must also be in fullscreen");
     Element* fsElement = doc->FullscreenStackTop();
     if (doc != this) {
       if (auto* iframe = HTMLIFrameElement::FromNode(fsElement)) {
         if (iframe->FullscreenFlag()) {
           // If this is an iframe, and it explicitly requested
           // fullscreen, don't rollback it automatically.
@@ -13189,17 +13191,17 @@ void Document::RestorePreviousFullscreen
     }
     exitElements.AppendElement(fsElement);
     if (doc->mFullscreenStack.Length() > 1) {
       break;
     }
   }
 
   Document* lastDoc = exitElements.LastElement()->OwnerDoc();
-  if (!lastDoc->GetParentDocument() &&
+  if (!lastDoc->GetInProcessParentDocument() &&
       lastDoc->mFullscreenStack.Length() == 1) {
     // If we are fully exiting fullscreen, don't touch anything here,
     // just wait for the window to get out from fullscreen first.
     PendingFullscreenChangeList::Add(std::move(aExit));
     AskWindowToExitFullscreen(this);
     return;
   }
 
@@ -13213,17 +13215,17 @@ void Document::RestorePreviousFullscreen
   // The last document will either rollback one fullscreen element, or
   // completely exit from the fullscreen state as well.
   Document* newFullscreenDoc;
   if (lastDoc->mFullscreenStack.Length() > 1) {
     lastDoc->FullscreenStackPop();
     newFullscreenDoc = lastDoc;
   } else {
     lastDoc->CleanupFullscreenState();
-    newFullscreenDoc = lastDoc->GetParentDocument();
+    newFullscreenDoc = lastDoc->GetInProcessParentDocument();
   }
   // Dispatch the fullscreenchange event to all document listed. Note
   // that the loop order is reversed so that events are dispatched in
   // the tree order as indicated in the spec.
   for (Element* e : Reversed(exitElements)) {
     DispatchFullscreenChange(e->OwnerDoc(), e);
   }
   aExit->MayResolvePromise();
@@ -13702,17 +13704,17 @@ bool Document::ApplyFullscreen(UniquePtr
       }
     }
 
     NS_ASSERTION(child->GetFullscreenRoot() == fullScreenRootDoc,
                  "Fullscreen root should be set!");
     if (child == fullScreenRootDoc) {
       break;
     }
-    Document* parent = child->GetParentDocument();
+    Document* parent = child->GetInProcessParentDocument();
     Element* element = parent->FindContentForSubDocument(child);
     if (parent->FullscreenStackPush(element)) {
       changed.AppendElement(parent);
       child = parent;
     } else {
       // We've reached either the root, or a point in the doctree where the
       // new fullscreen element container is the same as the previous
       // fullscreen element's container. No more changes need to be made
@@ -13836,17 +13838,17 @@ static const char* GetPointerLockError(E
   nsCOMPtr<nsPIDOMWindowInner> ownerInnerWindow = ownerDoc->GetInnerWindow();
   if (!ownerInnerWindow) {
     return "PointerLockDeniedHidden";
   }
   if (ownerWindow->GetCurrentInnerWindow() != ownerInnerWindow) {
     return "PointerLockDeniedHidden";
   }
 
-  nsCOMPtr<nsPIDOMWindowOuter> top = ownerWindow->GetScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> top = ownerWindow->GetInProcessScriptableTop();
   if (!top || !top->GetExtantDoc() || top->GetExtantDoc()->Hidden()) {
     return "PointerLockDeniedHidden";
   }
 
   if (!aNoFocusCheck) {
     mozilla::ErrorResult rv;
     if (!top->GetExtantDoc()->HasFocus(rv)) {
       return "PointerLockDeniedNotFocused";
@@ -14317,17 +14319,17 @@ Document* Document::GetTopLevelContentDo
     }
 
     // If we ever have a non-content parent before we hit a toplevel content
     // parent, then we're never going to find one.  Just bail.
     if (!parent->IsContentDocument()) {
       return nullptr;
     }
 
-    parent = parent->GetParentDocument();
+    parent = parent->GetInProcessParentDocument();
   } while (parent);
 
   return parent;
 }
 
 const Document* Document::GetTopLevelContentDocument() const {
   const Document* parent;
 
@@ -14351,17 +14353,17 @@ const Document* Document::GetTopLevelCon
     }
 
     // If we ever have a non-content parent before we hit a toplevel content
     // parent, then we're never going to find one.  Just bail.
     if (!parent->IsContentDocument()) {
       return nullptr;
     }
 
-    parent = parent->GetParentDocument();
+    parent = parent->GetInProcessParentDocument();
   } while (parent);
 
   return parent;
 }
 
 static bool MightBeChromeScheme(nsIURI* aURI) {
   MOZ_ASSERT(aURI);
   bool isChrome = true;
@@ -14745,17 +14747,17 @@ nsAutoSyncOperation::nsAutoSyncOperation
   mMicroTaskLevel = 0;
   CycleCollectedJSContext* ccjs = CycleCollectedJSContext::Get();
   if (ccjs) {
     mMicroTaskLevel = ccjs->MicroTaskLevel();
     ccjs->SetMicroTaskLevel(0);
   }
   if (aDoc) {
     if (nsPIDOMWindowOuter* win = aDoc->GetWindow()) {
-      if (nsCOMPtr<nsPIDOMWindowOuter> top = win->GetTop()) {
+      if (nsCOMPtr<nsPIDOMWindowOuter> top = win->GetInProcessTop()) {
         nsCOMPtr<Document> doc = top->GetExtantDoc();
         MarkDocumentTreeToBeInSyncOperation(doc, &mDocuments);
       }
     }
   }
 }
 
 nsAutoSyncOperation::~nsAutoSyncOperation() {
@@ -15170,17 +15172,17 @@ bool Document::IsExtensionPage() const {
 
 Document* Document::GetSameTypeParentDocument() {
   nsCOMPtr<nsIDocShellTreeItem> current = GetDocShell();
   if (!current) {
     return nullptr;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> parent;
-  current->GetSameTypeParent(getter_AddRefs(parent));
+  current->GetInProcessSameTypeParent(getter_AddRefs(parent));
   if (!parent) {
     return nullptr;
   }
 
   return parent->GetDocument();
 }
 
 void Document::TraceProtos(JSTracer* aTrc) {
@@ -15277,27 +15279,28 @@ bool Document::IsThirdPartyForFlashClass
 
   nsCOMPtr<nsIDocShellTreeItem> docshell = this->GetDocShell();
   if (!docshell) {
     mIsThirdPartyForFlashClassifier.emplace(true);
     return mIsThirdPartyForFlashClassifier.value();
   }
 
   nsCOMPtr<nsIDocShellTreeItem> parent;
-  nsresult rv = docshell->GetSameTypeParent(getter_AddRefs(parent));
-  MOZ_ASSERT(NS_SUCCEEDED(rv),
-             "nsIDocShellTreeItem::GetSameTypeParent should never fail");
+  nsresult rv = docshell->GetInProcessSameTypeParent(getter_AddRefs(parent));
+  MOZ_ASSERT(
+      NS_SUCCEEDED(rv),
+      "nsIDocShellTreeItem::GetInProcessSameTypeParent should never fail");
   bool isTopLevel = !parent;
 
   if (isTopLevel) {
     mIsThirdPartyForFlashClassifier.emplace(false);
     return mIsThirdPartyForFlashClassifier.value();
   }
 
-  nsCOMPtr<Document> parentDocument = GetParentDocument();
+  nsCOMPtr<Document> parentDocument = GetInProcessParentDocument();
   if (!parentDocument) {
     // Failure
     mIsThirdPartyForFlashClassifier.emplace(true);
     return mIsThirdPartyForFlashClassifier.value();
   }
 
   if (parentDocument->IsThirdPartyForFlashClassifier()) {
     mIsThirdPartyForFlashClassifier.emplace(true);
@@ -15350,17 +15353,17 @@ FlashClassification Document::DocumentFl
       classification = FlashClassification::Allowed;
     }
   }
 
   if (IsTopLevelContentDocument()) {
     return classification;
   }
 
-  Document* parentDocument = GetParentDocument();
+  Document* parentDocument = GetInProcessParentDocument();
   if (!parentDocument) {
     return FlashClassification::Denied;
   }
 
   FlashClassification parentClassification =
       parentDocument->DocumentFlashClassification();
 
   if (parentClassification == FlashClassification::Denied) {
@@ -15498,17 +15501,17 @@ already_AddRefed<mozilla::dom::Promise> 
   // Step 6. If the sub frame doesn't have the token
   //         "allow-storage-access-by-user-activation", reject.
   if (StorageAccessSandboxed()) {
     promise->MaybeRejectWithUndefined();
     return promise.forget();
   }
 
   // Step 7. If the sub frame's parent frame is not the top frame, reject.
-  Document* parent = GetParentDocument();
+  Document* parent = GetInProcessParentDocument();
   if (parent && !parent->IsTopLevelContentDocument()) {
     promise->MaybeRejectWithUndefined();
     return promise.forget();
   }
 
   // Step 8. If the browser is not processing a user gesture, reject.
   if (!EventStateManager::IsHandlingUserInput()) {
     promise->MaybeRejectWithUndefined();
--- a/dom/base/Document.h
+++ b/dom/base/Document.h
@@ -1442,17 +1442,17 @@ class Document : public nsINode,
 
   nsIBFCacheEntry* GetBFCacheEntry() const { return mBFCacheEntry; }
 
   /**
    * Return the parent document of this document. Will return null
    * unless this document is within a compound document and has a
    * parent. Note that this parent chain may cross chrome boundaries.
    */
-  Document* GetParentDocument() const { return mParentDocument; }
+  Document* GetInProcessParentDocument() const { return mParentDocument; }
 
   /**
    * Set the parent document of this document.
    */
   void SetParentDocument(Document* aParent) {
     mParentDocument = aParent;
     if (aParent) {
       mIgnoreDocGroupMismatches = aParent->mIgnoreDocGroupMismatches;
@@ -3859,18 +3859,18 @@ class Document : public nsINode,
    * and layout (due to the viewport size, viewport units, media queries...).
    *
    * This function returns true if our parent document and our child document
    * can observe each other. If they cannot, then we don't need to synchronously
    * update the parent document layout every time the child document may need
    * up-to-date layout information.
    */
   bool StyleOrLayoutObservablyDependsOnParentDocumentLayout() const {
-    return GetParentDocument() &&
-           GetDocGroup() == GetParentDocument()->GetDocGroup();
+    return GetInProcessParentDocument() &&
+           GetDocGroup() == GetInProcessParentDocument()->GetDocGroup();
   }
 
   void AddIntersectionObserver(DOMIntersectionObserver* aObserver) {
     MOZ_ASSERT(!mIntersectionObservers.Contains(aObserver),
                "Intersection observer already in the list");
     mIntersectionObservers.PutEntry(aObserver);
   }
 
--- a/dom/base/PostMessageEvent.cpp
+++ b/dom/base/PostMessageEvent.cpp
@@ -73,17 +73,17 @@ PostMessageEvent::Run() {
     return NS_OK;
 
   // If the window's document has suppressed event handling, hand off this event
   // for running later. We check the top window's document so that when multiple
   // same-origin windows exist in the same top window, postMessage events will
   // be delivered in the same order they were posted, regardless of which window
   // they were posted to.
   if (nsCOMPtr<nsPIDOMWindowOuter> topWindow =
-          targetWindow->GetOuterWindow()->GetTop()) {
+          targetWindow->GetOuterWindow()->GetInProcessTop()) {
     if (nsCOMPtr<nsPIDOMWindowInner> topInner =
             topWindow->GetCurrentInnerWindow()) {
       if (topInner->GetExtantDoc() &&
           topInner->GetExtantDoc()->SuspendPostMessageEvent(this)) {
         return NS_OK;
       }
     }
   }
--- a/dom/base/ScreenOrientation.cpp
+++ b/dom/base/ScreenOrientation.cpp
@@ -255,20 +255,21 @@ static inline void AbortOrientationPromi
     Promise* promise = doc->GetOrientationPendingPromise();
     if (promise) {
       promise->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
       doc->SetOrientationPendingPromise(nullptr);
     }
   }
 
   int32_t childCount;
-  aDocShell->GetChildCount(&childCount);
+  aDocShell->GetInProcessChildCount(&childCount);
   for (int32_t i = 0; i < childCount; i++) {
     nsCOMPtr<nsIDocShellTreeItem> child;
-    if (NS_SUCCEEDED(aDocShell->GetChildAt(i, getter_AddRefs(child)))) {
+    if (NS_SUCCEEDED(
+            aDocShell->GetInProcessChildAt(i, getter_AddRefs(child)))) {
       nsCOMPtr<nsIDocShell> childShell(do_QueryInterface(child));
       if (childShell) {
         AbortOrientationPromises(childShell);
       }
     }
   }
 }
 
@@ -308,17 +309,17 @@ already_AddRefed<Promise> ScreenOrientat
 #else
   LockPermission perm = GetLockOrientationPermission(true);
   if (perm == LOCK_DENIED) {
     p->MaybeReject(NS_ERROR_DOM_SECURITY_ERR);
     return p.forget();
   }
 
   nsCOMPtr<nsIDocShellTreeItem> root;
-  docShell->GetSameTypeRootTreeItem(getter_AddRefs(root));
+  docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
   nsCOMPtr<nsIDocShell> rootShell(do_QueryInterface(root));
   if (!rootShell) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return nullptr;
   }
 
   rootShell->SetOrientationLock(aOrientation);
   AbortOrientationPromises(rootShell);
--- a/dom/base/TabGroup.cpp
+++ b/dom/base/TabGroup.cpp
@@ -210,32 +210,32 @@ nsresult TabGroup::FindItemWithName(cons
 
   MOZ_ASSERT(!aName.LowerCaseEqualsLiteral("_blank") &&
              !aName.LowerCaseEqualsLiteral("_top") &&
              !aName.LowerCaseEqualsLiteral("_parent") &&
              !aName.LowerCaseEqualsLiteral("_self"));
 
   for (nsPIDOMWindowOuter* outerWindow : mWindows) {
     // Ignore non-toplevel windows
-    if (outerWindow->GetScriptableParentOrNull()) {
+    if (outerWindow->GetInProcessScriptableParentOrNull()) {
       continue;
     }
 
     nsCOMPtr<nsIDocShellTreeItem> docshell = outerWindow->GetDocShell();
     if (!docshell) {
       continue;
     }
 
     BrowsingContext* bc = outerWindow->GetBrowsingContext();
     if (!bc || !bc->IsTargetable()) {
       continue;
     }
 
     nsCOMPtr<nsIDocShellTreeItem> root;
-    docshell->GetSameTypeRootTreeItem(getter_AddRefs(root));
+    docshell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
     MOZ_RELEASE_ASSERT(docshell == root);
     if (root && aRequestor != root) {
       root->FindItemWithName(aName, aRequestor, aOriginalRequestor,
                              /* aSkipTabGroup = */ true, aFoundItem);
       if (*aFoundItem) {
         break;
       }
     }
@@ -245,17 +245,17 @@ nsresult TabGroup::FindItemWithName(cons
 }
 
 nsTArray<nsPIDOMWindowOuter*> TabGroup::GetTopLevelWindows() const {
   MOZ_ASSERT(NS_IsMainThread());
   nsTArray<nsPIDOMWindowOuter*> array;
 
   for (nsPIDOMWindowOuter* outerWindow : mWindows) {
     if (outerWindow->GetDocShell() &&
-        !outerWindow->GetScriptableParentOrNull()) {
+        !outerWindow->GetInProcessScriptableParentOrNull()) {
       array.AppendElement(outerWindow);
     }
   }
 
   return array;
 }
 
 TabGroup::HashEntry::HashEntry(const nsACString* aKey)
--- a/dom/base/ThirdPartyUtil.cpp
+++ b/dom/base/ThirdPartyUtil.cpp
@@ -192,19 +192,19 @@ ThirdPartyUtil::IsThirdPartyWindow(mozID
     if (result) {
       *aResult = true;
       return NS_OK;
     }
   }
 
   nsPIDOMWindowOuter* current = nsPIDOMWindowOuter::From(aWindow);
   do {
-    // We use GetScriptableParent rather than GetParent because we consider
-    // <iframe mozbrowser> to be a top-level frame.
-    nsPIDOMWindowOuter* parent = current->GetScriptableParent();
+    // We use GetInProcessScriptableParent rather than GetParent because we
+    // consider <iframe mozbrowser> to be a top-level frame.
+    nsPIDOMWindowOuter* parent = current->GetInProcessScriptableParent();
     // We don't use SameCOMIdentity here since we know that nsPIDOMWindowOuter
     // is only implemented by nsGlobalWindowOuter, so different objects of that
     // type will not have different nsISupports COM identities, and checking the
     // actual COM identity using SameCOMIdentity is expensive due to the virtual
     // calls involved.
     if (parent == current) {
       // We're at the topmost content window. We already know the answer.
       *aResult = false;
--- a/dom/base/nsCCUncollectableMarker.cpp
+++ b/dom/base/nsCCUncollectableMarker.cpp
@@ -252,20 +252,20 @@ void MarkDocShell(nsIDocShellTreeItem* a
       nsCOMPtr<nsISHEntry> shEntry;
       history->LegacySHistory()->GetEntryAtIndex(i, getter_AddRefs(shEntry));
 
       MarkSHEntry(shEntry, aCleanupJS);
     }
   }
 
   int32_t i, childCount;
-  aNode->GetChildCount(&childCount);
+  aNode->GetInProcessChildCount(&childCount);
   for (i = 0; i < childCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> child;
-    aNode->GetChildAt(i, getter_AddRefs(child));
+    aNode->GetInProcessChildAt(i, getter_AddRefs(child));
     MarkDocShell(child, aCleanupJS);
   }
 }
 
 void MarkWindowList(nsISimpleEnumerator* aWindowList, bool aCleanupJS) {
   nsCOMPtr<nsISupports> iter;
   while (NS_SUCCEEDED(aWindowList->GetNext(getter_AddRefs(iter))) && iter) {
     if (nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryInterface(iter)) {
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -510,17 +510,17 @@ nsContentPermissionRequester::GetOnVisib
       mListener->GetCallback();
   callback.forget(aCallback);
   return NS_OK;
 }
 
 static nsIPrincipal* GetTopLevelPrincipal(nsPIDOMWindowInner* aWindow) {
   MOZ_ASSERT(aWindow);
 
-  nsPIDOMWindowOuter* top = aWindow->GetScriptableTop();
+  nsPIDOMWindowOuter* top = aWindow->GetInProcessScriptableTop();
   if (!top) {
     return nullptr;
   }
 
   nsPIDOMWindowInner* inner = top->GetCurrentInnerWindow();
   if (!inner) {
     return nullptr;
   }
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -2179,17 +2179,17 @@ nsINode* nsContentUtils::GetCrossDocPare
     parent = aChild->AsContent()->GetFlattenedTreeParent();
   }
 
   if (parent || !aChild->IsDocument()) {
     return parent;
   }
 
   Document* doc = aChild->AsDocument();
-  Document* parentDoc = doc->GetParentDocument();
+  Document* parentDoc = doc->GetInProcessParentDocument();
   return parentDoc ? parentDoc->FindContentForSubDocument(doc) : nullptr;
 }
 
 bool nsContentUtils::ContentIsHostIncludingDescendantOf(
     const nsINode* aPossibleDescendant, const nsINode* aPossibleAncestor) {
   MOZ_ASSERT(aPossibleDescendant, "The possible descendant is null!");
   MOZ_ASSERT(aPossibleAncestor, "The possible ancestor is null!");
 
@@ -3762,17 +3762,17 @@ void nsContentUtils::LogMessageToConsole
   }
   sConsoleService->LogStringMessage(NS_ConvertUTF8toUTF16(aMsg).get());
 }
 
 bool nsContentUtils::IsChildOfSameType(Document* aDoc) {
   nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(aDoc->GetDocShell());
   nsCOMPtr<nsIDocShellTreeItem> sameTypeParent;
   if (docShellAsItem) {
-    docShellAsItem->GetSameTypeParent(getter_AddRefs(sameTypeParent));
+    docShellAsItem->GetInProcessSameTypeParent(getter_AddRefs(sameTypeParent));
   }
   return sameTypeParent != nullptr;
 }
 
 bool nsContentUtils::IsPlainTextType(const nsACString& aContentType) {
   // NOTE: if you add a type here, add it to the CONTENTDLF_CATEGORIES
   // define in nsContentDLF.h as well.
   return aContentType.EqualsLiteral(TEXT_PLAIN) ||
@@ -5415,17 +5415,17 @@ bool nsContentUtils::CheckForSubFrameDro
   // If there is no source node, then this is a drag from another
   // application, which should be allowed.
   RefPtr<Document> doc;
   aDragSession->GetSourceDocument(getter_AddRefs(doc));
   if (doc) {
     // Get each successive parent of the source document and compare it to
     // the drop document. If they match, then this is a drag from a child frame.
     do {
-      doc = doc->GetParentDocument();
+      doc = doc->GetInProcessParentDocument();
       if (doc == targetDoc) {
         // The drag is from a child frame.
         return true;
       }
     } while (doc);
   }
 
   return false;
@@ -6047,20 +6047,21 @@ void nsContentUtils::FlushLayoutForTree(
   // usually pretty shallow.
 
   if (RefPtr<Document> doc = aWindow->GetDoc()) {
     doc->FlushPendingNotifications(FlushType::Layout);
   }
 
   if (nsCOMPtr<nsIDocShell> docShell = aWindow->GetDocShell()) {
     int32_t i = 0, i_end;
-    docShell->GetChildCount(&i_end);
+    docShell->GetInProcessChildCount(&i_end);
     for (; i < i_end; ++i) {
       nsCOMPtr<nsIDocShellTreeItem> item;
-      if (docShell->GetChildAt(i, getter_AddRefs(item)) == NS_OK && item) {
+      if (docShell->GetInProcessChildAt(i, getter_AddRefs(item)) == NS_OK &&
+          item) {
         if (nsCOMPtr<nsPIDOMWindowOuter> win = item->GetWindow()) {
           FlushLayoutForTree(win);
         }
       }
     }
   }
 }
 
@@ -6126,17 +6127,17 @@ PresShell* nsContentUtils::FindPresShell
     // created yet.
     // Walk the docshell tree to find the nearest container that has a
     // presshell, and return that.
     nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(docShellTreeItem);
     if (PresShell* presShell = docShell->GetPresShell()) {
       return presShell;
     }
     nsCOMPtr<nsIDocShellTreeItem> parent;
-    docShellTreeItem->GetParent(getter_AddRefs(parent));
+    docShellTreeItem->GetInProcessParent(getter_AddRefs(parent));
     docShellTreeItem = parent;
   }
 
   return nullptr;
 }
 
 nsIWidget* nsContentUtils::WidgetForDocument(const Document* aDocument) {
   PresShell* presShell = FindPresShellForDocument(aDocument);
@@ -6512,18 +6513,18 @@ void nsContentUtils::FireMutationEventsF
 }
 
 /* static */
 Document* nsContentUtils::GetRootDocument(Document* aDoc) {
   if (!aDoc) {
     return nullptr;
   }
   Document* doc = aDoc;
-  while (doc->GetParentDocument()) {
-    doc = doc->GetParentDocument();
+  while (doc->GetInProcessParentDocument()) {
+    doc = doc->GetInProcessParentDocument();
   }
   return doc;
 }
 
 /* static */
 bool nsContentUtils::IsInPointerLockContext(nsPIDOMWindowOuter* aWin) {
   if (!aWin) {
     return false;
@@ -6531,18 +6532,18 @@ bool nsContentUtils::IsInPointerLockCont
 
   nsCOMPtr<Document> pointerLockedDoc =
       do_QueryReferent(EventStateManager::sPointerLockedDoc);
   if (!pointerLockedDoc || !pointerLockedDoc->GetWindow()) {
     return false;
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> lockTop =
-      pointerLockedDoc->GetWindow()->GetScriptableTop();
-  nsCOMPtr<nsPIDOMWindowOuter> top = aWin->GetScriptableTop();
+      pointerLockedDoc->GetWindow()->GetInProcessScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> top = aWin->GetInProcessScriptableTop();
 
   return top == lockTop;
 }
 
 // static
 int32_t nsContentUtils::GetAdjustedOffsetInTextControl(nsIFrame* aOffsetFrame,
                                                        int32_t aOffset) {
   // The structure of the anonymous frames within a text control frame is
@@ -6928,17 +6929,17 @@ bool nsContentUtils::PrefetchPreloadEnab
   nsCOMPtr<nsIDocShellTreeItem> parentItem;
 
   do {
     auto appType = docshell->GetAppType();
     if (appType == nsIDocShell::APP_TYPE_MAIL) {
       return false;  // do not prefetch, preload, preconnect from mailnews
     }
 
-    docshell->GetParent(getter_AddRefs(parentItem));
+    docshell->GetInProcessParent(getter_AddRefs(parentItem));
     if (parentItem) {
       docshell = do_QueryInterface(parentItem);
       if (!docshell) {
         NS_ERROR("cannot get a docshell from a treeItem!");
         return false;
       }
     }
   } while (parentItem);
@@ -7809,21 +7810,21 @@ nsresult nsContentUtils::SendMouseEvent(
 void nsContentUtils::FirePageHideEvent(nsIDocShellTreeItem* aItem,
                                        EventTarget* aChromeEventHandler,
                                        bool aOnlySystemGroup) {
   RefPtr<Document> doc = aItem->GetDocument();
   NS_ASSERTION(doc, "What happened here?");
   doc->OnPageHide(true, aChromeEventHandler, aOnlySystemGroup);
 
   int32_t childCount = 0;
-  aItem->GetChildCount(&childCount);
+  aItem->GetInProcessChildCount(&childCount);
   AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
   kids.AppendElements(childCount);
   for (int32_t i = 0; i < childCount; ++i) {
-    aItem->GetChildAt(i, getter_AddRefs(kids[i]));
+    aItem->GetInProcessChildAt(i, getter_AddRefs(kids[i]));
   }
 
   for (uint32_t i = 0; i < kids.Length(); ++i) {
     if (kids[i]) {
       FirePageHideEvent(kids[i], aChromeEventHandler, aOnlySystemGroup);
     }
   }
 }
@@ -7833,21 +7834,21 @@ void nsContentUtils::FirePageHideEvent(n
 // on documents that are still loading or only on documents that are already
 // loaded.
 /* static */
 void nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem,
                                        EventTarget* aChromeEventHandler,
                                        bool aFireIfShowing,
                                        bool aOnlySystemGroup) {
   int32_t childCount = 0;
-  aItem->GetChildCount(&childCount);
+  aItem->GetInProcessChildCount(&childCount);
   AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
   kids.AppendElements(childCount);
   for (int32_t i = 0; i < childCount; ++i) {
-    aItem->GetChildAt(i, getter_AddRefs(kids[i]));
+    aItem->GetInProcessChildAt(i, getter_AddRefs(kids[i]));
   }
 
   for (uint32_t i = 0; i < kids.Length(); ++i) {
     if (kids[i]) {
       FirePageShowEvent(kids[i], aChromeEventHandler, aFireIfShowing,
                         aOnlySystemGroup);
     }
   }
@@ -8749,17 +8750,17 @@ void nsContentUtils::GetPresentationURL(
     nsAutoCString uriStr;
     uri->GetSpec(uriStr);
     aPresentationUrl = NS_ConvertUTF8toUTF16(uriStr);
     return;
   }
 
   if (XRE_IsContentProcess()) {
     nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
-    aDocShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
+    aDocShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
     nsCOMPtr<nsIDocShellTreeItem> root;
     aDocShell->GetRootTreeItem(getter_AddRefs(root));
     if (sameTypeRoot.get() == root.get()) {
       // presentation URL is stored in BrowserChild for the top most
       // <iframe mozbrowser> in content process.
       BrowserChild* browserChild = BrowserChild::GetFrom(aDocShell);
       if (browserChild) {
         aPresentationUrl = browserChild->PresentationURL();
@@ -9590,17 +9591,17 @@ bool nsContentUtils::ShouldBlockReserved
         do_QueryInterface(aKeyEvent->mOriginalTarget);
     if (content) {
       Document* doc = content->GetUncomposedDoc();
       if (doc) {
         nsCOMPtr<nsIDocShellTreeItem> docShell = doc->GetDocShell();
         if (docShell &&
             docShell->ItemType() == nsIDocShellTreeItem::typeContent) {
           nsCOMPtr<nsIDocShellTreeItem> rootItem;
-          docShell->GetSameTypeRootTreeItem(getter_AddRefs(rootItem));
+          docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(rootItem));
           if (rootItem && rootItem->GetDocument()) {
             principal = rootItem->GetDocument()->NodePrincipal();
           }
         }
       }
     }
   }
 
--- a/dom/base/nsDOMNavigationTiming.cpp
+++ b/dom/base/nsDOMNavigationTiming.cpp
@@ -530,14 +530,15 @@ mozilla::TimeStamp nsDOMNavigationTiming
 bool nsDOMNavigationTiming::IsTopLevelContentDocumentInContentProcess() const {
   if (!mDocShell) {
     return false;
   }
   if (!XRE_IsContentProcess()) {
     return false;
   }
   nsCOMPtr<nsIDocShellTreeItem> rootItem;
-  Unused << mDocShell->GetSameTypeRootTreeItem(getter_AddRefs(rootItem));
+  Unused << mDocShell->GetInProcessSameTypeRootTreeItem(
+      getter_AddRefs(rootItem));
   if (rootItem.get() != static_cast<nsIDocShellTreeItem*>(mDocShell.get())) {
     return false;
   }
   return rootItem->ItemType() == nsIDocShellTreeItem::typeContent;
 }
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -968,17 +968,17 @@ nsFocusManager::WindowHidden(mozIDOMWind
   // the focused window so that it points to the one being hidden. This
   // ensures that the focused window isn't in a chain of frames that doesn't
   // exist any more.
   if (window != mFocusedWindow) {
     nsCOMPtr<nsIDocShellTreeItem> dsti =
         mFocusedWindow ? mFocusedWindow->GetDocShell() : nullptr;
     if (dsti) {
       nsCOMPtr<nsIDocShellTreeItem> parentDsti;
-      dsti->GetParent(getter_AddRefs(parentDsti));
+      dsti->GetInProcessParent(getter_AddRefs(parentDsti));
       if (parentDsti) {
         if (nsCOMPtr<nsPIDOMWindowOuter> parentWindow = parentDsti->GetWindow())
           parentWindow->SetFocusedElement(nullptr);
       }
     }
 
     SetFocusedWindowInternal(window);
   }
@@ -1183,17 +1183,17 @@ void nsFocusManager::SetFocusInner(Eleme
     docShell->GetIsInUnload(&inUnload);
     if (inUnload) return;
 
     bool beingDestroyed;
     docShell->IsBeingDestroyed(&beingDestroyed);
     if (beingDestroyed) return;
 
     nsCOMPtr<nsIDocShellTreeItem> parentDsti;
-    docShell->GetParent(getter_AddRefs(parentDsti));
+    docShell->GetInProcessParent(getter_AddRefs(parentDsti));
     docShell = do_QueryInterface(parentDsti);
   }
 
   // if the new element is in the same window as the currently focused element
   bool isElementInFocusedWindow = (mFocusedWindow == newWindow);
 
   if (!isElementInFocusedWindow && mFocusedWindow && newWindow &&
       nsContentUtils::IsHandlingKeyBoardEvent()) {
@@ -1353,17 +1353,17 @@ bool nsFocusManager::IsSameOrAncestor(ns
     return false;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> ancestordsti = aPossibleAncestor->GetDocShell();
   nsCOMPtr<nsIDocShellTreeItem> dsti = aWindow->GetDocShell();
   while (dsti) {
     if (dsti == ancestordsti) return true;
     nsCOMPtr<nsIDocShellTreeItem> parentDsti;
-    dsti->GetParent(getter_AddRefs(parentDsti));
+    dsti->GetInProcessParent(getter_AddRefs(parentDsti));
     dsti.swap(parentDsti);
   }
 
   return false;
 }
 
 already_AddRefed<nsPIDOMWindowOuter> nsFocusManager::GetCommonAncestor(
     nsPIDOMWindowOuter* aWindow1, nsPIDOMWindowOuter* aWindow2) {
@@ -1374,23 +1374,23 @@ already_AddRefed<nsPIDOMWindowOuter> nsF
 
   nsCOMPtr<nsIDocShellTreeItem> dsti2 = aWindow2->GetDocShell();
   NS_ENSURE_TRUE(dsti2, nullptr);
 
   AutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
   do {
     parents1.AppendElement(dsti1);
     nsCOMPtr<nsIDocShellTreeItem> parentDsti1;
-    dsti1->GetParent(getter_AddRefs(parentDsti1));
+    dsti1->GetInProcessParent(getter_AddRefs(parentDsti1));
     dsti1.swap(parentDsti1);
   } while (dsti1);
   do {
     parents2.AppendElement(dsti2);
     nsCOMPtr<nsIDocShellTreeItem> parentDsti2;
-    dsti2->GetParent(getter_AddRefs(parentDsti2));
+    dsti2->GetInProcessParent(getter_AddRefs(parentDsti2));
     dsti2.swap(parentDsti2);
   } while (dsti2);
 
   uint32_t pos1 = parents1.Length();
   uint32_t pos2 = parents2.Length();
   nsIDocShellTreeItem* parent = nullptr;
   uint32_t len;
   for (len = std::min(pos1, pos2); len > 0; --len) {
@@ -1414,17 +1414,17 @@ void nsFocusManager::AdjustWindowFocus(n
   while (window) {
     // get the containing <iframe> or equivalent element so that it can be
     // focused below.
     nsCOMPtr<Element> frameElement = window->GetFrameElementInternal();
 
     nsCOMPtr<nsIDocShellTreeItem> dsti = window->GetDocShell();
     if (!dsti) return;
     nsCOMPtr<nsIDocShellTreeItem> parentDsti;
-    dsti->GetParent(getter_AddRefs(parentDsti));
+    dsti->GetInProcessParent(getter_AddRefs(parentDsti));
     if (!parentDsti) {
       return;
     }
 
     window = parentDsti->GetWindow();
     if (window) {
       // if the parent window is visible but aWindow was not, then we have
       // likely moved up and out from a hidden tab to the browser window, or a
@@ -4015,17 +4015,17 @@ void nsFocusManager::SetFocusedWindowInt
     nsCOMPtr<nsIRunnable> runnable = new PointerUnlocker();
     NS_DispatchToCurrentThread(runnable);
   }
 
   // Update the last focus time on any affected documents
   if (aWindow && aWindow != mFocusedWindow) {
     const TimeStamp now(TimeStamp::Now());
     for (Document* doc = aWindow->GetExtantDoc(); doc;
-         doc = doc->GetParentDocument()) {
+         doc = doc->GetInProcessParentDocument()) {
       doc->SetLastFocusTime(now);
     }
   }
 
   mFocusedWindow = aWindow;
 }
 
 void nsFocusManager::MarkUncollectableForCCGeneration(uint32_t aGeneration) {
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -727,20 +727,20 @@ nsDocShell* nsFrameLoader::GetDocShell(E
 static void SetTreeOwnerAndChromeEventHandlerOnDocshellTree(
     nsIDocShellTreeItem* aItem, nsIDocShellTreeOwner* aOwner,
     EventTarget* aHandler) {
   MOZ_ASSERT(aItem, "Must have item");
 
   aItem->SetTreeOwner(aOwner);
 
   int32_t childCount = 0;
-  aItem->GetChildCount(&childCount);
+  aItem->GetInProcessChildCount(&childCount);
   for (int32_t i = 0; i < childCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> item;
-    aItem->GetChildAt(i, getter_AddRefs(item));
+    aItem->GetInProcessChildAt(i, getter_AddRefs(item));
     if (aHandler) {
       nsCOMPtr<nsIDocShell> shell(do_QueryInterface(item));
       shell->SetChromeEventHandler(aHandler);
     }
     SetTreeOwnerAndChromeEventHandlerOnDocshellTree(item, aOwner, aHandler);
   }
 }
 
@@ -758,17 +758,17 @@ static bool CheckDocShellType(mozilla::d
     }
   }
 
   if (isContent) {
     return aDocShell->ItemType() == nsIDocShellTreeItem::typeContent;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> parent;
-  aDocShell->GetParent(getter_AddRefs(parent));
+  aDocShell->GetInProcessParent(getter_AddRefs(parent));
 
   return parent && parent->ItemType() == aDocShell->ItemType();
 }
 #endif  // defined(MOZ_DIAGNOSTIC_ASSERT_ENABLED)
 
 /**
  * Hook up a given TreeItem to its tree owner. aItem's type must have already
  * been set, and it should already be part of the DocShellTree.
@@ -793,21 +793,21 @@ void nsFrameLoader::AddTreeItemToTreeOwn
       aOwner->ContentShellAdded(aItem, is_primary);
     }
   }
 }
 
 static bool AllDescendantsOfType(nsIDocShellTreeItem* aParentItem,
                                  int32_t aType) {
   int32_t childCount = 0;
-  aParentItem->GetChildCount(&childCount);
+  aParentItem->GetInProcessChildCount(&childCount);
 
   for (int32_t i = 0; i < childCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> kid;
-    aParentItem->GetChildAt(i, getter_AddRefs(kid));
+    aParentItem->GetInProcessChildAt(i, getter_AddRefs(kid));
 
     if (kid->ItemType() != aType || !AllDescendantsOfType(kid, aType)) {
       return false;
     }
   }
 
   return true;
 }
@@ -1436,18 +1436,20 @@ nsresult nsFrameLoader::SwapWithOtherLoa
     // How odd
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   // To avoid having to mess with session history, avoid swapping
   // frameloaders that don't correspond to root same-type docshells,
   // unless both roots have session history disabled.
   nsCOMPtr<nsIDocShellTreeItem> ourRootTreeItem, otherRootTreeItem;
-  ourDocshell->GetSameTypeRootTreeItem(getter_AddRefs(ourRootTreeItem));
-  otherDocshell->GetSameTypeRootTreeItem(getter_AddRefs(otherRootTreeItem));
+  ourDocshell->GetInProcessSameTypeRootTreeItem(
+      getter_AddRefs(ourRootTreeItem));
+  otherDocshell->GetInProcessSameTypeRootTreeItem(
+      getter_AddRefs(otherRootTreeItem));
   nsCOMPtr<nsIWebNavigation> ourRootWebnav = do_QueryInterface(ourRootTreeItem);
   nsCOMPtr<nsIWebNavigation> otherRootWebnav =
       do_QueryInterface(otherRootTreeItem);
 
   if (!ourRootWebnav || !otherRootWebnav) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
@@ -1481,18 +1483,18 @@ nsresult nsFrameLoader::SwapWithOtherLoa
   // Save off the tree owners, frame elements, chrome event handlers, and
   // docshell and document parents before doing anything else.
   nsCOMPtr<nsIDocShellTreeOwner> ourOwner, otherOwner;
   ourDocshell->GetTreeOwner(getter_AddRefs(ourOwner));
   otherDocshell->GetTreeOwner(getter_AddRefs(otherOwner));
   // Note: it's OK to have null treeowners.
 
   nsCOMPtr<nsIDocShellTreeItem> ourParentItem, otherParentItem;
-  ourDocshell->GetParent(getter_AddRefs(ourParentItem));
-  otherDocshell->GetParent(getter_AddRefs(otherParentItem));
+  ourDocshell->GetInProcessParent(getter_AddRefs(ourParentItem));
+  otherDocshell->GetInProcessParent(getter_AddRefs(otherParentItem));
   if (!ourParentItem || !otherParentItem) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   // Make sure our parents are the same type too
   int32_t ourParentType = ourParentItem->ItemType();
   int32_t otherParentType = otherParentItem->ItemType();
   if (ourParentType != otherParentType) {
@@ -1521,19 +1523,20 @@ nsresult nsFrameLoader::SwapWithOtherLoa
 
   nsCOMPtr<Document> ourChildDocument = ourWindow->GetExtantDoc();
   nsCOMPtr<Document> otherChildDocument = otherWindow->GetExtantDoc();
   if (!ourChildDocument || !otherChildDocument) {
     // This shouldn't be happening
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
-  nsCOMPtr<Document> ourParentDocument = ourChildDocument->GetParentDocument();
+  nsCOMPtr<Document> ourParentDocument =
+      ourChildDocument->GetInProcessParentDocument();
   nsCOMPtr<Document> otherParentDocument =
-      otherChildDocument->GetParentDocument();
+      otherChildDocument->GetInProcessParentDocument();
 
   // Make sure to swap docshells between the two frames.
   Document* ourDoc = ourContent->GetComposedDoc();
   Document* otherDoc = otherContent->GetComposedDoc();
   if (!ourDoc || !otherDoc) {
     // Again, how odd, given that we had docshells
     return NS_ERROR_NOT_IMPLEMENTED;
   }
@@ -1786,17 +1789,17 @@ void nsFrameLoader::StartDestroy() {
       GetDocShell()->RemoveFromSessionHistory();
     }
   }
 
   // Let the tree owner know we're gone.
   if (mIsTopLevelContent) {
     if (GetDocShell()) {
       nsCOMPtr<nsIDocShellTreeItem> parentItem;
-      GetDocShell()->GetParent(getter_AddRefs(parentItem));
+      GetDocShell()->GetInProcessParent(getter_AddRefs(parentItem));
       nsCOMPtr<nsIDocShellTreeOwner> owner = do_GetInterface(parentItem);
       if (owner) {
         owner->ContentShellRemoved(GetDocShell());
       }
     }
   }
 
   // Let our window know that we are gone
@@ -2178,17 +2181,17 @@ nsresult nsFrameLoader::MaybeCreateDocSh
     attrs = oa;
   }
 
   if (OwnerIsMozBrowserFrame()) {
     attrs.mInIsolatedMozBrowser = OwnerIsIsolatedMozBrowserFrame();
     docShell->SetFrameType(nsIDocShell::FRAME_TYPE_BROWSER);
   } else {
     nsCOMPtr<nsIDocShellTreeItem> parentCheck;
-    docShell->GetSameTypeParent(getter_AddRefs(parentCheck));
+    docShell->GetInProcessSameTypeParent(getter_AddRefs(parentCheck));
     if (!!parentCheck) {
       docShell->SetIsFrame();
     }
   }
 
   // Apply sandbox flags even if our owner is not an iframe, as this copies
   // flags from our owning content's owning document.
   // Note: ApplySandboxFlags should be called after docShell->SetFrameType
@@ -2334,31 +2337,31 @@ nsresult nsFrameLoader::CheckForRecursiv
     // No need to do recursion-protection here XXXbz why not??  Do we really
     // trust people not to screw up with non-content docshells?
     return NS_OK;
   }
 
   // Bug 8065: Don't exceed some maximum depth in content frames
   // (MAX_DEPTH_CONTENT_FRAMES)
   nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
-  GetDocShell()->GetSameTypeParent(getter_AddRefs(parentAsItem));
+  GetDocShell()->GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
   int32_t depth = 0;
   while (parentAsItem) {
     ++depth;
 
     if (depth >= MAX_DEPTH_CONTENT_FRAMES) {
       mDepthTooGreat = true;
       NS_WARNING("Too many nested content frames so giving up");
 
       return NS_ERROR_UNEXPECTED;  // Too deep, give up!  (silently?)
     }
 
     nsCOMPtr<nsIDocShellTreeItem> temp;
     temp.swap(parentAsItem);
-    temp->GetSameTypeParent(getter_AddRefs(parentAsItem));
+    temp->GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
   }
 
   // Bug 136580: Check for recursive frame loading excluding about:srcdoc URIs.
   // srcdoc URIs require their contents to be specified inline, so it isn't
   // possible for undesirable recursion to occur without the aid of a
   // non-srcdoc URI,  which this method will block normally.
   // Besides, URI is not enough to guarantee uniqueness of srcdoc documents.
   nsAutoCString buffer;
@@ -2366,17 +2369,17 @@ nsresult nsFrameLoader::CheckForRecursiv
   if (NS_SUCCEEDED(rv) && buffer.EqualsLiteral("about")) {
     rv = aURI->GetPathQueryRef(buffer);
     if (NS_SUCCEEDED(rv) && buffer.EqualsLiteral("srcdoc")) {
       // Duplicates allowed up to depth limits
       return NS_OK;
     }
   }
   int32_t matchCount = 0;
-  GetDocShell()->GetSameTypeParent(getter_AddRefs(parentAsItem));
+  GetDocShell()->GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
   while (parentAsItem) {
     // Check the parent URI with the URI we're loading
     nsCOMPtr<nsIWebNavigation> parentAsNav(do_QueryInterface(parentAsItem));
     if (parentAsNav) {
       // Does the URI match the one we're about to load?
       nsCOMPtr<nsIURI> parentURI;
       parentAsNav->GetCurrentURI(getter_AddRefs(parentURI));
       if (parentURI) {
@@ -2393,17 +2396,17 @@ nsresult nsFrameLoader::CheckForRecursiv
                 "so giving up");
             return NS_ERROR_UNEXPECTED;
           }
         }
       }
     }
     nsCOMPtr<nsIDocShellTreeItem> temp;
     temp.swap(parentAsItem);
-    temp->GetSameTypeParent(getter_AddRefs(parentAsItem));
+    temp->GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
   }
 
   return NS_OK;
 }
 
 nsresult nsFrameLoader::GetWindowDimensions(nsIntRect& aRect) {
   // Need to get outer window position here
   Document* doc = mOwnerContent->GetComposedDoc();
@@ -3096,17 +3099,17 @@ void nsFrameLoader::AttributeChanged(moz
   // if our parent is chrome, since in all other cases we're random content
   // subframes and the treeowner shouldn't worry about us.
   if (!GetDocShell()) {
     MaybeUpdatePrimaryBrowserParent(eBrowserParentChanged);
     return;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> parentItem;
-  GetDocShell()->GetParent(getter_AddRefs(parentItem));
+  GetDocShell()->GetInProcessParent(getter_AddRefs(parentItem));
   if (!parentItem) {
     return;
   }
 
   if (parentItem->ItemType() != nsIDocShellTreeItem::typeChrome) {
     return;
   }
 
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -1838,17 +1838,17 @@ void nsGlobalWindowInner::UpdateParentTa
   // child global, and if it doesn't have one, just use the chrome event
   // handler itself.
 
   nsCOMPtr<Element> frameElement = GetOuterWindow()->GetFrameElementInternal();
   nsCOMPtr<EventTarget> eventTarget =
       nsContentUtils::TryGetBrowserChildGlobal(frameElement);
 
   if (!eventTarget) {
-    nsGlobalWindowOuter* topWin = GetScriptableTopInternal();
+    nsGlobalWindowOuter* topWin = GetInProcessScriptableTopInternal();
     if (topWin) {
       frameElement = topWin->GetFrameElementInternal();
       eventTarget = nsContentUtils::TryGetBrowserChildGlobal(frameElement);
     }
   }
 
   if (!eventTarget) {
     eventTarget = nsContentUtils::TryGetBrowserChildGlobal(mChromeEventHandler);
@@ -1892,20 +1892,20 @@ void nsGlobalWindowInner::GetEventTarget
       }
     }
   }
 
   aVisitor.SetParentTarget(GetParentTarget(), true);
 }
 
 bool nsGlobalWindowInner::DialogsAreBeingAbused() {
-  NS_ASSERTION(
-      GetScriptableTopInternal() &&
-          GetScriptableTopInternal()->GetCurrentInnerWindowInternal() == this,
-      "DialogsAreBeingAbused called with invalid window");
+  NS_ASSERTION(GetInProcessScriptableTopInternal() &&
+                   GetInProcessScriptableTopInternal()
+                           ->GetCurrentInnerWindowInternal() == this,
+               "DialogsAreBeingAbused called with invalid window");
 
   if (mLastDialogQuitTime.IsNull() || nsContentUtils::IsCallerChrome()) {
     return false;
   }
 
   TimeDuration dialogInterval(TimeStamp::Now() - mLastDialogQuitTime);
   if (dialogInterval.ToSeconds() <
       Preferences::GetInt("dom.successive_dialog_time_limit",
@@ -2082,17 +2082,17 @@ nsIPrincipal* nsGlobalWindowInner::GetPr
 
   // If we don't have a principal and we don't have a document we
   // ask the parent window for the principal. This can happen when
   // loading a frameset that has a <frame src="javascript:xxx">, in
   // that case the global window is used in JS before we've loaded
   // a document into the window.
 
   nsCOMPtr<nsIScriptObjectPrincipal> objPrincipal =
-      do_QueryInterface(GetParentInternal());
+      do_QueryInterface(GetInProcessParentInternal());
 
   if (objPrincipal) {
     return objPrincipal->GetPrincipal();
   }
 
   return nullptr;
 }
 
@@ -2105,17 +2105,17 @@ nsIPrincipal* nsGlobalWindowInner::GetEf
   if (mDocumentStoragePrincipal) {
     return mDocumentStoragePrincipal;
   }
 
   // If we don't have a storage principal and we don't have a document we ask
   // the parent window for the storage principal.
 
   nsCOMPtr<nsIScriptObjectPrincipal> objPrincipal =
-      do_QueryInterface(GetParentInternal());
+      do_QueryInterface(GetInProcessParentInternal());
 
   if (objPrincipal) {
     return objPrincipal->GetEffectiveStoragePrincipal();
   }
 
   return nullptr;
 }
 
@@ -2276,17 +2276,17 @@ void nsPIDOMWindowInner::NoteCalledRegis
 void nsPIDOMWindowInner::NoteDOMContentLoaded() {
   nsGlobalWindowInner::Cast(this)->NoteDOMContentLoaded();
 }
 
 bool nsGlobalWindowInner::ShouldReportForServiceWorkerScope(
     const nsAString& aScope) {
   bool result = false;
 
-  nsPIDOMWindowOuter* topOuter = GetScriptableTop();
+  nsPIDOMWindowOuter* topOuter = GetInProcessScriptableTop();
   NS_ENSURE_TRUE(topOuter, false);
 
   nsGlobalWindowInner* topInner =
       nsGlobalWindowInner::Cast(topOuter->GetCurrentInnerWindow());
   NS_ENSURE_TRUE(topInner, false);
 
   topInner->ShouldReportForServiceWorkerScopeInternal(
       NS_ConvertUTF16toUTF8(aScope), &result);
@@ -2475,17 +2475,18 @@ void nsPIDOMWindowInner::TryToCacheTopIn
   nsGlobalWindowInner* window = nsGlobalWindowInner::Cast(this);
 
   MOZ_ASSERT(!window->IsDying());
 
   mHasTriedToCacheTopInnerWindow = true;
 
   MOZ_ASSERT(window);
 
-  if (nsCOMPtr<nsPIDOMWindowOuter> topOutter = window->GetScriptableTop()) {
+  if (nsCOMPtr<nsPIDOMWindowOuter> topOutter =
+          window->GetInProcessScriptableTop()) {
     mTopInnerWindow = topOutter->GetCurrentInnerWindow();
   }
 }
 
 void nsPIDOMWindowInner::UpdateActiveIndexedDBTransactionCount(int32_t aDelta) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (aDelta == 0) {
@@ -2620,35 +2621,36 @@ bool nsGlobalWindowInner::HasActiveSpeec
 #endif
 
 Nullable<WindowProxyHolder> nsGlobalWindowInner::GetParent(
     ErrorResult& aError) {
   FORWARD_TO_OUTER_OR_THROW(GetParentOuter, (), aError, nullptr);
 }
 
 /**
- * GetScriptableParent is called when script reads window.parent.
+ * GetInProcessScriptableParent is called when script reads window.parent.
  *
- * In contrast to GetRealParent, GetScriptableParent respects <iframe
+ * In contrast to GetRealParent, GetInProcessScriptableParent respects <iframe
  * mozbrowser> boundaries, so if |this| is contained by an <iframe
  * mozbrowser>, we will return |this| as its own parent.
  */
-nsPIDOMWindowOuter* nsGlobalWindowInner::GetScriptableParent() {
-  FORWARD_TO_OUTER(GetScriptableParent, (), nullptr);
+nsPIDOMWindowOuter* nsGlobalWindowInner::GetInProcessScriptableParent() {
+  FORWARD_TO_OUTER(GetInProcessScriptableParent, (), nullptr);
 }
 
 /**
- * GetScriptableTop is called when script reads window.top.
+ * GetInProcessScriptableTop is called when script reads window.top.
  *
- * In contrast to GetRealTop, GetScriptableTop respects <iframe mozbrowser>
- * boundaries.  If we encounter a window owned by an <iframe mozbrowser> while
- * walking up the window hierarchy, we'll stop and return that window.
+ * In contrast to GetRealTop, GetInProcessScriptableTop respects <iframe
+ * mozbrowser> boundaries.  If we encounter a window owned by an <iframe
+ * mozbrowser> while walking up the window hierarchy, we'll stop and return that
+ * window.
  */
-nsPIDOMWindowOuter* nsGlobalWindowInner::GetScriptableTop() {
-  FORWARD_TO_OUTER(GetScriptableTop, (), nullptr);
+nsPIDOMWindowOuter* nsGlobalWindowInner::GetInProcessScriptableTop() {
+  FORWARD_TO_OUTER(GetInProcessScriptableTop, (), nullptr);
 }
 
 void nsGlobalWindowInner::GetContent(JSContext* aCx,
                                      JS::MutableHandle<JSObject*> aRetval,
                                      CallerType aCallerType,
                                      ErrorResult& aError) {
   FORWARD_TO_OUTER_OR_THROW(GetContentOuter,
                             (aCx, aRetval, aCallerType, aError), aError, );
@@ -5392,24 +5394,24 @@ nsGlobalWindowInner::CallState nsGlobalW
   CallState state = CallState::Continue;
 
   nsCOMPtr<nsIDocShell> docShell = GetDocShell();
   if (!docShell) {
     return state;
   }
 
   int32_t childCount = 0;
-  docShell->GetChildCount(&childCount);
+  docShell->GetInProcessChildCount(&childCount);
 
   // Take a copy of the current children so that modifications to
   // the child list don't affect to the iteration.
   AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> children;
   for (int32_t i = 0; i < childCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> childShell;
-    docShell->GetChildAt(i, getter_AddRefs(childShell));
+    docShell->GetInProcessChildAt(i, getter_AddRefs(childShell));
     if (childShell) {
       children.AppendElement(childShell);
     }
   }
 
   for (nsCOMPtr<nsIDocShellTreeItem> childShell : children) {
     nsCOMPtr<nsPIDOMWindowOuter> pWin = childShell->GetWindow();
     if (!pWin) {
@@ -5561,24 +5563,24 @@ nsresult nsGlobalWindowInner::FireDelaye
   }
 
   // Fires an offline status event if the offline status has changed
   FireOfflineStatusEventIfChanged();
 
   nsCOMPtr<nsIDocShell> docShell = GetDocShell();
   if (docShell) {
     int32_t childCount = 0;
-    docShell->GetChildCount(&childCount);
+    docShell->GetInProcessChildCount(&childCount);
 
     // Take a copy of the current children so that modifications to
     // the child list don't affect to the iteration.
     AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> children;
     for (int32_t i = 0; i < childCount; ++i) {
       nsCOMPtr<nsIDocShellTreeItem> childShell;
-      docShell->GetChildAt(i, getter_AddRefs(childShell));
+      docShell->GetInProcessChildAt(i, getter_AddRefs(childShell));
       if (childShell) {
         children.AppendElement(childShell);
       }
     }
 
     for (nsCOMPtr<nsIDocShellTreeItem> childShell : children) {
       if (nsCOMPtr<nsPIDOMWindowOuter> pWin = childShell->GetWindow()) {
         auto* win = nsGlobalWindowOuter::Cast(pWin);
@@ -5589,32 +5591,32 @@ nsresult nsGlobalWindowInner::FireDelaye
 
   return NS_OK;
 }
 
 //*****************************************************************************
 // nsGlobalWindowInner: Window Control Functions
 //*****************************************************************************
 
-nsPIDOMWindowOuter* nsGlobalWindowInner::GetParentInternal() {
+nsPIDOMWindowOuter* nsGlobalWindowInner::GetInProcessParentInternal() {
   nsGlobalWindowOuter* outer = GetOuterWindowInternal();
   if (!outer) {
     // No outer window available!
     return nullptr;
   }
-  return outer->GetParentInternal();
+  return outer->GetInProcessParentInternal();
 }
 
 nsIPrincipal* nsGlobalWindowInner::GetTopLevelPrincipal() {
   nsPIDOMWindowOuter* outerWindow = GetOuterWindowInternal();
   if (!outerWindow) {
     return nullptr;
   }
 
-  nsPIDOMWindowOuter* topLevelOuterWindow = GetTopInternal();
+  nsPIDOMWindowOuter* topLevelOuterWindow = GetInProcessTopInternal();
   if (!topLevelOuterWindow) {
     return nullptr;
   }
 
   if (topLevelOuterWindow == outerWindow) {
     return nullptr;
   }
 
@@ -5635,17 +5637,17 @@ nsIPrincipal* nsGlobalWindowInner::GetTo
 
 nsIPrincipal* nsGlobalWindowInner::GetTopLevelStorageAreaPrincipal() {
   if (mDoc && (mDoc->StorageAccessSandboxed() ||
                nsContentUtils::IsInPrivateBrowsing(mDoc))) {
     // Storage access is disabled
     return nullptr;
   }
 
-  nsPIDOMWindowOuter* outerWindow = GetParentInternal();
+  nsPIDOMWindowOuter* outerWindow = GetInProcessParentInternal();
   if (!outerWindow) {
     // No outer window available!
     return nullptr;
   }
 
   if (!outerWindow->IsTopLevelWindow()) {
     return nullptr;
   }
--- a/dom/base/nsGlobalWindowInner.h
+++ b/dom/base/nsGlobalWindowInner.h
@@ -404,20 +404,20 @@ class nsGlobalWindowInner final : public
                  JS::MutableHandle<JS::PropertyDescriptor> aDesc);
   // The return value is whether DoResolve might end up resolving the given id.
   // If in doubt, return true.
   static bool MayResolve(jsid aId);
 
   void GetOwnPropertyNames(JSContext* aCx, JS::MutableHandleVector<jsid> aNames,
                            bool aEnumerableOnly, mozilla::ErrorResult& aRv);
 
-  nsPIDOMWindowOuter* GetScriptableTop() override;
-  inline nsGlobalWindowOuter* GetTopInternal();
+  nsPIDOMWindowOuter* GetInProcessScriptableTop() override;
+  inline nsGlobalWindowOuter* GetInProcessTopInternal();
 
-  inline nsGlobalWindowOuter* GetScriptableTopInternal();
+  inline nsGlobalWindowOuter* GetInProcessScriptableTopInternal();
 
   already_AddRefed<mozilla::dom::BrowsingContext> GetChildWindow(
       const nsAString& aName);
 
   inline nsIBrowserChild* GetBrowserChild() { return mBrowserChild.get(); }
 
   // These return true if we've reached the state in this top level window
   // where we ask the user if further dialogs should be blocked.
@@ -626,17 +626,17 @@ class nsGlobalWindowInner final : public
   nsPIDOMWindowOuter* GetOpenerWindow(mozilla::ErrorResult& aError);
   void GetOpener(JSContext* aCx, JS::MutableHandle<JS::Value> aRetval,
                  mozilla::ErrorResult& aError);
   void SetOpener(JSContext* aCx, JS::Handle<JS::Value> aOpener,
                  mozilla::ErrorResult& aError);
   void GetEvent(JSContext* aCx, JS::MutableHandle<JS::Value> aRetval);
   mozilla::dom::Nullable<mozilla::dom::WindowProxyHolder> GetParent(
       mozilla::ErrorResult& aError);
-  nsPIDOMWindowOuter* GetScriptableParent() override;
+  nsPIDOMWindowOuter* GetInProcessScriptableParent() override;
   mozilla::dom::Element* GetFrameElement(nsIPrincipal& aSubjectPrincipal,
                                          mozilla::ErrorResult& aError);
   mozilla::dom::Element* GetFrameElement() override;
   mozilla::dom::Nullable<mozilla::dom::WindowProxyHolder> Open(
       const nsAString& aUrl, const nsAString& aName, const nsAString& aOptions,
       mozilla::ErrorResult& aError);
   nsDOMOfflineResourceList* GetApplicationCache(mozilla::ErrorResult& aError);
   nsDOMOfflineResourceList* GetApplicationCache() override;
@@ -1032,17 +1032,17 @@ class nsGlobalWindowInner final : public
 
   nsresult EnsureClientSource();
   nsresult ExecutionReady();
 
   // Inner windows only.
   nsresult DefineArgumentsProperty(nsIArray* aArguments);
 
   // Get the parent, returns null if this is a toplevel window
-  nsPIDOMWindowOuter* GetParentInternal();
+  nsPIDOMWindowOuter* GetInProcessParentInternal();
 
  public:
   // popup tracking
   bool IsPopupSpamWindow();
 
  private:
   // A type that methods called by CallOnChildren can return.  If Stop
   // is returned then CallOnChildren will stop calling further children.
@@ -1493,27 +1493,28 @@ inline nsISupports* ToCanonicalSupports(
 
 // XXX: EWW - This is an awful hack - let's not do this
 #include "nsGlobalWindowOuter.h"
 
 inline nsIGlobalObject* nsGlobalWindowInner::GetOwnerGlobal() const {
   return const_cast<nsGlobalWindowInner*>(this);
 }
 
-inline nsGlobalWindowOuter* nsGlobalWindowInner::GetTopInternal() {
+inline nsGlobalWindowOuter* nsGlobalWindowInner::GetInProcessTopInternal() {
   nsGlobalWindowOuter* outer = GetOuterWindowInternal();
-  nsCOMPtr<nsPIDOMWindowOuter> top = outer ? outer->GetTop() : nullptr;
+  nsCOMPtr<nsPIDOMWindowOuter> top = outer ? outer->GetInProcessTop() : nullptr;
   if (top) {
     return nsGlobalWindowOuter::Cast(top);
   }
   return nullptr;
 }
 
-inline nsGlobalWindowOuter* nsGlobalWindowInner::GetScriptableTopInternal() {
-  nsPIDOMWindowOuter* top = GetScriptableTop();
+inline nsGlobalWindowOuter*
+nsGlobalWindowInner::GetInProcessScriptableTopInternal() {
+  nsPIDOMWindowOuter* top = GetInProcessScriptableTop();
   return nsGlobalWindowOuter::Cast(top);
 }
 
 inline nsIScriptContext* nsGlobalWindowInner::GetContextInternal() {
   if (mOuterWindow) {
     return GetOuterWindowInternal()->mContext;
   }
 
@@ -1529,12 +1530,12 @@ inline bool nsGlobalWindowInner::IsPopup
   if (!mOuterWindow) {
     return false;
   }
 
   return GetOuterWindowInternal()->mIsPopupSpam;
 }
 
 inline bool nsGlobalWindowInner::IsFrame() {
-  return GetParentInternal() != nullptr;
+  return GetInProcessParentInternal() != nullptr;
 }
 
 #endif /* nsGlobalWindowInner_h___ */
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -1637,27 +1637,27 @@ bool nsGlobalWindowOuter::ComputeIsSecur
     return true;
   }
 
   // Implement https://w3c.github.io/webappsec-secure-contexts/#settings-object
   // With some modifications to allow for aFlags.
 
   bool hadNonSecureContextCreator = false;
 
-  nsPIDOMWindowOuter* parentOuterWin = GetScriptableParent();
+  nsPIDOMWindowOuter* parentOuterWin = GetInProcessScriptableParent();
   MOZ_ASSERT(parentOuterWin, "How can we get here? No docShell somehow?");
   if (nsGlobalWindowOuter::Cast(parentOuterWin) != this) {
     // There may be a small chance that parentOuterWin has navigated in
     // the time that it took us to start loading this sub-document.  If that
     // were the case then parentOuterWin->GetCurrentInnerWindow() wouldn't
     // return the window for the document that is embedding us.  For this
-    // reason we only use the GetScriptableParent call above to check that we
-    // have a same-type parent, but actually get the inner window via the
-    // document that we know is embedding us.
-    Document* creatorDoc = aDocument->GetParentDocument();
+    // reason we only use the GetInProcessScriptableParent call above to check
+    // that we have a same-type parent, but actually get the inner window via
+    // the document that we know is embedding us.
+    Document* creatorDoc = aDocument->GetInProcessParentDocument();
     if (!creatorDoc) {
       return false;  // we must be tearing down
     }
     nsGlobalWindowInner* parentWin =
         nsGlobalWindowInner::Cast(creatorDoc->GetInnerWindow());
     if (!parentWin) {
       return false;  // we must be tearing down
     }
@@ -1790,17 +1790,17 @@ static JS::RealmCreationOptions& SelectZ
     JSContext* aCx, nsIPrincipal* aPrincipal, nsGlobalWindowInner* aNewInner,
     JS::RealmCreationOptions& aOptions) {
   // Use the shared system compartment for chrome windows.
   if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
     return aOptions.setExistingCompartment(xpc::PrivilegedJunkScope());
   }
 
   if (aNewInner->GetOuterWindow()) {
-    nsGlobalWindowOuter* top = aNewInner->GetTopInternal();
+    nsGlobalWindowOuter* top = aNewInner->GetInProcessTopInternal();
     if (top == aNewInner->GetOuterWindow()) {
       // We're a toplevel load.  Use a new zone.  This way, when we do
       // zone-based compartment sharing we won't share compartments
       // across navigations.
       return aOptions.setNewCompartmentAndZone();
     }
 
     // If we have a top-level window, use its zone.
@@ -2400,37 +2400,38 @@ void nsGlobalWindowOuter::SetDocShell(ns
 
   if (aDocShell == mDocShell) {
     return;
   }
 
   mDocShell = aDocShell;
   mBrowsingContext = aDocShell->GetBrowsingContext();
 
-  nsCOMPtr<nsPIDOMWindowOuter> parentWindow = GetScriptableParentOrNull();
+  nsCOMPtr<nsPIDOMWindowOuter> parentWindow =
+      GetInProcessScriptableParentOrNull();
   MOZ_RELEASE_ASSERT(!parentWindow || !mTabGroup ||
                      mTabGroup ==
                          nsGlobalWindowOuter::Cast(parentWindow)->mTabGroup);
 
   mTopLevelOuterContentWindow =
-      !mIsChrome && GetScriptableTopInternal() == this;
+      !mIsChrome && GetInProcessScriptableTopInternal() == this;
 
   // Get our enclosing chrome shell and retrieve its global window impl, so
   // that we can do some forwarding to the chrome document.
   RefPtr<EventTarget> chromeEventHandler;
   mDocShell->GetChromeEventHandler(getter_AddRefs(chromeEventHandler));
   mChromeEventHandler = chromeEventHandler;
   if (!mChromeEventHandler) {
     // We have no chrome event handler. If we have a parent,
     // get our chrome event handler from the parent. If
     // we don't have a parent, then we need to make a new
     // window root object that will function as a chrome event
     // handler and receive all events that occur anywhere inside
     // our window.
-    nsCOMPtr<nsPIDOMWindowOuter> parentWindow = GetParent();
+    nsCOMPtr<nsPIDOMWindowOuter> parentWindow = GetInProcessParent();
     if (parentWindow.get() != this) {
       mChromeEventHandler = parentWindow->GetChromeEventHandler();
     } else {
       mChromeEventHandler = NS_NewWindowRoot(this);
       mIsRootOuterWindow = true;
     }
   }
 
@@ -2582,17 +2583,17 @@ void nsGlobalWindowOuter::UpdateParentTa
   // manager).  If that fails, fall back to the chrome event handler's tab
   // child global, and if it doesn't have one, just use the chrome event
   // handler itself.
 
   nsCOMPtr<Element> frameElement = GetFrameElementInternal();
   mMessageManager = nsContentUtils::TryGetBrowserChildGlobal(frameElement);
 
   if (!mMessageManager) {
-    nsGlobalWindowOuter* topWin = GetScriptableTopInternal();
+    nsGlobalWindowOuter* topWin = GetInProcessScriptableTopInternal();
     if (topWin) {
       frameElement = topWin->GetFrameElementInternal();
       mMessageManager = nsContentUtils::TryGetBrowserChildGlobal(frameElement);
     }
   }
 
   if (!mMessageManager) {
     mMessageManager =
@@ -2610,34 +2611,34 @@ EventTarget* nsGlobalWindowOuter::GetTar
   return GetCurrentInnerWindowInternal();
 }
 
 void nsGlobalWindowOuter::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
   MOZ_CRASH("The outer window should not be part of an event path");
 }
 
 bool nsGlobalWindowOuter::ShouldPromptToBlockDialogs() {
-  nsGlobalWindowOuter* topWindowOuter = GetScriptableTopInternal();
+  nsGlobalWindowOuter* topWindowOuter = GetInProcessScriptableTopInternal();
   if (!topWindowOuter) {
     NS_ASSERTION(!mDocShell,
                  "ShouldPromptToBlockDialogs() called without a top window?");
     return true;
   }
 
   nsGlobalWindowInner* topWindow =
       topWindowOuter->GetCurrentInnerWindowInternal();
   if (!topWindow) {
     return true;
   }
 
   return topWindow->DialogsAreBeingAbused();
 }
 
 bool nsGlobalWindowOuter::AreDialogsEnabled() {
-  nsGlobalWindowOuter* topWindowOuter = GetScriptableTopInternal();
+  nsGlobalWindowOuter* topWindowOuter = GetInProcessScriptableTopInternal();
   if (!topWindowOuter) {
     NS_ERROR("AreDialogsEnabled() called without a top window?");
     return false;
   }
 
   // TODO: Warn if no top window?
   nsGlobalWindowInner* topWindow =
       topWindowOuter->GetCurrentInnerWindowInternal();
@@ -2695,32 +2696,32 @@ bool nsGlobalWindowOuter::ConfirmDialogI
     DisableDialogs();
     return false;
   }
 
   return true;
 }
 
 void nsGlobalWindowOuter::DisableDialogs() {
-  nsGlobalWindowOuter* topWindowOuter = GetScriptableTopInternal();
+  nsGlobalWindowOuter* topWindowOuter = GetInProcessScriptableTopInternal();
   if (!topWindowOuter) {
     NS_ERROR("DisableDialogs() called without a top window?");
     return;
   }
 
   nsGlobalWindowInner* topWindow =
       topWindowOuter->GetCurrentInnerWindowInternal();
   // TODO: Warn if no top window?
   if (topWindow) {
     topWindow->mAreDialogsEnabled = false;
   }
 }
 
 void nsGlobalWindowOuter::EnableDialogs() {
-  nsGlobalWindowOuter* topWindowOuter = GetScriptableTopInternal();
+  nsGlobalWindowOuter* topWindowOuter = GetInProcessScriptableTopInternal();
   if (!topWindowOuter) {
     NS_ERROR("EnableDialogs() called without a top window?");
     return;
   }
 
   // TODO: Warn if no top window?
   nsGlobalWindowInner* topWindow =
       topWindowOuter->GetCurrentInnerWindowInternal();
@@ -2779,17 +2780,17 @@ nsIPrincipal* nsGlobalWindowOuter::GetPr
 
   // If we don't have a principal and we don't have a document we
   // ask the parent window for the principal. This can happen when
   // loading a frameset that has a <frame src="javascript:xxx">, in
   // that case the global window is used in JS before we've loaded
   // a document into the window.
 
   nsCOMPtr<nsIScriptObjectPrincipal> objPrincipal =
-      do_QueryInterface(GetParentInternal());
+      do_QueryInterface(GetInProcessParentInternal());
 
   if (objPrincipal) {
     return objPrincipal->GetPrincipal();
   }
 
   return nullptr;
 }
 
@@ -2802,17 +2803,17 @@ nsIPrincipal* nsGlobalWindowOuter::GetEf
   if (mDocumentStoragePrincipal) {
     return mDocumentStoragePrincipal;
   }
 
   // If we don't have a storage principal and we don't have a document we ask
   // the parent window for the storage principal.
 
   nsCOMPtr<nsIScriptObjectPrincipal> objPrincipal =
-      do_QueryInterface(GetParentInternal());
+      do_QueryInterface(GetInProcessParentInternal());
 
   if (objPrincipal) {
     return objPrincipal->GetEffectiveStoragePrincipal();
   }
 
   return nullptr;
 }
 
@@ -2946,71 +2947,71 @@ bool nsPIDOMWindowOuter::IsDisposableSus
           aSuspend == nsISuspendedTypes::SUSPENDED_STOP_DISPOSABLE);
 }
 
 void nsPIDOMWindowOuter::SetServiceWorkersTestingEnabled(bool aEnabled) {
   // Devtools should only be setting this on the top level window.  Its
   // ok if devtools clears the flag on clean up of nested windows, though.
   // It will have no affect.
 #ifdef DEBUG
-  nsCOMPtr<nsPIDOMWindowOuter> topWindow = GetScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topWindow = GetInProcessScriptableTop();
   MOZ_ASSERT_IF(aEnabled, this == topWindow);
 #endif
   mServiceWorkersTestingEnabled = aEnabled;
 }
 
 bool nsPIDOMWindowOuter::GetServiceWorkersTestingEnabled() {
   // Automatically get this setting from the top level window so that nested
   // iframes get the correct devtools setting.
-  nsCOMPtr<nsPIDOMWindowOuter> topWindow = GetScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topWindow = GetInProcessScriptableTop();
   if (!topWindow) {
     return false;
   }
   return topWindow->mServiceWorkersTestingEnabled;
 }
 
 Nullable<WindowProxyHolder> nsGlobalWindowOuter::GetParentOuter() {
   BrowsingContext* bc = GetBrowsingContext();
   return bc ? bc->GetParent(IgnoreErrors()) : nullptr;
 }
 
 /**
- * GetScriptableParent is called when script reads window.parent.
+ * GetInProcessScriptableParent is called when script reads window.parent.
  *
- * In contrast to GetRealParent, GetScriptableParent respects <iframe
+ * In contrast to GetRealParent, GetInProcessScriptableParent respects <iframe
  * mozbrowser> boundaries, so if |this| is contained by an <iframe
  * mozbrowser>, we will return |this| as its own parent.
  */
-nsPIDOMWindowOuter* nsGlobalWindowOuter::GetScriptableParent() {
+nsPIDOMWindowOuter* nsGlobalWindowOuter::GetInProcessScriptableParent() {
   if (!mDocShell) {
     return nullptr;
   }
 
   if (mDocShell->GetIsMozBrowser()) {
     return this;
   }
 
-  nsCOMPtr<nsPIDOMWindowOuter> parent = GetParent();
+  nsCOMPtr<nsPIDOMWindowOuter> parent = GetInProcessParent();
   return parent;
 }
 
 /**
- * Behavies identically to GetScriptableParent extept that it returns null
- * if GetScriptableParent would return this window.
+ * Behavies identically to GetInProcessScriptableParent extept that it returns
+ * null if GetInProcessScriptableParent would return this window.
  */
-nsPIDOMWindowOuter* nsGlobalWindowOuter::GetScriptableParentOrNull() {
-  nsPIDOMWindowOuter* parent = GetScriptableParent();
+nsPIDOMWindowOuter* nsGlobalWindowOuter::GetInProcessScriptableParentOrNull() {
+  nsPIDOMWindowOuter* parent = GetInProcessScriptableParent();
   return (nsGlobalWindowOuter::Cast(parent) == this) ? nullptr : parent;
 }
 
 /**
  * nsPIDOMWindow::GetParent (when called from C++) is just a wrapper around
  * GetRealParent.
  */
-already_AddRefed<nsPIDOMWindowOuter> nsGlobalWindowOuter::GetParent() {
+already_AddRefed<nsPIDOMWindowOuter> nsGlobalWindowOuter::GetInProcessParent() {
   if (!mDocShell) {
     return nullptr;
   }
 
   nsCOMPtr<nsIDocShell> parent;
   mDocShell->GetSameTypeParentIgnoreBrowserBoundaries(getter_AddRefs(parent));
 
   if (parent) {
@@ -3036,19 +3037,19 @@ static nsresult GetTopImpl(nsGlobalWindo
   do {
     if (!parent) {
       break;
     }
 
     prevParent = parent;
 
     if (aScriptable) {
-      parent = parent->GetScriptableParent();
+      parent = parent->GetInProcessScriptableParent();
     } else {
-      parent = parent->GetParent();
+      parent = parent->GetInProcessParent();
     }
 
     if (aExcludingExtensionAccessibleContentFrames) {
       if (auto* p = nsGlobalWindowOuter::Cast(parent)) {
         nsGlobalWindowInner* currentInner = p->GetCurrentInnerWindowInternal();
         nsIURI* uri = prevParent->GetDocumentURI();
         if (!uri) {
           // If our parent doesn't have a URI yet, we have a document that is in
@@ -3088,31 +3089,32 @@ static nsresult GetTopImpl(nsGlobalWindo
   if (parent) {
     parent.swap(*aTop);
   }
 
   return NS_OK;
 }
 
 /**
- * GetScriptableTop is called when script reads window.top.
+ * GetInProcessScriptableTop is called when script reads window.top.
  *
- * In contrast to GetRealTop, GetScriptableTop respects <iframe mozbrowser>
- * boundaries.  If we encounter a window owned by an <iframe mozbrowser> while
- * walking up the window hierarchy, we'll stop and return that window.
+ * In contrast to GetRealTop, GetInProcessScriptableTop respects <iframe
+ * mozbrowser> boundaries.  If we encounter a window owned by an <iframe
+ * mozbrowser> while walking up the window hierarchy, we'll stop and return that
+ * window.
  */
-nsPIDOMWindowOuter* nsGlobalWindowOuter::GetScriptableTop() {
+nsPIDOMWindowOuter* nsGlobalWindowOuter::GetInProcessScriptableTop() {
   nsCOMPtr<nsPIDOMWindowOuter> window;
   GetTopImpl(this, /* aURIBeingLoaded = */ nullptr, getter_AddRefs(window),
              /* aScriptable = */ true,
              /* aExcludingExtensionAccessibleContentFrames = */ false);
   return window.get();
 }
 
-already_AddRefed<nsPIDOMWindowOuter> nsGlobalWindowOuter::GetTop() {
+already_AddRefed<nsPIDOMWindowOuter> nsGlobalWindowOuter::GetInProcessTop() {
   nsCOMPtr<nsPIDOMWindowOuter> window;
   GetTopImpl(this, /* aURIBeingLoaded = */ nullptr, getter_AddRefs(window),
              /* aScriptable = */ false,
              /* aExcludingExtensionAccessibleContentFrames = */ false);
   return window.forget();
 }
 
 already_AddRefed<nsPIDOMWindowOuter>
@@ -3156,17 +3158,17 @@ already_AddRefed<nsPIDOMWindowOuter> nsG
   if (bc) {
     nsCOMPtr<nsPIDOMWindowOuter> content(bc->GetDOMWindow());
     return content.forget();
   }
 
   // If we're contained in <iframe mozbrowser>, then GetContent is the same as
   // window.top.
   if (mDocShell && mDocShell->GetIsInMozBrowser()) {
-    nsCOMPtr<nsPIDOMWindowOuter> domWindow(GetScriptableTop());
+    nsCOMPtr<nsPIDOMWindowOuter> domWindow(GetInProcessScriptableTop());
     return domWindow.forget();
   }
 
   nsCOMPtr<nsIDocShellTreeItem> primaryContent;
   if (aCallerType != CallerType::System) {
     if (mDoc) {
       mDoc->WarnOnceAbout(Document::eWindowContentUntrusted);
     }
@@ -3176,17 +3178,18 @@ already_AddRefed<nsPIDOMWindowOuter> nsG
     // which is "good enough", for now.
     nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(mDocShell));
 
     if (baseWin) {
       bool visible = false;
       baseWin->GetVisibility(&visible);
 
       if (!visible) {
-        mDocShell->GetSameTypeRootTreeItem(getter_AddRefs(primaryContent));
+        mDocShell->GetInProcessSameTypeRootTreeItem(
+            getter_AddRefs(primaryContent));
       }
     }
   }
 
   if (!primaryContent) {
     nsCOMPtr<nsIDocShellTreeOwner> treeOwner = GetTreeOwner();
     if (!treeOwner) {
       aError.Throw(NS_ERROR_FAILURE);
@@ -4459,17 +4462,18 @@ nsresult nsGlobalWindowOuter::SetFullscr
   FinishFullscreenChange(aFullscreen);
   return NS_OK;
 }
 
 bool nsGlobalWindowOuter::SetWidgetFullscreen(FullscreenReason aReason,
                                               bool aIsFullscreen,
                                               nsIWidget* aWidget,
                                               nsIScreen* aScreen) {
-  MOZ_ASSERT(this == GetTopInternal(), "Only topmost window should call this");
+  MOZ_ASSERT(this == GetInProcessTopInternal(),
+             "Only topmost window should call this");
   MOZ_ASSERT(!GetFrameElementInternal(), "Content window should not call this");
   MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
 
   if (!NS_WARN_IF(!IsChromeWindow())) {
     if (!NS_WARN_IF(mChromeFields.mFullscreenPresShell)) {
       if (PresShell* presShell = mDocShell->GetPresShell()) {
         if (nsRefreshDriver* rd = presShell->GetRefreshDriver()) {
           mChromeFields.mFullscreenPresShell = do_GetWeakReference(presShell);
@@ -4941,17 +4945,17 @@ void nsGlobalWindowOuter::FocusOuter() {
   if (!mDocShell) {
     return;
   }
 
   // Don't look for a presshell if we're a root chrome window that's got
   // about:blank loaded.  We don't want to focus our widget in that case.
   // XXXbz should we really be checking for IsInitialDocument() instead?
   nsCOMPtr<nsIDocShellTreeItem> parentDsti;
-  mDocShell->GetParent(getter_AddRefs(parentDsti));
+  mDocShell->GetInProcessParent(getter_AddRefs(parentDsti));
 
   // set the parent's current focus to the frame containing this window.
   nsCOMPtr<nsPIDOMWindowOuter> parent =
       parentDsti ? parentDsti->GetWindow() : nullptr;
   if (parent) {
     nsCOMPtr<Document> parentdoc = parent->GetDoc();
     if (!parentdoc) {
       return;
@@ -5615,17 +5619,17 @@ bool nsGlobalWindowOuter::CanSetProperty
   return !Preferences::GetBool(aPrefName, true);
 }
 
 bool nsGlobalWindowOuter::PopupWhitelisted() {
   if (mDoc && PopupBlocker::CanShowPopupByPermission(mDoc->NodePrincipal())) {
     return true;
   }
 
-  nsCOMPtr<nsPIDOMWindowOuter> parent = GetParent();
+  nsCOMPtr<nsPIDOMWindowOuter> parent = GetInProcessParent();
   if (parent == this) {
     return false;
   }
 
   return nsGlobalWindowOuter::Cast(parent)->PopupWhitelisted();
 }
 
 /*
@@ -5682,17 +5686,17 @@ PopupBlocker::PopupControlState nsGlobal
 }
 
 /* If a window open is blocked, fire the appropriate DOM events. */
 void nsGlobalWindowOuter::FireAbuseEvents(
     const nsAString& aPopupURL, const nsAString& aPopupWindowName,
     const nsAString& aPopupWindowFeatures) {
   // fetch the URI of the window requesting the opened window
 
-  nsCOMPtr<nsPIDOMWindowOuter> window = GetTop();
+  nsCOMPtr<nsPIDOMWindowOuter> window = GetInProcessTop();
   if (!window) {
     return;
   }
 
   nsCOMPtr<Document> topDoc = window->GetDoc();
   nsCOMPtr<nsIURI> popupURI;
 
   // build the URI of the would-have-been popup window
@@ -6367,19 +6371,19 @@ void nsGlobalWindowOuter::ReallyCloseWin
       }
     }
 
     CleanUp();
   }
 }
 
 void nsGlobalWindowOuter::EnterModalState() {
-  // GetScriptableTop, not GetTop, so that EnterModalState works properly with
-  // <iframe mozbrowser>.
-  nsGlobalWindowOuter* topWin = GetScriptableTopInternal();
+  // GetInProcessScriptableTop, not GetInProcessTop, so that EnterModalState
+  // works properly with <iframe mozbrowser>.
+  nsGlobalWindowOuter* topWin = GetInProcessScriptableTopInternal();
 
   if (!topWin) {
     NS_ERROR("Uh, EnterModalState() called w/o a reachable top window?");
     return;
   }
 
   // If there is an active ESM in this window, clear it. Otherwise, this can
   // cause a problem if a modal state is entered during a mouseup event.
@@ -6432,17 +6436,17 @@ void nsGlobalWindowOuter::EnterModalStat
     if (inner) {
       topWin->GetCurrentInnerWindowInternal()->Suspend();
     }
   }
   topWin->mModalStateDepth++;
 }
 
 void nsGlobalWindowOuter::LeaveModalState() {
-  nsGlobalWindowOuter* topWin = GetScriptableTopInternal();
+  nsGlobalWindowOuter* topWin = GetInProcessScriptableTopInternal();
 
   if (!topWin) {
     NS_ERROR("Uh, LeaveModalState() called w/o a reachable top window?");
     return;
   }
 
   MOZ_ASSERT(topWin->mModalStateDepth != 0);
   MOZ_ASSERT(IsSuspended());
@@ -6474,17 +6478,17 @@ void nsGlobalWindowOuter::LeaveModalStat
     event->InitEvent(NS_LITERAL_STRING("endmodalstate"), true, false);
     event->SetTrusted(true);
     event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
     topWin->DispatchEvent(*event);
   }
 }
 
 bool nsGlobalWindowOuter::IsInModalState() {
-  nsGlobalWindowOuter* topWin = GetScriptableTopInternal();
+  nsGlobalWindowOuter* topWin = GetInProcessScriptableTopInternal();
 
   if (!topWin) {
     // IsInModalState() getting called w/o a reachable top window is a bit
     // iffy, but valid enough not to make noise about it.  See bug 404828
     return false;
   }
 
   return topWin->mModalStateDepth != 0;
@@ -6713,42 +6717,42 @@ EventListenerManager* nsGlobalWindowOute
   FORWARD_TO_INNER(GetExistingListenerManager, (), nullptr);
 }
 
 //*****************************************************************************
 // nsGlobalWindowOuter::nsPIDOMWindow
 //*****************************************************************************
 
 nsPIDOMWindowOuter* nsGlobalWindowOuter::GetPrivateParent() {
-  nsCOMPtr<nsPIDOMWindowOuter> parent = GetParent();
+  nsCOMPtr<nsPIDOMWindowOuter> parent = GetInProcessParent();
 
   if (this == parent) {
     nsCOMPtr<nsIContent> chromeElement(do_QueryInterface(mChromeEventHandler));
     if (!chromeElement)
       return nullptr;  // This is ok, just means a null parent.
 
     Document* doc = chromeElement->GetComposedDoc();
     if (!doc) return nullptr;  // This is ok, just means a null parent.
 
     return doc->GetWindow();
   }
 
   return parent;
 }
 
 nsPIDOMWindowOuter* nsGlobalWindowOuter::GetPrivateRoot() {
-  nsCOMPtr<nsPIDOMWindowOuter> top = GetTop();
+  nsCOMPtr<nsPIDOMWindowOuter> top = GetInProcessTop();
 
   nsCOMPtr<nsIContent> chromeElement(do_QueryInterface(mChromeEventHandler));
   if (chromeElement) {
     Document* doc = chromeElement->GetComposedDoc();
     if (doc) {
       nsCOMPtr<nsPIDOMWindowOuter> parent = doc->GetWindow();
       if (parent) {
-        top = parent->GetTop();
+        top = parent->GetInProcessTop();
       }
     }
   }
 
   return top;
 }
 
 // This has a caller in Windows-only code (nsNativeAppSupportWin).
@@ -7075,18 +7079,18 @@ bool nsGlobalWindowOuter::IsFrozen() con
 nsresult nsGlobalWindowOuter::FireDelayedDOMEvents() {
   FORWARD_TO_INNER(FireDelayedDOMEvents, (), NS_ERROR_UNEXPECTED);
 }
 
 //*****************************************************************************
 // nsGlobalWindowOuter: Window Control Functions
 //*****************************************************************************
 
-nsPIDOMWindowOuter* nsGlobalWindowOuter::GetParentInternal() {
-  nsCOMPtr<nsPIDOMWindowOuter> parent = GetParent();
+nsPIDOMWindowOuter* nsGlobalWindowOuter::GetInProcessParentInternal() {
+  nsCOMPtr<nsPIDOMWindowOuter> parent = GetInProcessParent();
 
   if (parent && parent != this) {
     return parent;
   }
 
   return nullptr;
 }
 
@@ -7439,17 +7443,17 @@ void nsGlobalWindowOuter::FlushPendingNo
   }
 }
 
 void nsGlobalWindowOuter::EnsureSizeAndPositionUpToDate() {
   // If we're a subframe, make sure our size is up to date.  Make sure to go
   // through the document chain rather than the window chain to not flush on
   // detached iframes, see bug 1545516.
   if (mDoc && mDoc->StyleOrLayoutObservablyDependsOnParentDocumentLayout()) {
-    RefPtr<Document> parent = mDoc->GetParentDocument();
+    RefPtr<Document> parent = mDoc->GetInProcessParentDocument();
     parent->FlushPendingNotifications(FlushType::Layout);
   }
 }
 
 already_AddRefed<nsISupports> nsGlobalWindowOuter::SaveWindowState() {
   if (!mContext || !GetWrapperPreserveColor()) {
     // The window may be getting torn down; don't bother saving state.
     return nullptr;
@@ -7718,17 +7722,17 @@ mozilla::dom::TabGroup* nsGlobalWindowOu
   // because a document is getting its NodePrincipal, and asking for the
   // TabGroup to determine its DocGroup.
   if (!mTabGroup) {
     // Get mOpener ourselves, instead of relying on GetOpenerWindowOuter,
     // because that way we dodge the LegacyIsCallerChromeOrNativeCode() call
     // which we want to return false.
     nsCOMPtr<nsPIDOMWindowOuter> piOpener = do_QueryReferent(mOpener);
     nsPIDOMWindowOuter* opener = GetSanitizedOpener(piOpener);
-    nsPIDOMWindowOuter* parent = GetScriptableParentOrNull();
+    nsPIDOMWindowOuter* parent = GetInProcessScriptableParentOrNull();
     MOZ_ASSERT(!parent || !opener,
                "Only one of parent and opener may be provided");
 
     mozilla::dom::TabGroup* toJoin = nullptr;
     if (GetDocShell()->ItemType() == nsIDocShellTreeItem::typeChrome) {
       toJoin = TabGroup::GetChromeTabGroup();
     } else if (opener) {
       toJoin = opener->TabGroup();
@@ -7753,17 +7757,17 @@ mozilla::dom::TabGroup* nsGlobalWindowOu
   // Ensure that we don't recurse forever
   if (!mIsValidatingTabGroup) {
     mIsValidatingTabGroup = true;
     // We only need to do this check if we aren't in the chrome tab group
     if (mIsChrome) {
       MOZ_ASSERT(mTabGroup == TabGroup::GetChromeTabGroup());
     } else {
       // Sanity check that our tabgroup matches our opener or parent.
-      RefPtr<nsPIDOMWindowOuter> parent = GetScriptableParentOrNull();
+      RefPtr<nsPIDOMWindowOuter> parent = GetInProcessScriptableParentOrNull();
       MOZ_ASSERT_IF(parent, parent->TabGroup() == mTabGroup);
       nsCOMPtr<nsPIDOMWindowOuter> piOpener = do_QueryReferent(mOpener);
       nsPIDOMWindowOuter* opener = GetSanitizedOpener(piOpener);
       MOZ_ASSERT_IF(opener && nsGlobalWindowOuter::Cast(opener) != this,
                     opener->TabGroup() == mTabGroup);
     }
     mIsValidatingTabGroup = false;
   }
@@ -7800,17 +7804,18 @@ AbstractThread* nsGlobalWindowOuter::Abs
 }
 
 nsGlobalWindowOuter::TemporarilyDisableDialogs::TemporarilyDisableDialogs(
     nsGlobalWindowOuter* aWindow MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
     : mSavedDialogsEnabled(false) {
   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 
   MOZ_ASSERT(aWindow);
-  nsGlobalWindowOuter* topWindowOuter = aWindow->GetScriptableTopInternal();
+  nsGlobalWindowOuter* topWindowOuter =
+      aWindow->GetInProcessScriptableTopInternal();
   if (!topWindowOuter) {
     NS_ERROR(
         "nsGlobalWindowOuter::TemporarilyDisableDialogs used without a top "
         "window?");
     return;
   }
 
   // TODO: Warn if no top window?
--- a/dom/base/nsGlobalWindowOuter.h
+++ b/dom/base/nsGlobalWindowOuter.h
@@ -354,27 +354,27 @@ class nsGlobalWindowOuter final : public
   NS_DECL_NSIINTERFACEREQUESTOR
 
   // nsIObserver
   NS_DECL_NSIOBSERVER
 
   mozilla::dom::Nullable<mozilla::dom::WindowProxyHolder> IndexedGetterOuter(
       uint32_t aIndex);
 
-  already_AddRefed<nsPIDOMWindowOuter> GetTop() override;
-  // Similar to GetTop() except that it stops at content frames that an
-  // extension has permission to access.  This is used by the third-party util
-  // service in order to determine the top window for a channel which is used
-  // in third-partiness checks.
+  already_AddRefed<nsPIDOMWindowOuter> GetInProcessTop() override;
+  // Similar to GetInProcessTop() except that it stops at content frames that
+  // an extension has permission to access.  This is used by the third-party
+  // util service in order to determine the top window for a channel which is
+  // used in third-partiness checks.
   already_AddRefed<nsPIDOMWindowOuter>
   GetTopExcludingExtensionAccessibleContentFrames(nsIURI* aURIBeingLoaded);
-  nsPIDOMWindowOuter* GetScriptableTop() override;
-  inline nsGlobalWindowOuter* GetTopInternal();
+  nsPIDOMWindowOuter* GetInProcessScriptableTop() override;
+  inline nsGlobalWindowOuter* GetInProcessTopInternal();
 
-  inline nsGlobalWindowOuter* GetScriptableTopInternal();
+  inline nsGlobalWindowOuter* GetInProcessScriptableTopInternal();
 
   already_AddRefed<mozilla::dom::BrowsingContext> GetChildWindow(
       const nsAString& aName);
 
   // These return true if we've reached the state in this top level window
   // where we ask the user if further dialogs should be blocked.
   //
   // DialogsAreBeingAbused must be called on the scriptable top inner window.
@@ -550,19 +550,19 @@ class nsGlobalWindowOuter final : public
   // Initializes the mWasOffline member variable
   void InitWasOffline();
 
  public:
   nsPIDOMWindowOuter* GetSanitizedOpener(nsPIDOMWindowOuter* aOpener);
 
   already_AddRefed<nsPIDOMWindowOuter> GetOpener() override;
   mozilla::dom::Nullable<mozilla::dom::WindowProxyHolder> GetParentOuter();
-  already_AddRefed<nsPIDOMWindowOuter> GetParent() override;
-  nsPIDOMWindowOuter* GetScriptableParent() override;
-  nsPIDOMWindowOuter* GetScriptableParentOrNull() override;
+  already_AddRefed<nsPIDOMWindowOuter> GetInProcessParent() override;
+  nsPIDOMWindowOuter* GetInProcessScriptableParent() override;
+  nsPIDOMWindowOuter* GetInProcessScriptableParentOrNull() override;
   mozilla::dom::Element* GetFrameElementOuter(nsIPrincipal& aSubjectPrincipal);
   mozilla::dom::Element* GetFrameElement() override;
   mozilla::dom::Nullable<mozilla::dom::WindowProxyHolder> OpenOuter(
       const nsAString& aUrl, const nsAString& aName, const nsAString& aOptions,
       mozilla::ErrorResult& aError);
   nsresult Open(const nsAString& aUrl, const nsAString& aName,
                 const nsAString& aOptions, nsDocShellLoadState* aLoadState,
                 bool aForceNoOpener, nsPIDOMWindowOuter** _retval) override;
@@ -742,17 +742,17 @@ class nsGlobalWindowOuter final : public
   void FinalClose();
 
   inline void MaybeClearInnerWindow(nsGlobalWindowInner* aExpectedInner);
 
   // We need a JSContext to get prototypes inside CallerInnerWindow.
   static nsGlobalWindowInner* CallerInnerWindow(JSContext* aCx);
 
   // Get the parent, returns null if this is a toplevel window
-  nsPIDOMWindowOuter* GetParentInternal();
+  nsPIDOMWindowOuter* GetInProcessParentInternal();
 
  public:
   // popup tracking
   bool IsPopupSpamWindow();
 
   // Outer windows only.
   void SetIsPopupSpamWindow(bool aIsPopupSpam);
 
@@ -1171,26 +1171,27 @@ inline nsISupports* ToSupports(nsGlobalW
 inline nsISupports* ToCanonicalSupports(nsGlobalWindowOuter* p) {
   return static_cast<mozilla::dom::EventTarget*>(p);
 }
 
 inline nsIGlobalObject* nsGlobalWindowOuter::GetOwnerGlobal() const {
   return GetCurrentInnerWindowInternal();
 }
 
-inline nsGlobalWindowOuter* nsGlobalWindowOuter::GetTopInternal() {
-  nsCOMPtr<nsPIDOMWindowOuter> top = GetTop();
+inline nsGlobalWindowOuter* nsGlobalWindowOuter::GetInProcessTopInternal() {
+  nsCOMPtr<nsPIDOMWindowOuter> top = GetInProcessTop();
   if (top) {
     return nsGlobalWindowOuter::Cast(top);
   }
   return nullptr;
 }
 
-inline nsGlobalWindowOuter* nsGlobalWindowOuter::GetScriptableTopInternal() {
-  nsPIDOMWindowOuter* top = GetScriptableTop();
+inline nsGlobalWindowOuter*
+nsGlobalWindowOuter::GetInProcessScriptableTopInternal() {
+  nsPIDOMWindowOuter* top = GetInProcessScriptableTop();
   return nsGlobalWindowOuter::Cast(top);
 }
 
 inline nsIScriptContext* nsGlobalWindowOuter::GetContextInternal() {
   return mContext;
 }
 
 inline nsGlobalWindowInner* nsGlobalWindowOuter::GetCurrentInnerWindowInternal()
@@ -1198,24 +1199,24 @@ inline nsGlobalWindowInner* nsGlobalWind
   return nsGlobalWindowInner::Cast(mInnerWindow);
 }
 
 inline nsGlobalWindowInner* nsGlobalWindowOuter::EnsureInnerWindowInternal() {
   return nsGlobalWindowInner::Cast(EnsureInnerWindow());
 }
 
 inline bool nsGlobalWindowOuter::IsTopLevelWindow() {
-  nsPIDOMWindowOuter* parentWindow = GetScriptableTop();
+  nsPIDOMWindowOuter* parentWindow = GetInProcessScriptableTop();
   return parentWindow == this;
 }
 
 inline bool nsGlobalWindowOuter::IsPopupSpamWindow() { return mIsPopupSpam; }
 
 inline bool nsGlobalWindowOuter::IsFrame() {
-  return GetParentInternal() != nullptr;
+  return GetInProcessParentInternal() != nullptr;
 }
 
 inline void nsGlobalWindowOuter::MaybeClearInnerWindow(
     nsGlobalWindowInner* aExpectedInner) {
   if (mInnerWindow == aExpectedInner) {
     mInnerWindow = nullptr;
   }
 }
--- a/dom/base/nsHistory.cpp
+++ b/dom/base/nsHistory.cpp
@@ -291,15 +291,15 @@ nsIDocShell* nsHistory::GetDocShell() co
 }
 
 already_AddRefed<ChildSHistory> nsHistory::GetSessionHistory() const {
   nsIDocShell* docShell = GetDocShell();
   NS_ENSURE_TRUE(docShell, nullptr);
 
   // Get the root DocShell from it
   nsCOMPtr<nsIDocShellTreeItem> root;
-  docShell->GetSameTypeRootTreeItem(getter_AddRefs(root));
+  docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
   nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(root));
   NS_ENSURE_TRUE(webNav, nullptr);
 
   // Get SH from nsIWebNavigation
   return webNav->GetSessionHistory();
 }
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -1949,17 +1949,17 @@ void nsJSContext::RunNextCollectorTimer(
 // static
 void nsJSContext::MaybeRunNextCollectorSlice(nsIDocShell* aDocShell,
                                              JS::GCReason aReason) {
   if (!aDocShell || !XRE_IsContentProcess()) {
     return;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> root;
-  aDocShell->GetSameTypeRootTreeItem(getter_AddRefs(root));
+  aDocShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
   if (root == aDocShell) {
     // We don't want to run collectors when loading the top level page.
     return;
   }
 
   Document* rootDocument = root->GetDocument();
   if (!rootDocument ||
       rootDocument->GetReadyStateEnum() != Document::READYSTATE_COMPLETE ||
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -3046,17 +3046,17 @@ bool nsObjectLoadingContent::ShouldPlay(
       do_QueryInterface(static_cast<nsIObjectLoadingContent*>(this));
   MOZ_ASSERT(thisContent);
   Document* ownerDoc = thisContent->OwnerDoc();
 
   nsCOMPtr<nsPIDOMWindowOuter> window = ownerDoc->GetWindow();
   if (!window) {
     return false;
   }
-  nsCOMPtr<nsPIDOMWindowOuter> topWindow = window->GetTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topWindow = window->GetInProcessTop();
   NS_ENSURE_TRUE(topWindow, false);
   nsCOMPtr<Document> topDoc = topWindow->GetDoc();
   NS_ENSURE_TRUE(topDoc, false);
 
   // Check the flash blocking status for this page (this applies to Flash only)
   FlashClassification documentClassification = FlashClassification::Unknown;
   if (IsFlashMIME(mContentType)) {
     documentClassification = ownerDoc->DocumentFlashClassification();
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -343,18 +343,18 @@ class nsPIDOMWindowInner : public mozIDO
 
   void NoteDOMContentLoaded();
 
   mozilla::dom::TabGroup* TabGroup();
 
   virtual mozilla::dom::CustomElementRegistry* CustomElements() = 0;
 
   // XXX: This is called on inner windows
-  virtual nsPIDOMWindowOuter* GetScriptableTop() = 0;
-  virtual nsPIDOMWindowOuter* GetScriptableParent() = 0;
+  virtual nsPIDOMWindowOuter* GetInProcessScriptableTop() = 0;
+  virtual nsPIDOMWindowOuter* GetInProcessScriptableParent() = 0;
   virtual already_AddRefed<nsPIWindowRoot> GetTopWindowRoot() = 0;
 
   mozilla::dom::EventTarget* GetChromeEventHandler() const {
     return mChromeEventHandler;
   }
 
   mozilla::dom::EventTarget* GetParentTarget() {
     if (!mParentTarget) {
@@ -773,34 +773,35 @@ class nsPIDOMWindowOuter : public mozIDO
   virtual void ActivateOrDeactivate(bool aActivate) = 0;
 
   /**
    * |top| gets the root of the window hierarchy.
    *
    * This function does not cross chrome-content boundaries, so if this
    * window's parent is of a different type, |top| will return this window.
    *
-   * When script reads the top property, we run GetScriptableTop, which
-   * will not cross an <iframe mozbrowser> boundary.
+   * When script reads the top property, we run GetInProcessScriptableTop,
+   * which will not cross an <iframe mozbrowser> boundary.
    *
    * In contrast, C++ calls to GetTop are forwarded to GetRealTop, which
    * ignores <iframe mozbrowser> boundaries.
    */
 
-  virtual already_AddRefed<nsPIDOMWindowOuter> GetTop() = 0;  // Outer only
-  virtual already_AddRefed<nsPIDOMWindowOuter> GetParent() = 0;
-  virtual nsPIDOMWindowOuter* GetScriptableTop() = 0;
-  virtual nsPIDOMWindowOuter* GetScriptableParent() = 0;
+  virtual already_AddRefed<nsPIDOMWindowOuter>
+  GetInProcessTop() = 0;  // Outer only
+  virtual already_AddRefed<nsPIDOMWindowOuter> GetInProcessParent() = 0;
+  virtual nsPIDOMWindowOuter* GetInProcessScriptableTop() = 0;
+  virtual nsPIDOMWindowOuter* GetInProcessScriptableParent() = 0;
   virtual already_AddRefed<nsPIWindowRoot> GetTopWindowRoot() = 0;
 
   /**
-   * Behaves identically to GetScriptableParent except that it returns null
-   * if GetScriptableParent would return this window.
+   * Behaves identically to GetInProcessScriptableParent except that it
+   * returns null if GetInProcessScriptableParent would return this window.
    */
-  virtual nsPIDOMWindowOuter* GetScriptableParentOrNull() = 0;
+  virtual nsPIDOMWindowOuter* GetInProcessScriptableParentOrNull() = 0;
 
   virtual bool IsTopLevelWindowActive() = 0;
 
   virtual void SetActive(bool aActive) { mIsActive = aActive; }
 
   virtual void SetIsBackground(bool aIsBackground) = 0;
 
   mozilla::dom::EventTarget* GetChromeEventHandler() const {
--- a/dom/base/nsScreen.cpp
+++ b/dom/base/nsScreen.cpp
@@ -199,17 +199,17 @@ static void UpdateDocShellOrientationLoc
   }
 
   nsCOMPtr<nsIDocShell> docShell = aWindow->GetDocShell();
   if (!docShell) {
     return;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> root;
-  docShell->GetSameTypeRootTreeItem(getter_AddRefs(root));
+  docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
   nsCOMPtr<nsIDocShell> rootShell(do_QueryInterface(root));
   if (!rootShell) {
     return;
   }
 
   rootShell->SetOrientationLock(aOrientation);
 }
 
--- a/dom/base/nsWindowMemoryReporter.cpp
+++ b/dom/base/nsWindowMemoryReporter.cpp
@@ -219,24 +219,25 @@ static void CollectWindowReports(nsGloba
                                  nsWindowSizes* aWindowTotalSizes,
                                  nsTHashtable<nsUint64HashKey>* aGhostWindowIDs,
                                  WindowPaths* aWindowPaths,
                                  WindowPaths* aTopWindowPaths,
                                  nsIHandleReportCallback* aHandleReport,
                                  nsISupports* aData, bool aAnonymize) {
   nsAutoCString windowPath("explicit/");
 
-  // Avoid calling aWindow->GetTop() if there's no outer window.  It will work
-  // just fine, but will spew a lot of warnings.
+  // Avoid calling aWindow->GetInProcessTop() if there's no outer window.  It
+  // will work just fine, but will spew a lot of warnings.
   nsGlobalWindowOuter* top = nullptr;
   nsCOMPtr<nsIURI> location;
   if (aWindow->GetOuterWindow()) {
     // Our window should have a null top iff it has a null docshell.
-    MOZ_ASSERT(!!aWindow->GetTopInternal() == !!aWindow->GetDocShell());
-    top = aWindow->GetTopInternal();
+    MOZ_ASSERT(!!aWindow->GetInProcessTopInternal() ==
+               !!aWindow->GetDocShell());
+    top = aWindow->GetInProcessTopInternal();
     if (top) {
       location = GetWindowURI(top);
     }
   }
   if (!location) {
     location = GetWindowURI(aWindow);
   }
 
@@ -811,20 +812,20 @@ void nsWindowMemoryReporter::CheckForGho
 
   mLastCheckForGhostWindows = TimeStamp::NowLoRes();
   KillCheckTimer();
 
   nsTHashtable<nsPtrHashKey<TabGroup>> nonDetachedTabGroups;
 
   // Populate nonDetachedTabGroups.
   for (auto iter = windowsById->Iter(); !iter.Done(); iter.Next()) {
-    // Null outer window implies null top, but calling GetTop() when there's no
-    // outer window causes us to spew debug warnings.
+    // Null outer window implies null top, but calling GetInProcessTop() when
+    // there's no outer window causes us to spew debug warnings.
     nsGlobalWindowInner* window = iter.UserData();
-    if (!window->GetOuterWindow() || !window->GetTopInternal()) {
+    if (!window->GetOuterWindow() || !window->GetInProcessTopInternal()) {
       // This window is detached, so we don't care about its tab group.
       continue;
     }
 
     nonDetachedTabGroups.PutEntry(window->TabGroup());
   }
 
   // Update mDetachedWindows and write the ghost window IDs into aOutGhostIDs,
@@ -839,22 +840,22 @@ void nsWindowMemoryReporter::CheckForGho
       // The window object has been destroyed.  Stop tracking its weak ref in
       // our hashtable.
       iter.Remove();
       continue;
     }
 
     nsPIDOMWindowInner* window = nsPIDOMWindowInner::From(iwindow);
 
-    // Avoid calling GetTop() if we have no outer window.  Nothing will break if
-    // we do, but it will spew debug output, which can cause our test logs to
-    // overflow.
+    // Avoid calling GetInProcessTop() if we have no outer window.  Nothing
+    // will break if we do, but it will spew debug output, which can cause our
+    // test logs to overflow.
     nsCOMPtr<nsPIDOMWindowOuter> top;
     if (window->GetOuterWindow()) {
-      top = window->GetOuterWindow()->GetTop();
+      top = window->GetOuterWindow()->GetInProcessTop();
     }
 
     if (top) {
       // The window is no longer detached, so we no longer want to track it.
       iter.Remove();
       continue;
     }
 
--- a/dom/browser-element/BrowserElementParent.cpp
+++ b/dom/browser-element/BrowserElementParent.cpp
@@ -222,21 +222,21 @@ BrowserElementParent::OpenWindowInProces
                                           mozIDOMWindowProxy** aReturnWindow) {
   *aReturnWindow = nullptr;
 
   // If we call window.open from an <iframe> inside an <iframe mozbrowser>,
   // it's as though the top-level document inside the <iframe mozbrowser>
   // called window.open.  (Indeed, in the OOP case, the inner <iframe> lives
   // out-of-process, so we couldn't touch it if we tried.)
   //
-  // GetScriptableTop gets us the <iframe mozbrowser>'s window; we'll use its
-  // frame element, rather than aOpenerWindow's frame element, as our "opener
-  // frame element" below.
+  // GetInProcessScriptableTop gets us the <iframe mozbrowser>'s window; we'll
+  // use its frame element, rather than aOpenerWindow's frame element, as our
+  // "opener frame element" below.
   nsCOMPtr<nsPIDOMWindowOuter> win =
-      aOpenerWindow->GetDOMWindow()->GetScriptableTop();
+      aOpenerWindow->GetDOMWindow()->GetInProcessScriptableTop();
 
   nsCOMPtr<Element> openerFrameElement = win->GetFrameElementInternal();
   NS_ENSURE_TRUE(openerFrameElement, BrowserElementParent::OPEN_WINDOW_IGNORED);
 
   RefPtr<HTMLIFrameElement> popupFrameElement =
       CreateIframe(openerFrameElement, aName, /* aRemote = */ false);
   NS_ENSURE_TRUE(popupFrameElement, BrowserElementParent::OPEN_WINDOW_IGNORED);
 
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -455,18 +455,19 @@ nsresult EventStateManager::PreHandleEve
 
     nsCOMPtr<nsINode> node = aTargetContent;
     if (node && (aEvent->mMessage == eKeyUp || aEvent->mMessage == eMouseUp ||
                  aEvent->mMessage == eWheel || aEvent->mMessage == eTouchEnd ||
                  aEvent->mMessage == ePointerUp)) {
       Document* doc = node->OwnerDoc();
       while (doc) {
         doc->SetUserHasInteracted();
-        doc = nsContentUtils::IsChildOfSameType(doc) ? doc->GetParentDocument()
-                                                     : nullptr;
+        doc = nsContentUtils::IsChildOfSameType(doc)
+                  ? doc->GetInProcessParentDocument()
+                  : nullptr;
       }
     }
   }
 
   WheelTransaction::OnEvent(aEvent);
 
   // Focus events don't necessarily need a frame.
   if (!mCurrentTarget && !aTargetContent) {
@@ -1135,21 +1136,21 @@ bool EventStateManager::WalkESMTreeToHan
     // Someone registered an accesskey.  Find and activate it.
     if (LookForAccessKeyAndExecute(aAccessCharCodes, aEvent->IsTrusted(),
                                    aEvent->mIsRepeat, aExecute)) {
       return true;
     }
   }
 
   int32_t childCount;
-  docShell->GetChildCount(&childCount);
+  docShell->GetInProcessChildCount(&childCount);
   for (int32_t counter = 0; counter < childCount; counter++) {
     // Not processing the child which bubbles up the handling
     nsCOMPtr<nsIDocShellTreeItem> subShellItem;
-    docShell->GetChildAt(counter, getter_AddRefs(subShellItem));
+    docShell->GetInProcessChildAt(counter, getter_AddRefs(subShellItem));
     if (aAccessKeyState == eAccessKeyProcessingUp &&
         subShellItem == aBubbledFrom) {
       continue;
     }
 
     nsCOMPtr<nsIDocShell> subDS = do_QueryInterface(subShellItem);
     if (subDS && IsShellVisible(subDS)) {
       // Guarantee subPresShell lifetime while we're handling access key
@@ -1175,17 +1176,17 @@ bool EventStateManager::WalkESMTreeToHan
         return true;
       }
     }
   }  // if end . checking all sub docshell ends here.
 
   // bubble up the process to the parent docshell if necessary
   if (eAccessKeyProcessingDown != aAccessKeyState) {
     nsCOMPtr<nsIDocShellTreeItem> parentShellItem;
-    docShell->GetParent(getter_AddRefs(parentShellItem));
+    docShell->GetInProcessParent(getter_AddRefs(parentShellItem));
     nsCOMPtr<nsIDocShell> parentDS = do_QueryInterface(parentShellItem);
     if (parentDS) {
       // Guarantee parentPresShell lifetime while we're handling access key
       // since somebody may assume that it won't be deleted before the
       // corresponding nsPresContext and EventStateManager.
       RefPtr<PresShell> parentPresShell = parentDS->GetPresShell();
       NS_ASSERTION(parentPresShell,
                    "Our PresShell exists but the parent's does not?");
@@ -3248,18 +3249,18 @@ nsresult EventStateManager::PostHandleEv
           nsCOMPtr<mozIDOMWindowProxy> window;
           fm->GetFocusedWindow(getter_AddRefs(window));
           auto* currentWindow = nsPIDOMWindowOuter::From(window);
           if (currentWindow && mDocument->GetWindow() &&
               currentWindow != mDocument->GetWindow() &&
               !nsContentUtils::IsChromeDoc(mDocument)) {
             nsCOMPtr<nsPIDOMWindowOuter> currentTop;
             nsCOMPtr<nsPIDOMWindowOuter> newTop;
-            currentTop = currentWindow->GetTop();
-            newTop = mDocument->GetWindow()->GetTop();
+            currentTop = currentWindow->GetInProcessTop();
+            newTop = mDocument->GetWindow()->GetInProcessTop();
             nsCOMPtr<Document> currentDoc = currentWindow->GetExtantDoc();
             if (nsContentUtils::IsChromeDoc(currentDoc) ||
                 (currentTop && newTop && currentTop != newTop)) {
               fm->SetFocusedWindow(mDocument->GetWindow());
             }
           }
         }
       }
@@ -4384,17 +4385,17 @@ void EventStateManager::NotifyMouseOver(
 
   // Before firing mouseover, check for recursion
   if (aContent == wrapper->mFirstOverEventElement) return;
 
   // Check to see if we're a subdocument and if so update the parent
   // document's ESM state to indicate that the mouse is over the
   // content associated with our subdocument.
   EnsureDocument(mPresContext);
-  if (Document* parentDoc = mDocument->GetParentDocument()) {
+  if (Document* parentDoc = mDocument->GetInProcessParentDocument()) {
     if (nsCOMPtr<nsIContent> docContent =
             parentDoc->FindContentForSubDocument(mDocument)) {
       if (PresShell* parentPresShell = parentDoc->GetPresShell()) {
         RefPtr<EventStateManager> parentESM =
             parentPresShell->GetPresContext()->EventStateManager();
         parentESM->NotifyMouseOver(aMouseEvent, docContent);
       }
     }
--- a/dom/html/HTMLCanvasElement.cpp
+++ b/dom/html/HTMLCanvasElement.cpp
@@ -1202,18 +1202,18 @@ nsresult HTMLCanvasElement::RegisterFram
   }
 
   if (!mRequestedFrameRefreshObserver) {
     Document* doc = OwnerDoc();
     if (!doc) {
       return NS_ERROR_FAILURE;
     }
 
-    while (doc->GetParentDocument()) {
-      doc = doc->GetParentDocument();
+    while (doc->GetInProcessParentDocument()) {
+      doc = doc->GetInProcessParentDocument();
     }
 
     nsPresContext* context = doc->GetPresContext();
     if (!context) {
       return NS_ERROR_FAILURE;
     }
 
     context = context->GetRootPresContext();
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -734,17 +734,17 @@ nsresult HTMLFormElement::SubmitSubmissi
 
 nsresult HTMLFormElement::DoSecureToInsecureSubmitCheck(nsIURI* aActionURL,
                                                         bool* aCancelSubmit) {
   *aCancelSubmit = false;
 
   // Only ask the user about posting from a secure URI to an insecure URI if
   // this element is in the root document. When this is not the case, the mixed
   // content blocker will take care of security for us.
-  Document* parent = OwnerDoc()->GetParentDocument();
+  Document* parent = OwnerDoc()->GetInProcessParentDocument();
   bool isRootDocument = (!parent || nsContentUtils::IsChromeDoc(parent));
   if (!isRootDocument) {
     return NS_OK;
   }
 
   nsIPrincipal* principal = NodePrincipal();
   if (!principal) {
     *aCancelSubmit = true;
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -6686,17 +6686,18 @@ bool HTMLMediaElement::IsEventAttributeN
 
 already_AddRefed<nsIPrincipal> HTMLMediaElement::GetTopLevelPrincipal() {
   RefPtr<nsIPrincipal> principal;
   nsCOMPtr<nsPIDOMWindowInner> window = OwnerDoc()->GetInnerWindow();
   if (!window) {
     return nullptr;
   }
   // XXXkhuey better hope we always have an outer ...
-  nsCOMPtr<nsPIDOMWindowOuter> top = window->GetOuterWindow()->GetTop();
+  nsCOMPtr<nsPIDOMWindowOuter> top =
+      window->GetOuterWindow()->GetInProcessTop();
   if (!top) {
     return nullptr;
   }
   Document* doc = top->GetExtantDoc();
   if (!doc) {
     return nullptr;
   }
   principal = doc->NodePrincipal();
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -532,17 +532,17 @@ nsresult nsHTMLDocument::StartDocumentLo
   // content viewer set up yet, and therefore do not have a useful
   // mParentDocument.
 
   // in this block of code, if we get an error result, we return it
   // but if we get a null pointer, that's perfectly legal for parent
   // and parentContentViewer
   nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
   if (docShell) {
-    docShell->GetSameTypeParent(getter_AddRefs(parentAsItem));
+    docShell->GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
   }
 
   nsCOMPtr<nsIDocShell> parent(do_QueryInterface(parentAsItem));
   nsCOMPtr<nsIContentViewer> parentContentViewer;
   if (parent) {
     rv = parent->GetContentViewer(getter_AddRefs(parentContentViewer));
     NS_ENSURE_SUCCESS(rv, rv);
   }
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1010,17 +1010,17 @@ nsresult ContentChild::ProvideWindowComm
   // up.
   if (NS_FAILED(newChild->Init(aParent))) {
     return NS_ERROR_ABORT;
   }
 
   nsCOMPtr<nsPIDOMWindowInner> parentTopInnerWindow;
   if (aParent) {
     nsCOMPtr<nsPIDOMWindowOuter> parentTopWindow =
-        nsPIDOMWindowOuter::From(aParent)->GetTop();
+        nsPIDOMWindowOuter::From(aParent)->GetInProcessTop();
     if (parentTopWindow) {
       parentTopInnerWindow = parentTopWindow->GetCurrentInnerWindow();
     }
   }
 
   // Set to true when we're ready to return from this function.
   bool ready = false;
 
--- a/dom/jsurl/nsJSProtocolHandler.cpp
+++ b/dom/jsurl/nsJSProtocolHandler.cpp
@@ -589,17 +589,18 @@ nsJSChannel::AsyncOpen(nsIStreamListener
     // If we're a document channel, we need to actually block onload on our
     // _parent_ document.  This is because we don't actually set our
     // LOAD_DOCUMENT_URI flag, so a docloader we're loading in as the
     // document channel will claim to not be busy, and our parent's onload
     // could fire too early.
     nsLoadFlags loadFlags;
     mStreamChannel->GetLoadFlags(&loadFlags);
     if (loadFlags & LOAD_DOCUMENT_URI) {
-      mDocumentOnloadBlockedOn = mDocumentOnloadBlockedOn->GetParentDocument();
+      mDocumentOnloadBlockedOn =
+          mDocumentOnloadBlockedOn->GetInProcessParentDocument();
     }
   }
   if (mDocumentOnloadBlockedOn) {
     mDocumentOnloadBlockedOn->BlockOnload();
   }
 
   mPopupState = mozilla::dom::PopupBlocker::GetPopupControlState();
 
--- a/dom/media/AutoplayPolicy.cpp
+++ b/dom/media/AutoplayPolicy.cpp
@@ -35,17 +35,17 @@ namespace dom {
 
 static Document* ApproverDocOf(const Document& aDocument) {
   nsCOMPtr<nsIDocShell> ds = aDocument.GetDocShell();
   if (!ds) {
     return nullptr;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
-  ds->GetSameTypeRootTreeItem(getter_AddRefs(rootTreeItem));
+  ds->GetInProcessSameTypeRootTreeItem(getter_AddRefs(rootTreeItem));
   if (!rootTreeItem) {
     return nullptr;
   }
 
   return rootTreeItem->GetDocument();
 }
 
 static bool IsActivelyCapturingOrHasAPermission(nsPIDOMWindowInner* aWindow) {
--- a/dom/media/BackgroundVideoDecodingPermissionObserver.cpp
+++ b/dom/media/BackgroundVideoDecodingPermissionObserver.cpp
@@ -137,17 +137,17 @@ BackgroundVideoDecodingPermissionObserve
     return nullptr;
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> outerWin = innerWin->GetOuterWindow();
   if (!outerWin) {
     return nullptr;
   }
 
-  nsCOMPtr<nsPIDOMWindowOuter> topWin = outerWin->GetTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topWin = outerWin->GetInProcessTop();
   return topWin.forget();
 }
 
 dom::Document* BackgroundVideoDecodingPermissionObserver::GetOwnerDoc() const {
   if (!mDecoder->GetOwner()) {
     return nullptr;
   }
 
@@ -161,17 +161,17 @@ bool BackgroundVideoDecodingPermissionOb
     return false;
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> senderOuter = senderInner->GetOuterWindow();
   if (!senderOuter) {
     return false;
   }
 
-  nsCOMPtr<nsPIDOMWindowOuter> senderTop = senderOuter->GetTop();
+  nsCOMPtr<nsPIDOMWindowOuter> senderTop = senderOuter->GetInProcessTop();
   if (!senderTop) {
     return false;
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> ownerTop = GetOwnerWindow();
   if (!ownerTop) {
     return false;
   }
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -3924,20 +3924,20 @@ void MediaManager::IterateWindowListener
       }
       // NB: `listener` might have been destroyed.
     }
 
     // iterate any children of *this* window (iframes, etc)
     nsCOMPtr<nsIDocShell> docShell = aWindow->GetDocShell();
     if (docShell) {
       int32_t i, count;
-      docShell->GetChildCount(&count);
+      docShell->GetInProcessChildCount(&count);
       for (i = 0; i < count; ++i) {
         nsCOMPtr<nsIDocShellTreeItem> item;
-        docShell->GetChildAt(i, getter_AddRefs(item));
+        docShell->GetInProcessChildAt(i, getter_AddRefs(item));
         nsCOMPtr<nsPIDOMWindowOuter> winOuter =
             item ? item->GetWindow() : nullptr;
 
         if (winOuter) {
           IterateWindowListeners(winOuter->GetCurrentInnerWindow(), aCallback);
         }
       }
     }
--- a/dom/media/eme/MediaKeys.cpp
+++ b/dom/media/eme/MediaKeys.cpp
@@ -416,17 +416,18 @@ already_AddRefed<DetailedPromise> MediaK
   // page that will display in the URL bar.
   nsCOMPtr<nsPIDOMWindowInner> window = GetParentObject();
   if (!window) {
     promise->MaybeReject(
         NS_ERROR_DOM_INVALID_STATE_ERR,
         NS_LITERAL_CSTRING("Couldn't get top-level window in MediaKeys::Init"));
     return promise.forget();
   }
-  nsCOMPtr<nsPIDOMWindowOuter> top = window->GetOuterWindow()->GetTop();
+  nsCOMPtr<nsPIDOMWindowOuter> top =
+      window->GetOuterWindow()->GetInProcessTop();
   if (!top || !top->GetExtantDoc()) {
     promise->MaybeReject(
         NS_ERROR_DOM_INVALID_STATE_ERR,
         NS_LITERAL_CSTRING("Couldn't get document in MediaKeys::Init"));
     return promise.forget();
   }
 
   mDocument = top->GetExtantDoc();
--- a/dom/payments/PaymentRequest.cpp
+++ b/dom/payments/PaymentRequest.cpp
@@ -1123,22 +1123,22 @@ bool PaymentRequest::InFullyActiveDocume
   nsCOMPtr<nsPIDOMWindowInner> win = do_QueryInterface(global);
   Document* doc = win->GetExtantDoc();
   if (!doc || !doc->IsCurrentActiveDocument()) {
     return false;
   }
 
   // According to the definition of the fully active document, recursive
   // checking the parent document are all IsCurrentActiveDocument
-  Document* parentDoc = doc->GetParentDocument();
+  Document* parentDoc = doc->GetInProcessParentDocument();
   while (parentDoc) {
     if (parentDoc && !parentDoc->IsCurrentActiveDocument()) {
       return false;
     }
-    parentDoc = parentDoc->GetParentDocument();
+    parentDoc = parentDoc->GetInProcessParentDocument();
   }
   return true;
 }
 
 void PaymentRequest::RegisterActivityObserver() {
   if (nsPIDOMWindowInner* window = GetOwner()) {
     mDocument = window->GetExtantDoc();
     if (mDocument) {
--- a/dom/payments/PaymentRequestManager.cpp
+++ b/dom/payments/PaymentRequestManager.cpp
@@ -495,17 +495,18 @@ nsresult PaymentRequestManager::CreatePa
     return rv;
   }
 
   IPCPaymentOptions options;
   ConvertOptions(aOptions, options);
 
   nsCOMPtr<nsPIDOMWindowOuter> outerWindow = aWindow->GetOuterWindow();
   MOZ_ASSERT(outerWindow);
-  if (nsCOMPtr<nsPIDOMWindowOuter> topOuterWindow = outerWindow->GetTop()) {
+  if (nsCOMPtr<nsPIDOMWindowOuter> topOuterWindow =
+          outerWindow->GetInProcessTop()) {
     outerWindow = topOuterWindow;
   }
   uint64_t topOuterWindowId = outerWindow->WindowID();
 
   IPCPaymentCreateActionRequest action(
       topOuterWindowId, internalId, IPC::Principal(aTopLevelPrincipal),
       methodData, details, options, shippingOption);
 
--- a/dom/performance/PerformanceTiming.cpp
+++ b/dom/performance/PerformanceTiming.cpp
@@ -618,17 +618,18 @@ bool PerformanceTiming::IsTopLevelConten
   if (!document) {
     return false;
   }
   nsCOMPtr<nsIDocShell> docShell = document->GetDocShell();
   if (!docShell) {
     return false;
   }
   nsCOMPtr<nsIDocShellTreeItem> rootItem;
-  Unused << docShell->GetSameTypeRootTreeItem(getter_AddRefs(rootItem));
+  Unused << docShell->GetInProcessSameTypeRootTreeItem(
+      getter_AddRefs(rootItem));
   if (rootItem.get() != static_cast<nsIDocShellTreeItem*>(docShell.get())) {
     return false;
   }
   return rootItem->ItemType() == nsIDocShellTreeItem::typeContent;
 }
 
 nsTArray<nsCOMPtr<nsIServerTiming>> PerformanceTimingData::GetServerTiming() {
   if (!StaticPrefs::dom_enable_performance() || !IsInitialized() ||
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -2808,17 +2808,18 @@ NS_IMETHODIMP nsPluginInstanceOwner::Cre
     nsCOMPtr<nsIContent> content = do_QueryReferent(mContent);
     if (content) {
       doc = content->OwnerDoc();
       parentWidget = nsContentUtils::WidgetForDocument(doc);
       // If we're running in the content process, we need a remote widget
       // created in chrome.
       if (XRE_IsContentProcess()) {
         if (nsCOMPtr<nsPIDOMWindowOuter> window = doc->GetWindow()) {
-          if (nsCOMPtr<nsPIDOMWindowOuter> topWindow = window->GetTop()) {
+          if (nsCOMPtr<nsPIDOMWindowOuter> topWindow =
+                  window->GetInProcessTop()) {
             dom::BrowserChild* tc = dom::BrowserChild::GetFrom(topWindow);
             if (tc) {
               // This returns a PluginWidgetProxy which remotes a number of
               // calls.
               rv = tc->CreatePluginWidget(parentWidget.get(),
                                           getter_AddRefs(mWidget));
               if (NS_FAILED(rv)) {
                 return rv;
--- a/dom/presentation/PresentationRequest.cpp
+++ b/dom/presentation/PresentationRequest.cpp
@@ -464,17 +464,17 @@ bool PresentationRequest::IsProhibitMixe
   }
 
   nsCOMPtr<Document> doc = aDocument;
   while (doc && !nsContentUtils::IsChromeDoc(doc)) {
     if (nsContentUtils::HttpsStateIsModern(doc)) {
       return true;
     }
 
-    doc = doc->GetParentDocument();
+    doc = doc->GetInProcessParentDocument();
   }
 
   return false;
 }
 
 bool PresentationRequest::IsPrioriAuthenticatedURL(const nsAString& aUrl) {
   nsCOMPtr<nsIURI> uri;
   if (NS_FAILED(NS_NewURI(getter_AddRefs(uri), aUrl))) {
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -3134,17 +3134,18 @@ void ScriptLoader::ProcessPendingRequest
 
 bool ScriptLoader::ReadyToExecuteParserBlockingScripts() {
   // Make sure the SelfReadyToExecuteParserBlockingScripts check is first, so
   // that we don't block twice on an ancestor.
   if (!SelfReadyToExecuteParserBlockingScripts()) {
     return false;
   }
 
-  for (Document* doc = mDocument; doc; doc = doc->GetParentDocument()) {
+  for (Document* doc = mDocument; doc;
+       doc = doc->GetInProcessParentDocument()) {
     ScriptLoader* ancestor = doc->ScriptLoader();
     if (!ancestor->SelfReadyToExecuteParserBlockingScripts() &&
         ancestor->AddPendingChildLoader(this)) {
       AddParserBlockingScriptExecutionBlocker();
       return false;
     }
   }
 
--- a/dom/security/FramingChecker.cpp
+++ b/dom/security/FramingChecker.cpp
@@ -113,17 +113,17 @@ bool FramingChecker::CheckOneFrameOption
 
   nsCOMPtr<nsIURI> uri;
   aHttpChannel->GetURI(getter_AddRefs(uri));
 
   // return early if header does not have one of the values with meaning
   if (!aPolicy.LowerCaseEqualsLiteral("deny") &&
       !aPolicy.LowerCaseEqualsLiteral("sameorigin")) {
     nsCOMPtr<nsIDocShellTreeItem> root;
-    curDocShellItem->GetSameTypeRootTreeItem(getter_AddRefs(root));
+    curDocShellItem->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
     ReportError("XFOInvalid", root, uri, aPolicy);
     return true;
   }
 
   // XXXkhuey when does this happen?  Is returning true safe here?
   if (!aDocShell) {
     return true;
   }
@@ -133,35 +133,36 @@ bool FramingChecker::CheckOneFrameOption
   // document must be same-origin with top window.  X-F-O: DENY requires that
   // the document must never be framed.
   nsCOMPtr<nsPIDOMWindowOuter> thisWindow = aDocShell->GetWindow();
   // If we don't have DOMWindow there is no risk of clickjacking
   if (!thisWindow) {
     return true;
   }
 
-  // GetScriptableTop, not GetTop, because we want this to respect
+  // GetInProcessScriptableTop, not GetTop, because we want this to respect
   // <iframe mozbrowser> boundaries.
-  nsCOMPtr<nsPIDOMWindowOuter> topWindow = thisWindow->GetScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topWindow =
+      thisWindow->GetInProcessScriptableTop();
 
   // if the document is in the top window, it's not in a frame.
   if (thisWindow == topWindow) {
     return true;
   }
 
   // If the X-Frame-Options value is SAMEORIGIN, then the top frame in the
   // parent chain must be from the same origin as this document.
   bool checkSameOrigin = aPolicy.LowerCaseEqualsLiteral("sameorigin");
   nsCOMPtr<nsIURI> topUri;
 
   // Traverse up the parent chain and stop when we see a docshell whose
   // parent has a system principal, or a docshell corresponding to
   // <iframe mozbrowser>.
-  while (NS_SUCCEEDED(
-             curDocShellItem->GetParent(getter_AddRefs(parentDocShellItem))) &&
+  while (NS_SUCCEEDED(curDocShellItem->GetInProcessParent(
+             getter_AddRefs(parentDocShellItem))) &&
          parentDocShellItem) {
     nsCOMPtr<nsIDocShell> curDocShell = do_QueryInterface(curDocShellItem);
     if (curDocShell && curDocShell->GetIsMozBrowser()) {
       break;
     }
 
     topDoc = parentDocShellItem->GetDocument();
     if (topDoc) {
--- a/dom/security/nsCSPContext.cpp
+++ b/dom/security/nsCSPContext.cpp
@@ -1468,17 +1468,18 @@ nsCSPContext::PermitsAncestry(nsIDocShel
 
   nsCOMPtr<nsIInterfaceRequestor> ir(do_QueryInterface(aDocShell));
   nsCOMPtr<nsIDocShellTreeItem> treeItem(do_GetInterface(ir));
   nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
   nsCOMPtr<nsIURI> currentURI;
   nsCOMPtr<nsIURI> uriClone;
 
   // iterate through each docShell parent item
-  while (NS_SUCCEEDED(treeItem->GetParent(getter_AddRefs(parentTreeItem))) &&
+  while (NS_SUCCEEDED(
+             treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem))) &&
          parentTreeItem != nullptr) {
     // stop when reaching chrome
     if (parentTreeItem->ItemType() == nsIDocShellTreeItem::typeChrome) {
       break;
     }
 
     Document* doc = parentTreeItem->GetDocument();
     NS_ASSERTION(doc,
--- a/dom/security/nsMixedContentBlocker.cpp
+++ b/dom/security/nsMixedContentBlocker.cpp
@@ -85,17 +85,17 @@ class nsMixedContentEvent : public Runna
     // Mixed content was allowed and is about to load; get the document and
     // set the approriate flag to true if we are about to load Mixed Active
     // Content.
     nsCOMPtr<nsIDocShell> docShell = NS_CP_GetDocShellFromContext(mContext);
     if (!docShell) {
       return NS_OK;
     }
     nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
-    docShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
+    docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
     NS_ASSERTION(
         sameTypeRoot,
         "No document shell root tree item from document shell tree item!");
 
     // now get the document from sameTypeRoot
     nsCOMPtr<Document> rootDoc = sameTypeRoot->GetDocument();
     NS_ASSERTION(rootDoc,
                  "No root document from document shell root tree item.");
@@ -847,17 +847,17 @@ nsresult nsMixedContentBlocker::ShouldLo
       &rootHasSecureConnection, &allowMixedContent, &isRootDocShell);
   if (NS_FAILED(rv)) {
     *aDecision = REJECT_REQUEST;
     return rv;
   }
 
   // Get the sameTypeRoot tree item from the docshell
   nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
-  docShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
+  docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
   NS_ASSERTION(sameTypeRoot, "No root tree item from docshell!");
 
   // When navigating an iframe, the iframe may be https
   // but its parents may not be.  Check the parents to see if any of them are
   // https. If none of the parents are https, allow the load.
   if (aContentType == TYPE_SUBDOCUMENT && !rootHasSecureConnection) {
     bool httpsParentExists = false;
 
@@ -894,17 +894,18 @@ nsresult nsMixedContentBlocker::ShouldLo
       // When the parent and the root are the same, we have traversed all the
       // way up the same type docshell tree.  Break out of the while loop.
       if (sameTypeRoot == parentTreeItem) {
         break;
       }
 
       // update the parent to the grandparent.
       nsCOMPtr<nsIDocShellTreeItem> newParentTreeItem;
-      parentTreeItem->GetSameTypeParent(getter_AddRefs(newParentTreeItem));
+      parentTreeItem->GetInProcessSameTypeParent(
+          getter_AddRefs(newParentTreeItem));
       parentTreeItem = newParentTreeItem;
     }  // end while loop.
 
     if (!httpsParentExists) {
       *aDecision = nsIContentPolicy::ACCEPT;
       return NS_OK;
     }
   }
--- a/dom/system/nsDeviceSensors.cpp
+++ b/dom/system/nsDeviceSensors.cpp
@@ -207,17 +207,17 @@ static bool WindowCannotReceiveSensorEve
   nsPIDOMWindowOuter* windowOuter = aWindow->GetOuterWindow();
   bool disabled =
       windowOuter->IsBackground() || !windowOuter->IsTopLevelWindowActive();
   if (disabled) {
     return true;
   }
 
   // Check to see if this window is a cross-origin iframe
-  nsCOMPtr<nsPIDOMWindowOuter> top = aWindow->GetScriptableTop();
+  nsCOMPtr<nsPIDOMWindowOuter> top = aWindow->GetInProcessScriptableTop();
   nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(aWindow);
   nsCOMPtr<nsIScriptObjectPrincipal> topSop = do_QueryInterface(top);
   if (!sop || !topSop) {
     return true;
   }
 
   nsIPrincipal* principal = sop->GetPrincipal();
   nsIPrincipal* topPrincipal = topSop->GetPrincipal();
--- a/dom/websocket/WebSocket.cpp
+++ b/dom/websocket/WebSocket.cpp
@@ -1173,17 +1173,18 @@ class AsyncOpenRunnable final : public W
 
     nsCOMPtr<nsIPrincipal> principal = doc->NodePrincipal();
     if (!principal) {
       mErrorCode = NS_ERROR_FAILURE;
       return true;
     }
 
     uint64_t windowID = 0;
-    nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
+    nsCOMPtr<nsPIDOMWindowOuter> topWindow =
+        aWindow->GetInProcessScriptableTop();
     nsCOMPtr<nsPIDOMWindowInner> topInner;
     if (topWindow) {
       topInner = topWindow->GetCurrentInnerWindow();
     }
 
     if (topInner) {
       windowID = topInner->WindowID();
     }
@@ -1395,17 +1396,18 @@ already_AddRefed<WebSocket> WebSocket::C
 
     UniquePtr<SerializedStackHolder> stack;
     nsIDocShell* docShell = outerWindow->GetDocShell();
     if (docShell && docShell->GetWatchedByDevtools()) {
       stack = GetCurrentStackForNetMonitor(aGlobal.Context());
     }
 
     uint64_t windowID = 0;
-    nsCOMPtr<nsPIDOMWindowOuter> topWindow = outerWindow->GetScriptableTop();
+    nsCOMPtr<nsPIDOMWindowOuter> topWindow =
+        outerWindow->GetInProcessScriptableTop();
     nsCOMPtr<nsPIDOMWindowInner> topInner;
     if (topWindow) {
       topInner = topWindow->GetCurrentInnerWindow();
     }
 
     if (topInner) {
       windowID = topInner->WindowID();
     }
@@ -2714,17 +2716,17 @@ nsresult WebSocketImpl::GetLoadingPrinci
         // If we are in a XPConnect sandbox or in a JS component,
         // innerWindow will be null. There is nothing on top of this to be
         // considered.
         break;
       }
     }
 
     nsCOMPtr<nsPIDOMWindowOuter> parentWindow =
-        innerWindow->GetScriptableParent();
+        innerWindow->GetInProcessScriptableParent();
     if (NS_WARN_IF(!parentWindow)) {
       return NS_ERROR_DOM_SECURITY_ERR;
     }
 
     nsCOMPtr<nsPIDOMWindowInner> currentInnerWindow =
         parentWindow->GetCurrentInnerWindow();
     if (NS_WARN_IF(!currentInnerWindow)) {
       return NS_ERROR_DOM_SECURITY_ERR;
@@ -2739,17 +2741,18 @@ nsresult WebSocketImpl::GetLoadingPrinci
         error.SuppressException();
         return NS_ERROR_DOM_SECURITY_ERR;
       }
 
       if (!parentWindow) {
         break;
       }
 
-      if (parentWindow->GetScriptableTop() == innerWindow->GetScriptableTop()) {
+      if (parentWindow->GetInProcessScriptableTop() ==
+          innerWindow->GetInProcessScriptableTop()) {
         break;
       }
 
       currentInnerWindow = parentWindow->GetCurrentInnerWindow();
       if (NS_WARN_IF(!currentInnerWindow)) {
         return NS_ERROR_DOM_SECURITY_ERR;
       }
 
--- a/dom/workers/WorkerDebugger.cpp
+++ b/dom/workers/WorkerDebugger.cpp
@@ -477,17 +477,17 @@ RefPtr<PerformanceInfoPromise> WorkerDeb
   WorkerPrivate* wp = mWorkerPrivate;
   while (wp->GetParent()) {
     wp = wp->GetParent();
   }
   nsPIDOMWindowInner* win = wp->GetWindow();
   if (win) {
     nsPIDOMWindowOuter* outer = win->GetOuterWindow();
     if (outer) {
-      top = outer->GetTop();
+      top = outer->GetInProcessTop();
       if (top) {
         windowID = top->WindowID();
         isTopLevel = outer->IsTopLevelWindow();
       }
     }
   }
 
   // getting the worker URL
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -2503,17 +2503,17 @@ nsresult WorkerPrivate::GetLoadInfo(JSCo
         // We use the document's base domain to limit the number of workers
         // each domain can create. For sandboxed documents, we use the domain
         // of their first non-sandboxed document, walking up until we find
         // one. If we can't find one, we fall back to using the GUID of the
         // null principal as the base domain.
         if (document->GetSandboxFlags() & SANDBOXED_ORIGIN) {
           nsCOMPtr<Document> tmpDoc = document;
           do {
-            tmpDoc = tmpDoc->GetParentDocument();
+            tmpDoc = tmpDoc->GetInProcessParentDocument();
           } while (tmpDoc && tmpDoc->GetSandboxFlags() & SANDBOXED_ORIGIN);
 
           if (tmpDoc) {
             // There was an unsandboxed ancestor, yay!
             nsCOMPtr<nsIPrincipal> tmpPrincipal = tmpDoc->NodePrincipal();
             rv = tmpPrincipal->GetBaseDomain(loadInfo.mDomain);
             NS_ENSURE_SUCCESS(rv, rv);
           } else {
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -2885,17 +2885,17 @@ nsresult XMLHttpRequestMainThread::SendI
   mFlagSend = true;
 
   // If we're synchronous, spin an event loop here and wait
   if (mFlagSynchronous) {
     mFlagSyncLooping = true;
 
     if (GetOwner()) {
       if (nsCOMPtr<nsPIDOMWindowOuter> topWindow =
-              GetOwner()->GetOuterWindow()->GetTop()) {
+              GetOwner()->GetOuterWindow()->GetInProcessTop()) {
         if (nsCOMPtr<nsPIDOMWindowInner> topInner =
                 topWindow->GetCurrentInnerWindow()) {
           mSuspendedDoc = topWindow->GetExtantDoc();
           if (mSuspendedDoc) {
             mSuspendedDoc->SuppressEventHandling();
           }
           topInner->Suspend();
           mResumeTimeoutRunnable = new nsResumeTimeoutsEvent(topInner);
--- a/dom/xul/XULPersist.cpp
+++ b/dom/xul/XULPersist.cpp
@@ -14,17 +14,17 @@
 
 namespace mozilla {
 namespace dom {
 
 static bool ShouldPersistAttribute(Element* aElement, nsAtom* aAttribute) {
   if (aElement->IsXULElement(nsGkAtoms::window)) {
     // This is not an element of the top document, its owner is
     // not an nsXULWindow. Persist it.
-    if (aElement->OwnerDoc()->GetParentDocument()) {
+    if (aElement->OwnerDoc()->GetInProcessParentDocument()) {
       return true;
     }
     // The following attributes of xul:window should be handled in
     // nsXULWindow::SavePersistentAttributes instead of here.
     if (aAttribute == nsGkAtoms::screenX || aAttribute == nsGkAtoms::screenY ||
         aAttribute == nsGkAtoms::width || aAttribute == nsGkAtoms::height ||
         aAttribute == nsGkAtoms::sizemode) {
       return false;
--- a/editor/spellchecker/EditorSpellCheck.cpp
+++ b/editor/spellchecker/EditorSpellCheck.cpp
@@ -630,17 +630,17 @@ EditorSpellCheck::UpdateCurrentDictionar
     return NS_ERROR_FAILURE;
   }
 
   // Try to get topmost document's document element for embedded mail editor.
   uint32_t flags = 0;
   mEditor->GetFlags(&flags);
   if (flags & nsIPlaintextEditor::eEditorMailMask) {
     RefPtr<Document> ownerDoc = rootContent->OwnerDoc();
-    Document* parentDoc = ownerDoc->GetParentDocument();
+    Document* parentDoc = ownerDoc->GetInProcessParentDocument();
     if (parentDoc) {
       rootContent = parentDoc->GetDocumentElement();
       if (!rootContent) {
         return NS_ERROR_FAILURE;
       }
     }
   }
 
--- a/image/ImageCacheKey.cpp
+++ b/image/ImageCacheKey.cpp
@@ -188,17 +188,18 @@ nsCString ImageCacheKey::GetTopLevelBase
   // Another scenario is if this image is a 3rd party resource loaded by a
   // first party context. In this case, we should check if the nsIChannel has
   // been marked as tracking resource, but we don't have the channel yet at
   // this point.  The best approach here is to be conservative: if we are sure
   // that the permission is granted, let's return 0. Otherwise, let's make a
   // unique image cache per the top-level document eTLD+1.
   if (!AntiTrackingCommon::MaybeIsFirstPartyStorageAccessGrantedFor(
           aDocument->GetInnerWindow(), aURI)) {
-    nsPIDOMWindowOuter* top = aDocument->GetInnerWindow()->GetScriptableTop();
+    nsPIDOMWindowOuter* top =
+        aDocument->GetInnerWindow()->GetInProcessScriptableTop();
     nsPIDOMWindowInner* topInner = top ? top->GetCurrentInnerWindow() : nullptr;
     if (!topInner) {
       return aDocument
           ->GetBaseDomain();  // because we don't have anything better!
     }
     return topInner->GetExtantDoc() ? topInner->GetExtantDoc()->GetBaseDomain()
                                     : EmptyCString();
   }
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -352,17 +352,17 @@ void AccessibleCaretEventHub::Init() {
   }
 
   nsCOMPtr<nsIDocShell> curDocShell = docShell;
   do {
     curDocShell->AddWeakReflowObserver(this);
     curDocShell->AddWeakScrollObserver(this);
 
     nsCOMPtr<nsIDocShellTreeItem> tmp;
-    curDocShell->GetSameTypeParent(getter_AddRefs(tmp));
+    curDocShell->GetInProcessSameTypeParent(getter_AddRefs(tmp));
     curDocShell = do_QueryInterface(tmp);
   } while (curDocShell);
 
   mDocShell = static_cast<nsDocShell*>(docShell);
 
   if (StaticPrefs::layout_accessiblecaret_use_long_tap_injector()) {
     mLongTapInjectorTimer = NS_NewTimer();
   }
@@ -378,17 +378,17 @@ void AccessibleCaretEventHub::Terminate(
   }
 
   nsCOMPtr<nsIDocShell> curDocShell = mDocShell.get();
   while (curDocShell) {
     curDocShell->RemoveWeakReflowObserver(this);
     curDocShell->RemoveWeakScrollObserver(this);
 
     nsCOMPtr<nsIDocShellTreeItem> tmp;
-    curDocShell->GetSameTypeParent(getter_AddRefs(tmp));
+    curDocShell->GetInProcessSameTypeParent(getter_AddRefs(tmp));
     curDocShell = do_QueryInterface(tmp);
   }
 
   if (mLongTapInjectorTimer) {
     mLongTapInjectorTimer->Cancel();
   }
 
   mManager->Terminate();
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -6352,17 +6352,17 @@ already_AddRefed<PresShell> PresShell::G
   if (!treeItem) {
     treeItem = mForwardingContainer.get();
   }
 
   // Might have gone away, or never been around to start with
   NS_ENSURE_TRUE(treeItem, nullptr);
 
   nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
-  treeItem->GetParent(getter_AddRefs(parentTreeItem));
+  treeItem->GetInProcessParent(getter_AddRefs(parentTreeItem));
   nsCOMPtr<nsIDocShell> parentDocShell = do_QueryInterface(parentTreeItem);
   NS_ENSURE_TRUE(parentDocShell && treeItem != parentTreeItem, nullptr);
 
   RefPtr<PresShell> parentPresShell = parentDocShell->GetPresShell();
   return parentPresShell.forget();
 }
 
 nsresult PresShell::EventHandler::RetargetEventToParent(
@@ -7152,17 +7152,17 @@ nsIFrame* PresShell::EventHandler::GetFr
   // need to dispatch only KeyboardEvent in its nearest visible document
   // because key focus shouldn't be caught by invisible document.
   if (!retargetPresShell) {
     if (!aGUIEvent->HasKeyEventMessage()) {
       return nullptr;
     }
     Document* retargetEventDoc = aRetargetDocument;
     while (!retargetPresShell) {
-      retargetEventDoc = retargetEventDoc->GetParentDocument();
+      retargetEventDoc = retargetEventDoc->GetInProcessParentDocument();
       if (!retargetEventDoc) {
         return nullptr;
       }
       retargetPresShell = retargetEventDoc->GetPresShell();
     }
   }
 
   // If the found PresShell is this instance, caller needs to keep handling
@@ -8239,17 +8239,17 @@ PresShell::EventHandler::GetDocumentURIT
   nsPresContext* presContext = aPresShell.GetPresContext();
   if (NS_WARN_IF(!presContext)) {
     return nullptr;
   }
   // If the document is sandboxed document or data: document, we should
   // get URI of the parent document.
   for (Document* document = presContext->Document();
        document && document->IsContentDocument();
-       document = document->GetParentDocument()) {
+       document = document->GetInProcessParentDocument()) {
     // The document URI may be about:blank even if it comes from actual web
     // site.  Therefore, we need to check the URI of its principal.
     nsIPrincipal* principal = document->NodePrincipal();
     if (principal->GetIsNullPrincipal()) {
       continue;
     }
     nsCOMPtr<nsIURI> uri;
     principal->GetURI(getter_AddRefs(uri));
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -4154,17 +4154,17 @@ nsCSSFrameConstructor::FindXULDescriptio
 #  ifdef XP_MACOSX
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULMenubarData(const Element& aElement,
                                           ComputedStyle&) {
   nsCOMPtr<nsIDocShell> treeItem = aElement.OwnerDoc()->GetDocShell();
   if (treeItem && nsIDocShellTreeItem::typeChrome == treeItem->ItemType()) {
     nsCOMPtr<nsIDocShellTreeItem> parent;
-    treeItem->GetParent(getter_AddRefs(parent));
+    treeItem->GetInProcessParent(getter_AddRefs(parent));
     if (!parent) {
       // This is the root.  Suppress the menubar, since on Mac
       // window menus are not attached to the window.
       static const FrameConstructionData sSuppressData = SUPPRESS_FCDATA();
       return &sSuppressData;
     }
   }
 
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -667,17 +667,17 @@ nsresult nsDocumentViewer::SyncParentSub
   }
 
   nsCOMPtr<Element> element = pwin->GetFrameElementInternal();
   if (!element) {
     return NS_OK;
   }
 
   nsCOMPtr<nsIDocShellTreeItem> parent;
-  docShell->GetParent(getter_AddRefs(parent));
+  docShell->GetInProcessParent(getter_AddRefs(parent));
 
   nsCOMPtr<nsPIDOMWindowOuter> parent_win =
       parent ? parent->GetWindow() : nullptr;
   if (!parent_win) {
     return NS_OK;
   }
 
   nsCOMPtr<Document> parent_doc = parent_win->GetDoc();
@@ -1099,24 +1099,24 @@ nsDocumentViewer::LoadComplete(nsresult 
       // childs' load event, and in this case we need to fire some artificial
       // load events to make the parent thinks the load events for child has
       // been done
       if (innerWindow && DocGroup::TryToLoadIframesInBackground()) {
         nsTArray<nsCOMPtr<nsIDocShell>> docShells;
         nsCOMPtr<nsIDocShell> container(mContainer);
         if (container) {
           int32_t count;
-          container->GetChildCount(&count);
+          container->GetInProcessChildCount(&count);
           // We first find all background loading iframes that need to
           // fire artificial load events, and instead of firing them as
           // soon as we find them, we store them in an array, to prevent
           // us from skipping some events.
           for (int32_t i = 0; i < count; ++i) {
             nsCOMPtr<nsIDocShellTreeItem> child;
-            container->GetChildAt(i, getter_AddRefs(child));
+            container->GetInProcessChildAt(i, getter_AddRefs(child));
             nsCOMPtr<nsIDocShell> childIDocShell = do_QueryInterface(child);
             RefPtr<nsDocShell> docShell = nsDocShell::Cast(childIDocShell);
             if (docShell && docShell->TreatAsBackgroundLoad() &&
                 docShell->GetDocument()->GetReadyStateEnum() <
                     Document::READYSTATE_COMPLETE) {
               docShells.AppendElement(childIDocShell);
             }
           }
@@ -1416,21 +1416,21 @@ nsresult nsDocumentViewer::PermitUnloadI
       if (*aPermitUnload) {
         *aPermitUnloadFlags = eDontPromptAndUnload;
       }
     }
   }
 
   if (docShell) {
     int32_t childCount;
-    docShell->GetChildCount(&childCount);
+    docShell->GetInProcessChildCount(&childCount);
 
     for (int32_t i = 0; i < childCount && *aPermitUnload; ++i) {
       nsCOMPtr<nsIDocShellTreeItem> item;
-      docShell->GetChildAt(i, getter_AddRefs(item));
+      docShell->GetInProcessChildAt(i, getter_AddRefs(item));
 
       nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(item));
 
       if (docShell) {
         nsCOMPtr<nsIContentViewer> cv;
         docShell->GetContentViewer(getter_AddRefs(cv));
 
         if (cv) {
@@ -1533,20 +1533,20 @@ static void AttachContainerRecurse(nsIDo
     }
     if (PresShell* presShell = viewer->GetPresShell()) {
       presShell->SetForwardingContainer(WeakPtr<nsDocShell>());
     }
   }
 
   // Now recurse through the children
   int32_t childCount;
-  aShell->GetChildCount(&childCount);
+  aShell->GetInProcessChildCount(&childCount);
   for (int32_t i = 0; i < childCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> childItem;
-    aShell->GetChildAt(i, getter_AddRefs(childItem));
+    aShell->GetInProcessChildAt(i, getter_AddRefs(childItem));
     nsCOMPtr<nsIDocShell> shell = do_QueryInterface(childItem);
     AttachContainerRecurse(shell);
   }
 }
 
 NS_IMETHODIMP
 nsDocumentViewer::Open(nsISupports* aState, nsISHEntry* aSHEntry) {
   NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_INITIALIZED);
@@ -1689,20 +1689,20 @@ static void DetachContainerRecurse(nsIDo
     if (PresShell* presShell = viewer->GetPresShell()) {
       auto weakShell = static_cast<nsDocShell*>(aShell);
       presShell->SetForwardingContainer(weakShell);
     }
   }
 
   // Now recurse through the children
   int32_t childCount;
-  aShell->GetChildCount(&childCount);
+  aShell->GetInProcessChildCount(&childCount);
   for (int32_t i = 0; i < childCount; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> childItem;
-    aShell->GetChildAt(i, getter_AddRefs(childItem));
+    aShell->GetInProcessChildAt(i, getter_AddRefs(childItem));
     nsCOMPtr<nsIDocShell> shell = do_QueryInterface(childItem);
     DetachContainerRecurse(shell);
   }
 }
 
 NS_IMETHODIMP
 nsDocumentViewer::Destroy() {
   NS_ASSERTION(mDocument, "No document in Destroy()!");
@@ -1966,20 +1966,20 @@ nsDocumentViewer::SetDocumentInternal(Do
     }
 
     // Clear the list of old child docshells. Child docshells for the new
     // document will be constructed as frames are created.
     if (!aDocument->IsStaticDocument()) {
       nsCOMPtr<nsIDocShell> node(mContainer);
       if (node) {
         int32_t count;
-        node->GetChildCount(&count);
+        node->GetInProcessChildCount(&count);
         for (int32_t i = 0; i < count; ++i) {
           nsCOMPtr<nsIDocShellTreeItem> child;
-          node->GetChildAt(0, getter_AddRefs(child));
+          node->GetInProcessChildAt(0, getter_AddRefs(child));
           node->RemoveChild(child);
         }
       }
     }
 
     // Replace the old document with the new one. Do this only when
     // the new document really is a new document.
     mDocument = aDocument;
@@ -2162,17 +2162,17 @@ nsDocumentViewer::Show(void) {
     prevViewer->Destroy();
 
     // Make sure we don't have too many cached ContentViewers
     nsCOMPtr<nsIDocShellTreeItem> treeItem(mContainer);
     if (treeItem) {
       // We need to find the root DocShell since only that object has an
       // SHistory and we need the SHistory to evict content viewers
       nsCOMPtr<nsIDocShellTreeItem> root;
-      treeItem->GetSameTypeRootTreeItem(getter_AddRefs(root));
+      treeItem->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
       nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(root);
       RefPtr<ChildSHistory> history = webNav->GetSessionHistory();
       if (history) {
         int32_t prevIndex, loadedIndex;
         nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(treeItem);
         docShell->GetPreviousEntryIndex(&prevIndex);
         docShell->GetLoadedEntryIndex(&loadedIndex);
         MOZ_LOG(gPageCacheLog, LogLevel::Verbose,
@@ -2664,20 +2664,20 @@ NS_IMETHODIMP nsDocumentViewer::SetComma
   return NS_OK;
 }
 
 void nsDocumentViewer::CallChildren(CallChildFunc aFunc, void* aClosure) {
   nsCOMPtr<nsIDocShell> docShell(mContainer);
   if (docShell) {
     int32_t i;
     int32_t n;
-    docShell->GetChildCount(&n);
+    docShell->GetInProcessChildCount(&n);
     for (i = 0; i < n; i++) {
       nsCOMPtr<nsIDocShellTreeItem> child;
-      docShell->GetChildAt(i, getter_AddRefs(child));
+      docShell->GetInProcessChildAt(i, getter_AddRefs(child));
       nsCOMPtr<nsIDocShell> childAsShell(do_QueryInterface(child));
       NS_ASSERTION(childAsShell, "null child in docshell");
       if (childAsShell) {
         nsCOMPtr<nsIContentViewer> childCV;
         childAsShell->GetContentViewer(getter_AddRefs(childCV));
         if (childCV) {
           (*aFunc)(childCV, aClosure);
         }
@@ -3211,17 +3211,17 @@ nsresult nsDocumentViewer::GetContentSiz
 
 NS_IMETHODIMP
 nsDocumentViewer::GetContentSize(int32_t* aWidth, int32_t* aHeight) {
   // Skip doing this on docshell-less documents for now
   nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(mContainer);
   NS_ENSURE_TRUE(docShellAsItem, NS_ERROR_NOT_AVAILABLE);
 
   nsCOMPtr<nsIDocShellTreeItem> docShellParent;
-  docShellAsItem->GetSameTypeParent(getter_AddRefs(docShellParent));
+  docShellAsItem->GetInProcessSameTypeParent(getter_AddRefs(docShellParent));
 
   // It's only valid to access this from a top frame.  Doesn't work from
   // sub-frames.
   NS_ENSURE_TRUE(!docShellParent, NS_ERROR_FAILURE);
 
   return GetContentSizeInternal(aWidth, aHeight, NS_UNCONSTRAINEDSIZE,
                                 NS_UNCONSTRAINEDSIZE);
 }
@@ -3899,17 +3899,17 @@ void nsDocumentViewer::SetIsPrintingInDo
     nsIDocShellTreeItem* aParentNode, bool aIsPrintingOrPP, bool aStartAtTop) {
   nsCOMPtr<nsIDocShellTreeItem> parentItem(aParentNode);
 
   // find top of "same parent" tree
   if (aStartAtTop) {
     if (aIsPrintingOrPP) {
       while (parentItem) {
         nsCOMPtr<nsIDocShellTreeItem> parent;
-        parentItem->GetSameTypeParent(getter_AddRefs(parent));
+        parentItem->GetInProcessSameTypeParent(getter_AddRefs(parent));
         if (!parent) {
           break;
         }
         parentItem = parent;
       }
       mTopContainerWhilePrinting = do_GetWeakReference(parentItem);
     } else {
       parentItem = do_QueryReferent(mTopContainerWhilePrinting);
@@ -3923,20 +3923,20 @@ void nsDocumentViewer::SetIsPrintingInDo
   }
 
   if (!aParentNode) {
     return;
   }
 
   // Traverse children to see if any of them are printing.
   int32_t n;
-  aParentNode->GetChildCount(&n);
+  aParentNode->GetInProcessChildCount(&n);
   for (int32_t i = 0; i < n; i++) {
     nsCOMPtr<nsIDocShellTreeItem> child;
-    aParentNode->GetChildAt(i, getter_AddRefs(child));
+    aParentNode->GetInProcessChildAt(i, getter_AddRefs(child));
     NS_ASSERTION(child, "child isn't nsIDocShell");
     if (child) {
       SetIsPrintingInDocShellTree(child, aIsPrintingOrPP, false);
     }
   }
 }
 #endif  // NS_PRINTING
 
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -7437,17 +7437,17 @@ nsDeviceContext* nsLayoutUtils::GetDevic
     if (presContext) {
       nsDeviceContext* context = presContext->DeviceContext();
       if (context) {
         return context;
       }
     }
 
     nsCOMPtr<nsIDocShellTreeItem> parentItem;
-    docShell->GetParent(getter_AddRefs(parentItem));
+    docShell->GetInProcessParent(getter_AddRefs(parentItem));
     docShell = do_QueryInterface(parentItem);
   }
 
   return nullptr;
 }
 
 /* static */
 bool nsLayoutUtils::IsReallyFixedPos(const nsIFrame* aFrame) {
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -607,30 +607,30 @@ nsresult nsPresContext::Init(nsDeviceCon
   mAnimationManager = MakeUnique<nsAnimationManager>(this);
 
   if (mDocument->GetDisplayDocument()) {
     NS_ASSERTION(mDocument->GetDisplayDocument()->GetPresContext(),
                  "Why are we being initialized?");
     mRefreshDriver =
         mDocument->GetDisplayDocument()->GetPresContext()->RefreshDriver();
   } else {
-    dom::Document* parent = mDocument->GetParentDocument();
+    dom::Document* parent = mDocument->GetInProcessParentDocument();
     // Unfortunately, sometimes |parent| here has no presshell because
     // printing screws up things.  Assert that in other cases it does,
     // but whenever the shell is null just fall back on using our own
     // refresh driver.
     NS_ASSERTION(
         !parent || mDocument->IsStaticDocument() || parent->GetPresShell(),
         "How did we end up with a presshell if our parent doesn't "
         "have one?");
     if (parent && parent->GetPresContext()) {
       nsCOMPtr<nsIDocShellTreeItem> ourItem = mDocument->GetDocShell();
       if (ourItem) {
         nsCOMPtr<nsIDocShellTreeItem> parentItem;
-        ourItem->GetSameTypeParent(getter_AddRefs(parentItem));
+        ourItem->GetInProcessSameTypeParent(getter_AddRefs(parentItem));
         if (parentItem) {
           Element* containingElement =
               parent->FindContentForSubDocument(mDocument);
           if (!containingElement->IsXULElement() ||
               !containingElement->HasAttr(kNameSpaceID_None,
                                           nsGkAtoms::forceOwnRefreshDriver)) {
             mRefreshDriver = parent->GetPresContext()->RefreshDriver();
           }
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -736,17 +736,17 @@ bool nsPluginFrame::IsHidden(bool aCheck
 
   return false;
 }
 
 mozilla::LayoutDeviceIntPoint nsPluginFrame::GetRemoteTabChromeOffset() {
   LayoutDeviceIntPoint offset;
   if (XRE_IsContentProcess()) {
     if (nsPIDOMWindowOuter* window = GetContent()->OwnerDoc()->GetWindow()) {
-      if (nsCOMPtr<nsPIDOMWindowOuter> topWindow = window->GetTop()) {
+      if (nsCOMPtr<nsPIDOMWindowOuter> topWindow = window->GetInProcessTop()) {
         dom::BrowserChild* tc = dom::BrowserChild::GetFrom(topWindow);
         if (tc) {
           offset += tc->GetChromeOffset();
         }
       }
     }
   }
   return offset;
--- a/layout/printing/PrintPreviewUserEventSuppressor.cpp
+++ b/layout/printing/PrintPreviewUserEventSuppressor.cpp
@@ -137,17 +137,17 @@ PrintPreviewUserEventSuppressor::HandleE
         nsAutoString eventString;
         aEvent->GetType(eventString);
         if (eventString.EqualsLiteral("keydown")) {
           // Handle tabbing explicitly here since we don't want focus ending up
           // inside the content document, bug 244128.
           Document* doc = content->GetUncomposedDoc();
           NS_ASSERTION(doc, "no document");
 
-          Document* parentDoc = doc->GetParentDocument();
+          Document* parentDoc = doc->GetInProcessParentDocument();
           NS_ASSERTION(parentDoc, "no parent document");
 
           nsCOMPtr<nsPIDOMWindowOuter> win = parentDoc->GetWindow();
 
           nsIFocusManager* fm = nsFocusManager::GetFocusManager();
           if (fm && win) {
             Element* fromElement = parentDoc->FindContentForSubDocument(doc);
             bool forward = (action == eEventAction_Tab);
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -774,17 +774,17 @@ bool nsComputedDOMStyle::NeedsToFlush() 
   if (ElementNeedsRestyle(mElement, mPseudo)) {
     return true;
   }
 
   Document* doc = mElement->OwnerDoc();
   // If parent document is there, also needs to check if there is some change
   // that needs to flush this document (e.g. size change for iframe).
   while (doc->StyleOrLayoutObservablyDependsOnParentDocumentLayout()) {
-    Document* parentDocument = doc->GetParentDocument();
+    Document* parentDocument = doc->GetInProcessParentDocument();
     Element* element = parentDocument->FindContentForSubDocument(doc);
     if (ElementNeedsRestyle(element, nullptr)) {
       return true;
     }
     doc = parentDocument;
   }
 
   return false;
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -161,17 +161,17 @@ float Gecko_MediaFeatures_GetResolution(
   }
   // Get the actual device pixel ratio, which also takes zoom into account.
   return float(AppUnitsPerCSSPixel()) /
          pc->DeviceContext()->AppUnitsPerDevPixel();
 }
 
 static const Document* TopDocument(const Document* aDocument) {
   const Document* current = aDocument;
-  while (const Document* parent = current->GetParentDocument()) {
+  while (const Document* parent = current->GetInProcessParentDocument()) {
     current = parent;
   }
   return current;
 }
 
 StyleDisplayMode Gecko_MediaFeatures_GetDisplayMode(const Document* aDocument) {
   const Document* rootDocument = TopDocument(aDocument);
 
--- a/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
+++ b/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
@@ -129,25 +129,25 @@ static void DumpAWebShell(nsIDocShellTre
   nsString name;
   nsCOMPtr<nsIDocShellTreeItem> parent;
   int32_t i, n;
 
   for (i = aIndent; --i >= 0;) fprintf(out, "  ");
 
   fprintf(out, "%p '", static_cast<void*>(aShellItem));
   aShellItem->GetName(name);
-  aShellItem->GetSameTypeParent(getter_AddRefs(parent));
+  aShellItem->GetInProcessSameTypeParent(getter_AddRefs(parent));
   fputs(NS_LossyConvertUTF16toASCII(name).get(), out);
   fprintf(out, "' parent=%p <\n", static_cast<void*>(parent));
 
   ++aIndent;
-  aShellItem->GetChildCount(&n);
+  aShellItem->GetInProcessChildCount(&n);
   for (i = 0; i < n; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> child;
-    aShellItem->GetChildAt(i, getter_AddRefs(child));
+    aShellItem->GetInProcessChildAt(i, getter_AddRefs(child));
     if (child) {
       DumpAWebShell(child, out, aIndent);
     }
   }
   --aIndent;
   for (i = aIndent; --i >= 0;) fprintf(out, "  ");
   fputs(">\n", out);
 }
@@ -169,20 +169,20 @@ static void DumpContentRecur(nsIDocShell
       if (root) {
         root->List(out);
       }
     } else {
       fputs("no document\n", out);
     }
     // dump the frames of the sub documents
     int32_t i, n;
-    aDocShell->GetChildCount(&n);
+    aDocShell->GetInProcessChildCount(&n);
     for (i = 0; i < n; ++i) {
       nsCOMPtr<nsIDocShellTreeItem> child;
-      aDocShell->GetChildAt(i, getter_AddRefs(child));
+      aDocShell->GetInProcessChildAt(i, getter_AddRefs(child));
       nsCOMPtr<nsIDocShell> childAsShell(do_QueryInterface(child));
       if (child) {
         DumpContentRecur(childAsShell, out);
       }
     }
   }
 #endif
 }
@@ -203,20 +203,20 @@ static void DumpFramesRecur(nsIDocShell*
       root->List(out);
     }
   } else {
     fputs("null pres shell\n", out);
   }
 
   // dump the frames of the sub documents
   int32_t i, n;
-  aDocShell->GetChildCount(&n);
+  aDocShell->GetInProcessChildCount(&n);
   for (i = 0; i < n; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> child;
-    aDocShell->GetChildAt(i, getter_AddRefs(child));
+    aDocShell->GetInProcessChildAt(i, getter_AddRefs(child));
     nsCOMPtr<nsIDocShell> childAsShell(do_QueryInterface(child));
     if (childAsShell) {
       DumpFramesRecur(childAsShell, out);
     }
   }
 #endif
 }
 
@@ -237,20 +237,20 @@ static void DumpViewsRecur(nsIDocShell* 
       root->List(out);
     }
   } else {
     fputs("null view manager\n", out);
   }
 
   // dump the views of the sub documents
   int32_t i, n;
-  aDocShell->GetChildCount(&n);
+  aDocShell->GetInProcessChildCount(&n);
   for (i = 0; i < n; i++) {
     nsCOMPtr<nsIDocShellTreeItem> child;
-    aDocShell->GetChildAt(i, getter_AddRefs(child));
+    aDocShell->GetInProcessChildAt(i, getter_AddRefs(child));
     nsCOMPtr<nsIDocShell> childAsShell(do_QueryInterface(child));
     if (childAsShell) {
       DumpViewsRecur(childAsShell, out);
     }
   }
 #endif  // DEBUG
 }
 
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -1175,17 +1175,17 @@ void nsXULPopupManager::EnableRollup(nsI
 
 bool nsXULPopupManager::IsChildOfDocShell(Document* aDoc,
                                           nsIDocShellTreeItem* aExpected) {
   nsCOMPtr<nsIDocShellTreeItem> docShellItem(aDoc->GetDocShell());
   while (docShellItem) {
     if (docShellItem == aExpected) return true;
 
     nsCOMPtr<nsIDocShellTreeItem> parent;
-    docShellItem->GetParent(getter_AddRefs(parent));
+    docShellItem->GetInProcessParent(getter_AddRefs(parent));
     docShellItem = parent;
   }
 
   return false;
 }
 
 void nsXULPopupManager::HidePopupsInDocShell(
     nsIDocShellTreeItem* aDocShellToHide) {
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -40,17 +40,17 @@
 using namespace mozilla::dom;
 
 namespace mozilla {
 namespace net {
 
 static uint64_t FindTopOuterWindowID(nsPIDOMWindowOuter* aOuter) {
   nsCOMPtr<nsPIDOMWindowOuter> outer = aOuter;
   while (nsCOMPtr<nsPIDOMWindowOuter> parent =
-             outer->GetScriptableParentOrNull()) {
+             outer->GetInProcessScriptableParentOrNull()) {
     outer = parent;
   }
   return outer->WindowID();
 }
 
 LoadInfo::LoadInfo(
     nsIPrincipal* aLoadingPrincipal, nsIPrincipal* aTriggeringPrincipal,
     nsINode* aLoadingContext, nsSecurityFlags aSecurityFlags,
@@ -160,17 +160,18 @@ LoadInfo::LoadInfo(
       mController = aLoadingContext->OwnerDoc()->GetController();
     }
 
     nsCOMPtr<nsPIDOMWindowOuter> contextOuter =
         aLoadingContext->OwnerDoc()->GetWindow();
     if (contextOuter) {
       ComputeIsThirdPartyContext(contextOuter);
       mOuterWindowID = contextOuter->WindowID();
-      nsCOMPtr<nsPIDOMWindowOuter> parent = contextOuter->GetScriptableParent();
+      nsCOMPtr<nsPIDOMWindowOuter> parent =
+          contextOuter->GetInProcessScriptableParent();
       mParentOuterWindowID = parent ? parent->WindowID() : mOuterWindowID;
       mTopOuterWindowID = FindTopOuterWindowID(contextOuter);
       RefPtr<dom::BrowsingContext> bc = contextOuter->GetBrowsingContext();
       mBrowsingContextID = bc ? bc->Id() : 0;
 
       nsGlobalWindowInner* innerWindow =
           nsGlobalWindowInner::Cast(contextOuter->GetCurrentInnerWindow());
       if (innerWindow) {
@@ -200,17 +201,17 @@ LoadInfo::LoadInfo(
 
         mDocumentHasLoaded = innerWindow->IsDocumentLoaded();
 
         if (innerWindow->IsFrame()) {
           // For resources within iframes, we actually want the
           // top-level document's flag, not the iframe document's.
           mDocumentHasLoaded = false;
           nsGlobalWindowOuter* topOuter =
-              innerWindow->GetScriptableTopInternal();
+              innerWindow->GetInProcessScriptableTopInternal();
           if (topOuter) {
             nsGlobalWindowInner* topInner =
                 nsGlobalWindowInner::Cast(topOuter->GetCurrentInnerWindow());
             if (topInner) {
               mDocumentHasLoaded = topInner->IsDocumentLoaded();
             }
           }
         }
@@ -372,17 +373,18 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* a
 
   // NB: Ignore the current inner window since we're navigating away from it.
   mOuterWindowID = aOuterWindow->WindowID();
   RefPtr<BrowsingContext> bc = aOuterWindow->GetBrowsingContext();
   mBrowsingContextID = bc ? bc->Id() : 0;
 
   // TODO We can have a parent without a frame element in some cases dealing
   // with the hidden window.
-  nsCOMPtr<nsPIDOMWindowOuter> parent = aOuterWindow->GetScriptableParent();
+  nsCOMPtr<nsPIDOMWindowOuter> parent =
+      aOuterWindow->GetInProcessScriptableParent();
   mParentOuterWindowID = parent ? parent->WindowID() : 0;
   mTopOuterWindowID = FindTopOuterWindowID(aOuterWindow);
 
   nsGlobalWindowInner* innerWindow =
       nsGlobalWindowInner::Cast(aOuterWindow->GetCurrentInnerWindow());
   if (innerWindow) {
     mTopLevelPrincipal = innerWindow->GetTopLevelPrincipal();
     // mTopLevelStorageAreaPrincipal is always null for top-level document
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -795,17 +795,17 @@ void nsHtml5TreeOpExecutor::MaybeComplai
   // textual, a misrendered ad probably isn't a huge loss for users.
   // Let's suppress the message in this case.
   // This means that errors about other different-origin iframes in mashups
   // are lost as well, but generally, the site author isn't in control of
   // the embedded different-origin pages anyway and can't fix problems even
   // if alerted about them.
   if (!strcmp(aMsgId, "EncNoDeclaration") && mDocShell) {
     nsCOMPtr<nsIDocShellTreeItem> parent;
-    mDocShell->GetSameTypeParent(getter_AddRefs(parent));
+    mDocShell->GetInProcessSameTypeParent(getter_AddRefs(parent));
     if (parent) {
       return;
     }
   }
   mAlreadyComplainedAboutCharset = true;
   nsContentUtils::ReportToConsole(
       aError ? nsIScriptError::errorFlag : nsIScriptError::warningFlag,
       NS_LITERAL_CSTRING("HTML parser"), mDocument,
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -108,17 +108,17 @@ nsSecureBrowserUIImpl::PrepareForContent
     return nullptr;
   }
 
   // For content docShells, the mixed content security state is set on the root
   // docShell.
   if (docShell->ItemType() == nsIDocShellTreeItem::typeContent) {
     nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(docShell);
     nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
-    Unused << docShellTreeItem->GetSameTypeRootTreeItem(
+    Unused << docShellTreeItem->GetInProcessSameTypeRootTreeItem(
         getter_AddRefs(sameTypeRoot));
     MOZ_ASSERT(
         sameTypeRoot,
         "No document shell root tree item from document shell tree item!");
     docShell = do_QueryInterface(sameTypeRoot);
     if (!docShell) {
       return nullptr;
     }
--- a/toolkit/components/antitracking/AntiTrackingCommon.cpp
+++ b/toolkit/components/antitracking/AntiTrackingCommon.cpp
@@ -342,17 +342,17 @@ bool CheckContentBlockingAllowList(nsPID
   auto entry = GetContentBlockingAllowListCache().Lookup(cacheKey);
   if (entry) {
     // We've recently performed a content blocking allow list check for this
     // window, so let's quickly return the answer instead of continuing with the
     // rest of this potentially expensive computation.
     return entry.Data().mResult;
   }
 
-  nsPIDOMWindowOuter* top = aWindow->GetScriptableTop();
+  nsPIDOMWindowOuter* top = aWindow->GetInProcessScriptableTop();
   if (top) {
     nsIURI* topWinURI = top->GetDocumentURI();
     Document* doc = top->GetExtantDoc();
     bool isPrivateBrowsing =
         doc ? nsContentUtils::IsInPrivateBrowsing(doc) : false;
 
     const bool result =
         CheckContentBlockingAllowList(topWinURI, isPrivateBrowsing);
@@ -600,17 +600,17 @@ already_AddRefed<nsPIDOMWindowOuter> Get
   nsIChannel* channel = document->GetChannel();
   if (!channel) {
     return nullptr;
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> pwin;
   auto* outer = nsGlobalWindowOuter::Cast(aWindow->GetOuterWindow());
   if (outer) {
-    pwin = outer->GetScriptableTop();
+    pwin = outer->GetInProcessScriptableTop();
   }
 
   if (!pwin) {
     return nullptr;
   }
 
   return pwin.forget();
 }
@@ -867,17 +867,18 @@ AntiTrackingCommon::AddFirstPartyStorage
             getter_AddRefs(trackingPrincipal))) {
       LOG(
           ("Error while computing the parent principal and tracking origin, "
            "bailing out early"));
       return StorageAccessGrantPromise::CreateAndReject(false, __func__);
     }
   }
 
-  nsCOMPtr<nsPIDOMWindowOuter> topOuterWindow = outerParentWindow->GetTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topOuterWindow =
+      outerParentWindow->GetInProcessTop();
   nsGlobalWindowOuter* topWindow = nsGlobalWindowOuter::Cast(topOuterWindow);
   if (NS_WARN_IF(!topWindow)) {
     LOG(("No top outer window."));
     return StorageAccessGrantPromise::CreateAndReject(false, __func__);
   }
 
   nsPIDOMWindowInner* topInnerWindow = topWindow->GetCurrentInnerWindow();
   if (NS_WARN_IF(!topInnerWindow)) {
@@ -1158,17 +1159,17 @@ bool AntiTrackingCommon::IsFirstPartySto
 
   nsGlobalWindowOuter* outerWindow =
       nsGlobalWindowOuter::Cast(aWindow->GetOuterWindow());
   if (!outerWindow) {
     LOG(("Our window has no outer window"));
     return false;
   }
 
-  nsCOMPtr<nsPIDOMWindowOuter> topOuterWindow = outerWindow->GetTop();
+  nsCOMPtr<nsPIDOMWindowOuter> topOuterWindow = outerWindow->GetInProcessTop();
   nsGlobalWindowOuter* topWindow = nsGlobalWindowOuter::Cast(topOuterWindow);
   if (NS_WARN_IF(!topWindow)) {
     LOG(("No top outer window"));
     return false;
   }
 
   nsPIDOMWindowInner* topInnerWindow = topWindow->GetCurrentInnerWindow();
   if (NS_WARN_IF(!topInnerWindow)) {
--- a/toolkit/components/browser/nsWebBrowser.cpp
+++ b/toolkit/components/browser/nsWebBrowser.cpp
@@ -340,56 +340,59 @@ NS_IMETHODIMP
 nsWebBrowser::GetItemType(int32_t* aItemType) {
   NS_ENSURE_ARG_POINTER(aItemType);
 
   *aItemType = ItemType();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWebBrowser::GetParent(nsIDocShellTreeItem** aParent) {
+nsWebBrowser::GetInProcessParent(nsIDocShellTreeItem** aParent) {
   *aParent = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWebBrowser::GetSameTypeParent(nsIDocShellTreeItem** aParent) {
+nsWebBrowser::GetInProcessSameTypeParent(nsIDocShellTreeItem** aParent) {
   *aParent = nullptr;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebBrowser::GetRootTreeItem(nsIDocShellTreeItem** aRootTreeItem) {
   NS_ENSURE_ARG_POINTER(aRootTreeItem);
   *aRootTreeItem = static_cast<nsIDocShellTreeItem*>(this);
 
   nsCOMPtr<nsIDocShellTreeItem> parent;
-  NS_ENSURE_SUCCESS(GetParent(getter_AddRefs(parent)), NS_ERROR_FAILURE);
+  NS_ENSURE_SUCCESS(GetInProcessParent(getter_AddRefs(parent)),
+                    NS_ERROR_FAILURE);
   while (parent) {
     *aRootTreeItem = parent;
-    NS_ENSURE_SUCCESS((*aRootTreeItem)->GetParent(getter_AddRefs(parent)),
-                      NS_ERROR_FAILURE);
+    NS_ENSURE_SUCCESS(
+        (*aRootTreeItem)->GetInProcessParent(getter_AddRefs(parent)),
+        NS_ERROR_FAILURE);
   }
   NS_ADDREF(*aRootTreeItem);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWebBrowser::GetSameTypeRootTreeItem(nsIDocShellTreeItem** aRootTreeItem) {
+nsWebBrowser::GetInProcessSameTypeRootTreeItem(
+    nsIDocShellTreeItem** aRootTreeItem) {
   NS_ENSURE_ARG_POINTER(aRootTreeItem);
   *aRootTreeItem = static_cast<nsIDocShellTreeItem*>(this);
 
   nsCOMPtr<nsIDocShellTreeItem> parent;
-  NS_ENSURE_SUCCESS(GetSameTypeParent(getter_AddRefs(parent)),
+  NS_ENSURE_SUCCESS(GetInProcessSameTypeParent(getter_AddRefs(parent)),
                     NS_ERROR_FAILURE);
   while (parent) {
     *aRootTreeItem = parent;
     NS_ENSURE_SUCCESS(
-        (*aRootTreeItem)->GetSameTypeParent(getter_AddRefs(parent)),
+        (*aRootTreeItem)->GetInProcessSameTypeParent(getter_AddRefs(parent)),
         NS_ERROR_FAILURE);
   }
   NS_ADDREF(*aRootTreeItem);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebBrowser::FindItemWithName(const nsAString& aName,
@@ -440,34 +443,35 @@ nsWebBrowser::SetTreeOwner(nsIDocShellTr
   return mDocShellTreeOwner->SetTreeOwner(aTreeOwner);
 }
 
 //*****************************************************************************
 // nsWebBrowser::nsIDocShellTreeItem
 //*****************************************************************************
 
 NS_IMETHODIMP
-nsWebBrowser::GetChildCount(int32_t* aChildCount) {
+nsWebBrowser::GetInProcessChildCount(int32_t* aChildCount) {
   NS_ENSURE_ARG_POINTER(aChildCount);
   *aChildCount = 0;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebBrowser::AddChild(nsIDocShellTreeItem* aChild) {
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
 nsWebBrowser::RemoveChild(nsIDocShellTreeItem* aChild) {
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
-nsWebBrowser::GetChildAt(int32_t aIndex, nsIDocShellTreeItem** aChild) {
+nsWebBrowser::GetInProcessChildAt(int32_t aIndex,
+                                  nsIDocShellTreeItem** aChild) {
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
 nsWebBrowser::FindChildWithName(const nsAString& aName, bool aRecurse,
                                 bool aSameType, nsIDocShellTreeItem* aRequestor,
                                 nsIDocShellTreeItem* aOriginalRequestor,
                                 nsIDocShellTreeItem** aResult) {
--- a/toolkit/components/extensions/ExtensionPolicyService.cpp
+++ b/toolkit/components/extensions/ExtensionPolicyService.cpp
@@ -421,17 +421,17 @@ static bool CheckParentFrames(nsPIDOMWin
   nsCOMPtr<nsIURI> htmlAboutAddons;
   if (NS_FAILED(
           NS_NewURI(getter_AddRefs(htmlAboutAddons),
                     "chrome://mozapps/content/extensions/aboutaddons.html"))) {
     return false;
   }
 
   auto* piWin = aWindow;
-  while ((piWin = piWin->GetScriptableParentOrNull())) {
+  while ((piWin = piWin->GetInProcessScriptableParentOrNull())) {
     auto* win = nsGlobalWindowOuter::Cast(piWin);
 
     auto* principal = BasePrincipal::Cast(win->GetPrincipal());
     if (nsContentUtils::IsSystemPrincipal(principal)) {
       // The add-on manager is a special case, since it contains extension
       // options pages in same-type <browser> frames.
       nsIURI* uri = win->GetDocumentURI();
       bool equals;
--- a/toolkit/components/extensions/WebExtensionPolicy.cpp
+++ b/toolkit/components/extensions/WebExtensionPolicy.cpp
@@ -769,17 +769,17 @@ bool WindowShouldMatchActiveTab(nsPIDOMW
     return false;
   }
 
   nsCOMPtr<nsILoadInfo> loadInfo = channel->LoadInfo();
   if (!loadInfo->GetOriginalFrameSrcLoad()) {
     return false;
   }
 
-  nsCOMPtr<nsPIDOMWindowOuter> parent = aWin->GetParent();
+  nsCOMPtr<nsPIDOMWindowOuter> parent = aWin->GetInProcessParent();
   MOZ_ASSERT(parent != nullptr);
   return WindowShouldMatchActiveTab(parent);
 }
 
 bool DocInfo::ShouldMatchActiveTabPermission() const {
   struct Matcher {
     bool operator()(Window aWin) { return WindowShouldMatchActiveTab(aWin); }
     bool operator()(LoadInfo aLoadInfo) { return false; }
--- a/toolkit/components/satchel/nsFormFillController.cpp
+++ b/toolkit/components/satchel/nsFormFillController.cpp
@@ -1433,16 +1433,16 @@ int32_t nsFormFillController::GetIndexOf
     if (mDocShells[i] == aDocShell) {
       return i;
     }
   }
 
   // Recursively check the parent docShell of this one
   nsCOMPtr<nsIDocShellTreeItem> treeItem = aDocShell;
   nsCOMPtr<nsIDocShellTreeItem> parentItem;
-  treeItem->GetParent(getter_AddRefs(parentItem));
+  treeItem->GetInProcessParent(getter_AddRefs(parentItem));
   if (parentItem) {
     nsCOMPtr<nsIDocShell> parentShell = do_QueryInterface(parentItem);
     return GetIndexOfDocShell(parentShell);
   }
 
   return -1;
 }
--- a/toolkit/components/sessionstore/SessionStoreUtils.cpp
+++ b/toolkit/components/sessionstore/SessionStoreUtils.cpp
@@ -98,24 +98,24 @@ void SessionStoreUtils::ForEachNonDynami
 
   nsCOMPtr<nsIDocShell> docShell = aWindow.get()->GetDocShell();
   if (!docShell) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   int32_t length;
-  aRv = docShell->GetChildCount(&length);
+  aRv = docShell->GetInProcessChildCount(&length);
   if (aRv.Failed()) {
     return;
   }
 
   for (int32_t i = 0; i < length; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> item;
-    docShell->GetChildAt(i, getter_AddRefs(item));
+    docShell->GetInProcessChildAt(i, getter_AddRefs(item));
     if (!item) {
       aRv.Throw(NS_ERROR_FAILURE);
       return;
     }
 
     nsCOMPtr<nsIDocShell> childDocShell(do_QueryInterface(item));
     if (!childDocShell) {
       aRv.Throw(NS_ERROR_FAILURE);
@@ -1042,23 +1042,23 @@ static void CollectedSessionStorageInter
   ReadAllEntriesFromStorage(window, aVisitedOrigins, aRetVal);
 
   /* Collect session storage from all child frame */
   nsCOMPtr<nsIDocShell> docShell = window->GetDocShell();
   if (!docShell) {
     return;
   }
   int32_t length;
-  nsresult rv = docShell->GetChildCount(&length);
+  nsresult rv = docShell->GetInProcessChildCount(&length);
   if (NS_FAILED(rv)) {
     return;
   }
   for (int32_t i = 0; i < length; ++i) {
     nsCOMPtr<nsIDocShellTreeItem> item;
-    docShell->GetChildAt(i, getter_AddRefs(item));
+    docShell->GetInProcessChildAt(i, getter_AddRefs(item));
     if (!item) {
       return;
     }
     nsCOMPtr<nsIDocShell> childDocShell(do_QueryInterface(item));
     if (!childDocShell) {
       return;
     }
     bool isDynamic = false;
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -367,17 +367,17 @@ nsresult nsTypeAheadFind::FindItNow(bool
   NS_ASSERTION(
       startingDocShell,
       "Bug 175321 Crashes with Type Ahead Find [@ nsTypeAheadFind::FindItNow]");
   if (!startingDocShell) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIDocShellTreeItem> rootContentTreeItem;
   nsCOMPtr<nsIDocShell> currentDocShell;
 
-  startingDocShell->GetSameTypeRootTreeItem(
+  startingDocShell->GetInProcessSameTypeRootTreeItem(
       getter_AddRefs(rootContentTreeItem));
   nsCOMPtr<nsIDocShell> rootContentDocShell =
       do_QueryInterface(rootContentTreeItem);
 
   if (!rootContentDocShell) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsISimpleEnumerator> docShellEnumerator;
   rootContentDocShell->GetDocShellEnumerator(
@@ -528,17 +528,17 @@ nsresult nsTypeAheadFind::FindItNow(bool
         if (fm) {
           nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
           nsresult rv = fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
           if (NS_SUCCEEDED(rv) && focusedWindow) {
             auto* fwPI = nsPIDOMWindowOuter::From(focusedWindow);
             nsCOMPtr<nsIDocShellTreeItem> fwTreeItem(fwPI->GetDocShell());
             if (NS_SUCCEEDED(rv)) {
               nsCOMPtr<nsIDocShellTreeItem> fwRootTreeItem;
-              rv = fwTreeItem->GetSameTypeRootTreeItem(
+              rv = fwTreeItem->GetInProcessSameTypeRootTreeItem(
                   getter_AddRefs(fwRootTreeItem));
               if (NS_SUCCEEDED(rv) && fwRootTreeItem == rootContentTreeItem)
                 shouldFocusEditableElement = true;
             }
           }
         }
 
         // We may be inside an editable element, and therefore the selection
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp
@@ -847,17 +847,18 @@ nsresult nsWindowWatcher::OpenWindowInte
     NS_ASSERTION(mWindowCreator,
                  "attempted to open a new window with no WindowCreator");
     rv = NS_ERROR_FAILURE;
     if (mWindowCreator) {
       nsCOMPtr<nsIWebBrowserChrome> newChrome;
 
       nsCOMPtr<nsPIDOMWindowInner> parentTopInnerWindow;
       if (parentWindow) {
-        nsCOMPtr<nsPIDOMWindowOuter> parentTopWindow = parentWindow->GetTop();
+        nsCOMPtr<nsPIDOMWindowOuter> parentTopWindow =
+            parentWindow->GetInProcessTop();
         if (parentTopWindow) {
           parentTopInnerWindow = parentTopWindow->GetCurrentInnerWindow();
         }
       }
 
       if (parentTopInnerWindow) {
         parentTopInnerWindow->Suspend();
       }
--- a/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
+++ b/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
@@ -107,33 +107,33 @@ bool AddonManagerWebAPI::IsAPIEnabled(JS
 
     if (!IsValidSite(win->GetDocumentURI())) {
       return false;
     }
 
     // Checks whether there is a parent frame of the same type. This won't cross
     // mozbrowser or chrome boundaries.
     nsCOMPtr<nsIDocShellTreeItem> parent;
-    nsresult rv = docShell->GetSameTypeParent(getter_AddRefs(parent));
+    nsresult rv = docShell->GetInProcessSameTypeParent(getter_AddRefs(parent));
     if (NS_FAILED(rv)) {
       return false;
     }
 
     if (!parent) {
       // No parent means we've hit a mozbrowser or chrome boundary so allow
       // access to the API.
       return true;
     }
 
     Document* doc = win->GetDoc();
     if (!doc) {
       return false;
     }
 
-    doc = doc->GetParentDocument();
+    doc = doc->GetInProcessParentDocument();
     if (!doc) {
       // Getting here means something has been torn down so fail safe.
       return false;
     }
 
     win = doc->GetInnerWindow();
   }
 
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -976,17 +976,17 @@ nsDocLoader::GetIsTopLevel(bool* aResult
   *aResult = false;
 
   nsCOMPtr<mozIDOMWindowProxy> window;
   GetDOMWindow(getter_AddRefs(window));
   if (window) {
     nsCOMPtr<nsPIDOMWindowOuter> piwindow = nsPIDOMWindowOuter::From(window);
     NS_ENSURE_STATE(piwindow);
 
-    nsCOMPtr<nsPIDOMWindowOuter> topWindow = piwindow->GetTop();
+    nsCOMPtr<nsPIDOMWindowOuter> topWindow = piwindow->GetInProcessTop();
     *aResult = piwindow == topWindow;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocLoader::GetIsLoadingDocument(bool* aIsLoadingDocument) {
--- a/widget/SharedWidgetUtils.cpp
+++ b/widget/SharedWidgetUtils.cpp
@@ -35,17 +35,17 @@ already_AddRefed<nsIWidget> WidgetUtils:
     while (!widget && baseWin) {
       baseWin->GetParentWidget(getter_AddRefs(widget));
       if (!widget) {
         nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(
             do_QueryInterface(baseWin));
         if (!docShellAsItem) return nullptr;
 
         nsCOMPtr<nsIDocShellTreeItem> parent;
-        docShellAsItem->GetParent(getter_AddRefs(parent));
+        docShellAsItem->GetInProcessParent(getter_AddRefs(parent));
 
         window = do_GetInterface(parent);
         if (!window) return nullptr;
 
         baseWin = do_QueryInterface(window->GetDocShell());
       }
     }
   }