Commit 3fb6190e authored by Kannan Vijayan's avatar Kannan Vijayan
Browse files

Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future...

Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future audit burndown. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D39378

--HG--
extra : moz-landing-system : lando
parent 08eecf9e
......@@ -29,7 +29,7 @@ DocAccessibleWrap::DocAccessibleWrap(Document* aDocument, PresShell* 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 ||
......
......@@ -449,7 +449,7 @@ DocAccessible* DocManager::CreateDocOrRootAccessible(Document* aDocument) {
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;
}
......
......@@ -121,7 +121,7 @@ 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;",
......@@ -182,7 +182,7 @@ static void LogDocLoadGroup(dom::Document* aDocumentNode) {
}
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",
......
......@@ -511,12 +511,13 @@ bool nsAccUtils::IsARIALive(const Accessible* aAccessible) {
}
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;
}
......
......@@ -342,7 +342,7 @@ bool nsCoreUtils::IsRootDocument(Document* aDocument) {
NS_ASSERTION(docShellTreeItem, "No document shell for document!");
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
docShellTreeItem->GetParent(getter_AddRefs(parentTreeItem));
docShellTreeItem->GetInProcessParent(getter_AddRefs(parentTreeItem));
return !parentTreeItem;
}
......@@ -358,7 +358,7 @@ 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;
......
......@@ -1077,10 +1077,11 @@ already_AddRefed<nsIPersistentProperties> Accessible::NativeAttributes() {
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);
......@@ -1788,7 +1789,7 @@ Relation Accessible::RelationByType(RelationType aType) const {
// 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,
......
......@@ -193,7 +193,7 @@ 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
......@@ -498,7 +498,7 @@ nsRect DocAccessible::RelativeBounds(nsIFrame** aRelativeFrame) const {
bounds = scrollPort;
}
document = parentDoc = document->GetParentDocument();
document = parentDoc = document->GetInProcessParentDocument();
}
return bounds;
......@@ -2276,7 +2276,7 @@ bool DocAccessible::IsLoadEventTarget() const {
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) {
......
This diff is collapsed.
......@@ -328,7 +328,7 @@ class nsDocShell final : public nsDocLoader,
// 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);
}
......@@ -934,7 +934,7 @@ class nsDocShell final : public nsDocLoader,
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
......
......@@ -122,14 +122,14 @@ nsresult nsDocShellForwardsEnumerator::BuildArrayRecursive(
}
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;
}
......@@ -148,14 +148,14 @@ nsresult nsDocShellBackwardsEnumerator::BuildArrayRecursive(
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;
}
......
......@@ -1223,7 +1223,7 @@ bool ChromeTooltipListener::WebProgressShowedTooltip(
// alive here. So we use the document hierarchy instead:
Document* document = lastUsed->GetDocument();
if (document) {
document = document->GetParentDocument();
document = document->GetInProcessParentDocument();
}
if (!document) {
break;
......
......@@ -779,12 +779,16 @@ interface nsIDocShell : nsIDocShellTreeItem
/**
* 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();
......
......@@ -11,6 +11,7 @@ interface nsIDocShellTreeOwner;
interface nsPIDOMWindowOuter;
webidl Document;
webidl BrowsingContext;
/**
* The nsIDocShellTreeItem supplies the methods that are required of any item
......@@ -53,7 +54,11 @@ interface nsIDocShellTreeItem : nsISupports
/*
Parent DocShell.
@deprecated: Use `BrowsingContext::GetParent()` instead.
(NOTE: `BrowsingContext::GetParent()` will not cross isolation boundaries)
*/
[binaryname(InProcessParent)]
readonly attribute nsIDocShellTreeItem parent;
/*
......@@ -61,12 +66,18 @@ interface nsIDocShellTreeItem : nsISupports
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;
......@@ -74,7 +85,10 @@ interface nsIDocShellTreeItem : nsISupports
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;
/*
......@@ -134,30 +148,41 @@ interface nsIDocShellTreeItem : nsISupports
/*
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);
/*
......
......@@ -385,10 +385,10 @@ nsresult nsSHistory::WalkHistoryEntries(nsISHEntry* aRootEntry,
// 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)) {
......@@ -1391,13 +1391,13 @@ nsresult nsSHistory::LoadDifferingEntries(nsISHEntry* aPrevEntry,
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());
......
......@@ -64,7 +64,7 @@ AudioChannelAgent::InitWithWeakCallback(
}
nsresult AudioChannelAgent::FindCorrectWindow(nsPIDOMWindowInner* aWindow) {
mWindow = aWindow->GetScriptableTop();
mWindow = aWindow->GetInProcessScriptableTop();
if (NS_WARN_IF(!mWindow)) {
return NS_OK;
}
......@@ -76,7 +76,7 @@ nsresult AudioChannelAgent::FindCorrectWindow(nsPIDOMWindowInner* aWindow) {
// 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;
}
......
......@@ -346,7 +346,8 @@ AudioPlaybackConfig AudioChannelService::GetMediaConfig(
config.mSuspend = window->GetMediaSuspend();
}
nsCOMPtr<nsPIDOMWindowOuter> win = window->GetScriptableParentOrNull();
nsCOMPtr<nsPIDOMWindowOuter> win =
window->GetInProcessScriptableParentOrNull();
if (!win) {
break;
}
......@@ -419,7 +420,7 @@ void AudioChannelService::RefreshAgents(
const std::function<void(AudioChannelAgent*)>& aFunc) {
MOZ_ASSERT(aWindow);
nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetInProcessScriptableTop();
if (!topWindow) {
return;
}
......@@ -458,7 +459,7 @@ void AudioChannelService::SetWindowAudioCaptured(nsPIDOMWindowOuter* aWindow,
"aCapture = %d\n",
aWindow, aCapture));
nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetInProcessScriptableTop();
if (!topWindow) {
return;
}
......@@ -515,7 +516,7 @@ AudioChannelService::AudioChannelWindow* AudioChannelService::GetWindowData(
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;
}
......@@ -546,7 +547,7 @@ void AudioChannelService::NotifyMediaResumedFromBlock(
nsPIDOMWindowOuter* aWindow) {
MOZ_ASSERT(aWindow);
nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetInProcessScriptableTop();
if (!topWindow) {
return;
}
......
......@@ -106,7 +106,7 @@ RefPtr<PerformanceInfoPromise> DocGroup::ReportPerformanceInfo() {
if (!win) {
continue;
}
top = win->GetTop();
top = win->GetInProcessTop();
if (!top) {
continue;
}
......
......@@ -2249,7 +2249,7 @@ bool Document::IsVisibleConsideringAncestors() const {
if (!parent->IsVisible()) {
return false;
}
} while ((parent = parent->GetParentDocument()));
} while ((parent = parent->GetInProcessParentDocument()));
 
return true;
}
......@@ -2478,11 +2478,12 @@ already_AddRefed<nsIPrincipal> Document::MaybeDowngradePrincipal(
 
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) {
......@@ -2822,7 +2823,7 @@ static void WarnIfSandboxIneffective(nsIDocShell* aDocShell,
!(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;
......@@ -2830,7 +2831,8 @@ static void WarnIfSandboxIneffective(nsIDocShell* aDocShell,
 
// 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;
}
......@@ -2966,7 +2968,7 @@ nsresult Document::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
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);
......@@ -3009,7 +3011,7 @@ nsresult Document::StartDocumentLoad(const char* aCommand, nsIChannel* aChannel,
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();
}
......@@ -3826,7 +3828,7 @@ bool Document::HasFocus(ErrorResult& rv) const {
 
// 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;
......@@ -4939,7 +4941,7 @@ void Document::QueryCommandValue(const nsAString& aHTMLCommandName,
}
 
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.
......@@ -7101,7 +7103,7 @@ void Document::DispatchContentLoadedEvents() {
}
}
 
parent = parent->GetParentDocument();
parent = parent->GetInProcessParentDocument();
} while (parent);
}
 
......@@ -9337,7 +9339,7 @@ nsINode* Document::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv) {
return nullptr;
}
}
} while ((doc = doc->GetParentDocument()));
} while ((doc = doc->GetInProcessParentDocument()));
 
// Remove from parent.
nsCOMPtr<nsINode> parent = adoptedNode->GetParentNode();
......@@ -11728,7 +11730,7 @@ static already_AddRefed<nsPIDOMWindowOuter> FindTopWindowForElement(
}
 
// 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();
......@@ -12921,7 +12923,7 @@ class PendingFullscreenChangeList {
}
while (docShell && docShell != mRootShellForIteration) {
nsCOMPtr<nsIDocShellTreeItem> parent;
docShell->GetParent(getter_AddRefs(parent));
docShell->GetInProcessParent(getter_AddRefs(parent));
docShell = parent.forget();
}
if (docShell) {
......@@ -13165,7 +13167,7 @@ void Document::RestorePreviousFullscreenState(UniquePtr<FullscreenExit> aExit) {
 
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 "
......@@ -13174,7 +13176,7 @@ void Document::RestorePreviousFullscreenState(UniquePtr<FullscreenExit> aExit) {
}
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();
......@@ -13194,7 +13196,7 @@ void Document::RestorePreviousFullscreenState(UniquePtr<FullscreenExit> aExit) {
}
 
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.
......@@ -13218,7 +13220,7 @@ void Document::RestorePreviousFullscreenState(UniquePtr<FullscreenExit> aExit) {
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
......@@ -13707,7 +13709,7 @@ bool Document::ApplyFullscreen(UniquePtr<FullscreenRequest> aRequest) {
if (child == fullScreenRootDoc) {
break;
}
Document* parent = child->GetParentDocument();
Document* parent = child->GetInProcessParentDocument();
Element* element = parent->FindContentForSubDocument(child);
if (parent->FullscreenStackPush(element)) {
changed.AppendElement(parent);
......@@ -13841,7 +13843,7 @@ static const char* GetPointerLockError(Element* aElement, Element* aCurrentLock,
return "PointerLockDeniedHidden";
}
 
nsCOMPtr<nsPIDOMWindowOuter> top = ownerWindow->GetScriptableTop();
nsCOMPtr<nsPIDOMWindowOuter> top = ownerWindow->GetInProcessScriptableTop();
if (!top || !top->GetExtantDoc() || top->GetExtantDoc()->Hidden()) {
return "PointerLockDeniedHidden";
}
......@@ -14322,7 +14324,7 @@ Document* Document::GetTopLevelContentDocument() {
return nullptr;
}
 
parent = parent->GetParentDocument();
parent = parent->GetInProcessParentDocument();
} while (parent);
 
return parent;
......@@ -14356,7 +14358,7 @@ const Document* Document::GetTopLevelContentDocument() const {
return nullptr;
}
 
parent = parent->GetParentDocument();
parent = parent->GetInProcessParentDocument();
} while (parent);
 
return parent;
......@@ -14750,7 +14752,7 @@ nsAutoSyncOperation::nsAutoSyncOperation(Document* aDoc) {
}
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);
}
......@@ -15175,7 +15177,7 @@ Document* Document::GetSameTypeParentDocument() {
}
 
nsCOMPtr<nsIDocShellTreeItem> parent;
current->GetSameTypeParent(getter_AddRefs(parent));
current->GetInProcessSameTypeParent(getter_AddRefs(parent));
if (!parent) {
return nullptr;
}
......@@ -15282,9 +15284,10 @@ bool Document::IsThirdPartyForFlashClassifier() {
}
 
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) {
......@@ -15292,7 +15295,7 @@ bool Document::IsThirdPartyForFlashClassifier() {
return mIsThirdPartyForFlashClassifier.value();
}
 
nsCOMPtr<Document> parentDocument = GetParentDocument();
nsCOMPtr<Document> parentDocument = GetInProcessParentDocument();
if (!parentDocument) {
// Failure
mIsThirdPartyForFlashClassifier.emplace(true);
......@@ -15355,7 +15358,7 @@ FlashClassification Document::DocumentFlashClassificationInternal() {
return classification;
}
 
Document* parentDocument = GetParentDocument();
Document* parentDocument = GetInProcessParentDocument();
if (!parentDocument) {
return FlashClassification::Denied;
}
......@@ -15503,7 +15506,7 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(