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
This commit is contained in:
Kannan Vijayan 2019-07-26 16:48:31 +00:00
Родитель 08eecf9eae
Коммит 3fb6190ec6
94 изменённых файлов: 532 добавлений и 447 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -779,7 +779,7 @@ nsDocShell::LoadURI(nsDocShellLoadState* aLoadState) {
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)) {
@ -1212,7 +1212,7 @@ bool nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
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;
@ -1852,7 +1852,7 @@ nsDocShell::GetFullscreenAllowed(bool* aFullscreenAllowed) {
// 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;
@ -2215,7 +2215,7 @@ nsresult nsDocShell::Now(DOMHighResTimeStamp* aWhen) {
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.
@ -2230,7 +2230,7 @@ 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;
@ -2244,7 +2244,7 @@ nsIDOMStorageManager* nsDocShell::TopSessionStorageManager() {
nsresult rv;
nsCOMPtr<nsIDocShellTreeItem> topItem;
rv = GetSameTypeRootTreeItem(getter_AddRefs(topItem));
rv = GetInProcessSameTypeRootTreeItem(getter_AddRefs(topItem));
if (NS_FAILED(rv)) {
return nullptr;
}
@ -2462,7 +2462,7 @@ nsDocShell::GetItemType(int32_t* aItemType) {
}
NS_IMETHODIMP
nsDocShell::GetParent(nsIDocShellTreeItem** aParent) {
nsDocShell::GetInProcessParent(nsIDocShellTreeItem** aParent) {
if (!mParent) {
*aParent = nullptr;
} else {
@ -2473,7 +2473,14 @@ nsDocShell::GetParent(nsIDocShellTreeItem** aParent) {
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>();
}
@ -2534,7 +2541,7 @@ void nsDocShell::MaybeCreateInitialClientSource(nsIPrincipal* aPrincipal) {
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;
@ -2577,7 +2584,7 @@ Maybe<ClientInfo> nsDocShell::GetInitialClientInfo() const {
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
@ -2741,7 +2748,7 @@ void nsDocShell::MaybeClearStorageAccessFlag() {
}
NS_IMETHODIMP
nsDocShell::GetSameTypeParent(nsIDocShellTreeItem** aParent) {
nsDocShell::GetInProcessSameTypeParent(nsIDocShellTreeItem** aParent) {
NS_ENSURE_ARG_POINTER(aParent);
*aParent = nullptr;
@ -2784,10 +2791,10 @@ 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);
@ -2795,17 +2802,18 @@ nsDocShell::GetRootTreeItem(nsIDocShellTreeItem** aRootTreeItem) {
}
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);
@ -2884,11 +2892,12 @@ bool nsDocShell::CanAccessItem(nsIDocShellTreeItem* aTargetItem,
}
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 =
@ -2950,7 +2959,7 @@ bool nsDocShell::CanAccessItem(nsIDocShellTreeItem* aTargetItem,
}
nsCOMPtr<nsIDocShellTreeItem> parent;
target->GetSameTypeParent(getter_AddRefs(parent));
target->GetInProcessSameTypeParent(getter_AddRefs(parent));
parent.swap(target);
} while (target);
@ -3027,12 +3036,12 @@ nsDocShell::FindItemWithName(const nsAString& aName,
// 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.
@ -3103,8 +3112,8 @@ nsresult nsDocShell::DoFindItemWithName(const nsAString& aName,
}
// 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,
@ -3151,7 +3160,7 @@ bool nsDocShell::IsSandboxedFrom(nsIDocShell* aTargetDocShell) {
// 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.
@ -3159,7 +3168,8 @@ bool nsDocShell::IsSandboxedFrom(nsIDocShell* aTargetDocShell) {
return false;
}
nsCOMPtr<nsIDocShellTreeItem> tempTreeItem;
ancestorOfTarget->GetSameTypeParent(getter_AddRefs(tempTreeItem));
ancestorOfTarget->GetInProcessSameTypeParent(
getter_AddRefs(tempTreeItem));
tempTreeItem.swap(ancestorOfTarget);
} while (ancestorOfTarget);
@ -3180,7 +3190,7 @@ bool nsDocShell::IsSandboxedFrom(nsIDocShell* aTargetDocShell) {
// 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;
}
@ -3292,7 +3302,7 @@ nsDocShell::GetIsInUnload(bool* aIsInUnload) {
}
NS_IMETHODIMP
nsDocShell::GetChildCount(int32_t* aChildCount) {
nsDocShell::GetInProcessChildCount(int32_t* aChildCount) {
NS_ENSURE_ARG_POINTER(aChildCount);
*aChildCount = mChildList.Length();
return NS_OK;
@ -3414,7 +3424,7 @@ nsDocShell::RemoveChild(nsIDocShellTreeItem* aChild) {
}
NS_IMETHODIMP
nsDocShell::GetChildAt(int32_t aIndex, nsIDocShellTreeItem** aChild) {
nsDocShell::GetInProcessChildAt(int32_t aIndex, nsIDocShellTreeItem** aChild) {
NS_ENSURE_ARG_POINTER(aChild);
#ifdef DEBUG
@ -3664,7 +3674,7 @@ nsDocShell::GetUseGlobalHistory(bool* aUseGlobalHistory) {
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;
@ -4814,7 +4824,7 @@ nsDocShell::InitSessionHistory() {
// 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;
}
@ -5327,7 +5337,7 @@ nsDocShell::GetVisibility(bool* aVisibility) {
// 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()) {
@ -5358,7 +5368,7 @@ nsDocShell::GetVisibility(bool* aVisibility) {
}
docShell = parentItem;
parentItem = docShell->GetParentDocshell();
parentItem = docShell->GetInProcessParentDocshell();
}
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin(do_QueryInterface(mTreeOwner));
@ -5406,7 +5416,7 @@ nsDocShell::SetIsActive(bool aIsActive) {
// 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();
@ -5556,7 +5566,7 @@ nsDocShell::SetMixedContentChannel(nsIChannel* aMixedContentChannel) {
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");
@ -5594,7 +5604,7 @@ nsDocShell::GetAllowMixedContentAndConnectionData(
*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!");
@ -5681,7 +5691,7 @@ nsDocShell::SetTitle(const nsAString& 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.
@ -6730,7 +6740,7 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
// 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;
}
@ -6774,7 +6784,7 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
// Parent window
nsCOMPtr<nsIDocShellTreeItem> parentItem;
GetSameTypeParent(getter_AddRefs(parentItem));
GetInProcessSameTypeParent(getter_AddRefs(parentItem));
if (!parentItem) {
return NS_OK;
}
@ -7015,7 +7025,7 @@ nsresult nsDocShell::EnsureContentViewer() {
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();
@ -7266,7 +7276,7 @@ bool nsDocShell::CanSavePresentation(uint32_t aLoadType,
// 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
}
@ -7902,7 +7912,7 @@ nsresult nsDocShell::RestoreFromHistory() {
}
if (document) {
RefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
if (parent) {
RefPtr<Document> d = parent->GetDocument();
if (d) {
@ -8314,7 +8324,7 @@ nsresult nsDocShell::CreateContentViewer(const nsACString& aContentType,
RefPtr<Document> newDoc = viewer->GetDocument();
RefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
nsCOMPtr<nsIPrincipal> parentPrincipal =
parent->GetDocument()->NodePrincipal();
nsCOMPtr<nsIPrincipal> thisPrincipal = newDoc->NodePrincipal();
@ -8445,7 +8455,7 @@ nsresult nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer) {
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));
@ -8642,7 +8652,7 @@ nsresult nsDocShell::CheckLoadingPermissions() {
}
nsCOMPtr<nsIDocShellTreeItem> tmp;
item->GetSameTypeParent(getter_AddRefs(tmp));
item->GetInProcessSameTypeParent(getter_AddRefs(tmp));
item.swap(tmp);
} while (item);
@ -9440,7 +9450,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
// 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) {
@ -9628,7 +9638,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
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);
@ -9781,7 +9791,7 @@ nsIPrincipal* nsDocShell::GetInheritedPrincipal(
if (!document) {
nsCOMPtr<nsIDocShellTreeItem> parentItem;
GetSameTypeParent(getter_AddRefs(parentItem));
GetInProcessSameTypeParent(getter_AddRefs(parentItem));
if (parentItem) {
document = parentItem->GetDocument();
}
@ -11575,7 +11585,7 @@ nsresult nsDocShell::AddToSessionHistory(
// 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
@ -11969,7 +11979,7 @@ void nsDocShell::SetHistoryEntry(nsCOMPtr<nsISHEntry>* aPtr,
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};
@ -11991,7 +12001,7 @@ void nsDocShell::SetHistoryEntry(nsCOMPtr<nsISHEntry>* aPtr,
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;
}
@ -12503,7 +12513,7 @@ NS_IMETHODIMP
nsDocShell::GetTopWindow(mozIDOMWindowProxy** aWindow) {
nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow();
if (win) {
win = win->GetTop();
win = win->GetInProcessTop();
}
win.forget(aWindow);
return NS_OK;
@ -12517,7 +12527,7 @@ nsDocShell::GetTopFrameElement(Element** aElement) {
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
@ -12546,7 +12556,7 @@ nsDocShell::GetUseTrackingProtection(bool* aUseTrackingProtection) {
return NS_OK;
}
RefPtr<nsDocShell> parent = GetParentDocshell();
RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
if (parent) {
return parent->GetUseTrackingProtection(aUseTrackingProtection);
}
@ -13175,7 +13185,7 @@ uint32_t nsDocShell::GetInheritedFrameType() {
}
nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
GetSameTypeParent(getter_AddRefs(parentAsItem));
GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
nsCOMPtr<nsIDocShell> parent = do_QueryInterface(parentAsItem);
if (!parent) {
@ -13219,7 +13229,7 @@ NS_IMETHODIMP nsDocShell::GetIsTopLevelContentDocShell(
if (mItemType == typeContent) {
nsCOMPtr<nsIDocShellTreeItem> root;
GetSameTypeRootTreeItem(getter_AddRefs(root));
GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
*aIsTopLevelContentDocShell =
root.get() == static_cast<nsIDocShellTreeItem*>(this);
}
@ -13279,7 +13289,7 @@ bool nsDocShell::ServiceWorkerAllowedToControlWindow(nsIPrincipal* aPrincipal,
}
nsCOMPtr<nsIDocShellTreeItem> parent;
GetSameTypeParent(getter_AddRefs(parent));
GetInProcessSameTypeParent(getter_AddRefs(parent));
nsPIDOMWindowOuter* parentOuter = parent ? parent->GetWindow() : nullptr;
nsPIDOMWindowInner* parentInner =
parentOuter ? parentOuter->GetCurrentInnerWindow() : nullptr;
@ -13403,14 +13413,14 @@ nsDocShell::GetAsyncPanZoomEnabled(bool* aOut) {
}
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;
}
@ -13519,7 +13529,7 @@ bool nsDocShell::InFrameSwap() {
if (shell->mInFrameSwap) {
return true;
}
shell = shell->GetParentDocshell();
shell = shell->GetInProcessParentDocshell();
} while (shell);
return false;
}
@ -13574,7 +13584,7 @@ nsDocShell::GetIsOnlyToplevelInTabGroup(bool* aResult) {
// 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;
}

Просмотреть файл

@ -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(
}
// 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();

Просмотреть файл

@ -1447,7 +1447,7 @@ class Document : public nsINode,
* 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.
@ -3864,8 +3864,8 @@ class Document : public nsINode,
* up-to-date layout information.
*/
bool StyleOrLayoutObservablyDependsOnParentDocumentLayout() const {
return GetParentDocument() &&
GetDocGroup() == GetParentDocument()->GetDocGroup();
return GetInProcessParentDocument() &&
GetDocGroup() == GetInProcessParentDocument()->GetDocGroup();
}
void AddIntersectionObserver(DOMIntersectionObserver* aObserver) {

Просмотреть файл

@ -78,7 +78,7 @@ PostMessageEvent::Run() {
// 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() &&

Просмотреть файл

@ -260,10 +260,11 @@ static inline void AbortOrientationPromises(nsIDocShell* aDocShell) {
}
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);
@ -313,7 +314,7 @@ already_AddRefed<Promise> ScreenOrientation::LockInternal(
}
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);

Просмотреть файл

@ -215,7 +215,7 @@ nsresult TabGroup::FindItemWithName(const nsAString& aName,
for (nsPIDOMWindowOuter* outerWindow : mWindows) {
// Ignore non-toplevel windows
if (outerWindow->GetScriptableParentOrNull()) {
if (outerWindow->GetInProcessScriptableParentOrNull()) {
continue;
}
@ -230,7 +230,7 @@ nsresult TabGroup::FindItemWithName(const nsAString& aName,
}
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,
@ -250,7 +250,7 @@ nsTArray<nsPIDOMWindowOuter*> TabGroup::GetTopLevelWindows() const {
for (nsPIDOMWindowOuter* outerWindow : mWindows) {
if (outerWindow->GetDocShell() &&
!outerWindow->GetScriptableParentOrNull()) {
!outerWindow->GetInProcessScriptableParentOrNull()) {
array.AppendElement(outerWindow);
}
}

Просмотреть файл

@ -197,9 +197,9 @@ ThirdPartyUtil::IsThirdPartyWindow(mozIDOMWindowProxy* aWindow, nsIURI* aURI,
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

Просмотреть файл

@ -257,10 +257,10 @@ void MarkDocShell(nsIDocShellTreeItem* aNode, bool 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);
}
}

Просмотреть файл

@ -515,7 +515,7 @@ nsContentPermissionRequester::GetOnVisibilityChange(
static nsIPrincipal* GetTopLevelPrincipal(nsPIDOMWindowInner* aWindow) {
MOZ_ASSERT(aWindow);
nsPIDOMWindowOuter* top = aWindow->GetScriptableTop();
nsPIDOMWindowOuter* top = aWindow->GetInProcessScriptableTop();
if (!top) {
return nullptr;
}

Просмотреть файл

@ -2184,7 +2184,7 @@ nsINode* nsContentUtils::GetCrossDocParentNode(nsINode* aChild) {
}
Document* doc = aChild->AsDocument();
Document* parentDoc = doc->GetParentDocument();
Document* parentDoc = doc->GetInProcessParentDocument();
return parentDoc ? parentDoc->FindContentForSubDocument(doc) : nullptr;
}
@ -3767,7 +3767,7 @@ 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;
}
@ -5420,7 +5420,7 @@ bool nsContentUtils::CheckForSubFrameDrop(nsIDragSession* aDragSession,
// 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;
@ -6052,10 +6052,11 @@ void nsContentUtils::FlushLayoutForTree(nsPIDOMWindowOuter* aWindow) {
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);
}
@ -6131,7 +6132,7 @@ PresShell* nsContentUtils::FindPresShellForDocument(const Document* aDocument) {
return presShell;
}
nsCOMPtr<nsIDocShellTreeItem> parent;
docShellTreeItem->GetParent(getter_AddRefs(parent));
docShellTreeItem->GetInProcessParent(getter_AddRefs(parent));
docShellTreeItem = parent;
}
@ -6517,8 +6518,8 @@ Document* nsContentUtils::GetRootDocument(Document* aDoc) {
return nullptr;
}
Document* doc = aDoc;
while (doc->GetParentDocument()) {
doc = doc->GetParentDocument();
while (doc->GetInProcessParentDocument()) {
doc = doc->GetInProcessParentDocument();
}
return doc;
}
@ -6536,8 +6537,8 @@ bool nsContentUtils::IsInPointerLockContext(nsPIDOMWindowOuter* aWin) {
}
nsCOMPtr<nsPIDOMWindowOuter> lockTop =
pointerLockedDoc->GetWindow()->GetScriptableTop();
nsCOMPtr<nsPIDOMWindowOuter> top = aWin->GetScriptableTop();
pointerLockedDoc->GetWindow()->GetInProcessScriptableTop();
nsCOMPtr<nsPIDOMWindowOuter> top = aWin->GetInProcessScriptableTop();
return top == lockTop;
}
@ -6933,7 +6934,7 @@ bool nsContentUtils::PrefetchPreloadEnabled(nsIDocShell* aDocShell) {
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) {
@ -7814,11 +7815,11 @@ void nsContentUtils::FirePageHideEvent(nsIDocShellTreeItem* aItem,
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) {
@ -7838,11 +7839,11 @@ void nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem,
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) {
@ -8754,7 +8755,7 @@ void nsContentUtils::GetPresentationURL(nsIDocShell* aDocShell,
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()) {
@ -9595,7 +9596,7 @@ bool nsContentUtils::ShouldBlockReservedKeys(WidgetKeyboardEvent* aKeyEvent) {
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();
}

Просмотреть файл

@ -535,7 +535,8 @@ bool nsDOMNavigationTiming::IsTopLevelContentDocumentInContentProcess() const {
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;
}

Просмотреть файл

@ -973,7 +973,7 @@ nsFocusManager::WindowHidden(mozIDOMWindowProxy* aWindow) {
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);
@ -1188,7 +1188,7 @@ void nsFocusManager::SetFocusInner(Element* aNewContent, int32_t aFlags,
if (beingDestroyed) return;
nsCOMPtr<nsIDocShellTreeItem> parentDsti;
docShell->GetParent(getter_AddRefs(parentDsti));
docShell->GetInProcessParent(getter_AddRefs(parentDsti));
docShell = do_QueryInterface(parentDsti);
}
@ -1358,7 +1358,7 @@ bool nsFocusManager::IsSameOrAncestor(nsPIDOMWindowOuter* aPossibleAncestor,
while (dsti) {
if (dsti == ancestordsti) return true;
nsCOMPtr<nsIDocShellTreeItem> parentDsti;
dsti->GetParent(getter_AddRefs(parentDsti));
dsti->GetInProcessParent(getter_AddRefs(parentDsti));
dsti.swap(parentDsti);
}
@ -1379,13 +1379,13 @@ already_AddRefed<nsPIDOMWindowOuter> nsFocusManager::GetCommonAncestor(
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);
@ -1419,7 +1419,7 @@ void nsFocusManager::AdjustWindowFocus(nsPIDOMWindowOuter* aWindow,
nsCOMPtr<nsIDocShellTreeItem> dsti = window->GetDocShell();
if (!dsti) return;
nsCOMPtr<nsIDocShellTreeItem> parentDsti;
dsti->GetParent(getter_AddRefs(parentDsti));
dsti->GetInProcessParent(getter_AddRefs(parentDsti));
if (!parentDsti) {
return;
}
@ -4020,7 +4020,7 @@ void nsFocusManager::SetFocusedWindowInternal(nsPIDOMWindowOuter* aWindow) {
if (aWindow && aWindow != mFocusedWindow) {
const TimeStamp now(TimeStamp::Now());
for (Document* doc = aWindow->GetExtantDoc(); doc;
doc = doc->GetParentDocument()) {
doc = doc->GetInProcessParentDocument()) {
doc->SetLastFocusTime(now);
}
}

Просмотреть файл

@ -732,10 +732,10 @@ static void SetTreeOwnerAndChromeEventHandlerOnDocshellTree(
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);
@ -763,7 +763,7 @@ static bool CheckDocShellType(mozilla::dom::Element* aOwnerContent,
}
nsCOMPtr<nsIDocShellTreeItem> parent;
aDocShell->GetParent(getter_AddRefs(parent));
aDocShell->GetInProcessParent(getter_AddRefs(parent));
return parent && parent->ItemType() == aDocShell->ItemType();
}
@ -798,11 +798,11 @@ void nsFrameLoader::AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem,
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;
@ -1441,8 +1441,10 @@ nsresult nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
// 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);
@ -1486,8 +1488,8 @@ nsresult nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
// 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;
}
@ -1526,9 +1528,10 @@ nsresult nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
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();
@ -1791,7 +1794,7 @@ void nsFrameLoader::StartDestroy() {
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());
@ -2183,7 +2186,7 @@ nsresult nsFrameLoader::MaybeCreateDocShell() {
docShell->SetFrameType(nsIDocShell::FRAME_TYPE_BROWSER);
} else {
nsCOMPtr<nsIDocShellTreeItem> parentCheck;
docShell->GetSameTypeParent(getter_AddRefs(parentCheck));
docShell->GetInProcessSameTypeParent(getter_AddRefs(parentCheck));
if (!!parentCheck) {
docShell->SetIsFrame();
}
@ -2339,7 +2342,7 @@ nsresult nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI) {
// 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;
@ -2353,7 +2356,7 @@ nsresult nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI) {
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.
@ -2371,7 +2374,7 @@ nsresult nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI) {
}
}
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));
@ -2398,7 +2401,7 @@ nsresult nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI) {
}
nsCOMPtr<nsIDocShellTreeItem> temp;
temp.swap(parentAsItem);
temp->GetSameTypeParent(getter_AddRefs(parentAsItem));
temp->GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
}
return NS_OK;
@ -3101,7 +3104,7 @@ void nsFrameLoader::AttributeChanged(mozilla::dom::Element* aElement,
}
nsCOMPtr<nsIDocShellTreeItem> parentItem;
GetDocShell()->GetParent(getter_AddRefs(parentItem));
GetDocShell()->GetInProcessParent(getter_AddRefs(parentItem));
if (!parentItem) {
return;
}

Просмотреть файл

@ -1843,7 +1843,7 @@ void nsGlobalWindowInner::UpdateParentTarget() {
nsContentUtils::TryGetBrowserChildGlobal(frameElement);
if (!eventTarget) {
nsGlobalWindowOuter* topWin = GetScriptableTopInternal();
nsGlobalWindowOuter* topWin = GetInProcessScriptableTopInternal();
if (topWin) {
frameElement = topWin->GetFrameElementInternal();
eventTarget = nsContentUtils::TryGetBrowserChildGlobal(frameElement);
@ -1897,10 +1897,10 @@ void nsGlobalWindowInner::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
}
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;
@ -2087,7 +2087,7 @@ nsIPrincipal* nsGlobalWindowInner::GetPrincipal() {
// a document into the window.
nsCOMPtr<nsIScriptObjectPrincipal> objPrincipal =
do_QueryInterface(GetParentInternal());
do_QueryInterface(GetInProcessParentInternal());
if (objPrincipal) {
return objPrincipal->GetPrincipal();
@ -2110,7 +2110,7 @@ nsIPrincipal* nsGlobalWindowInner::GetEffectiveStoragePrincipal() {
// the parent window for the storage principal.
nsCOMPtr<nsIScriptObjectPrincipal> objPrincipal =
do_QueryInterface(GetParentInternal());
do_QueryInterface(GetInProcessParentInternal());
if (objPrincipal) {
return objPrincipal->GetEffectiveStoragePrincipal();
@ -2281,7 +2281,7 @@ bool nsGlobalWindowInner::ShouldReportForServiceWorkerScope(
const nsAString& aScope) {
bool result = false;
nsPIDOMWindowOuter* topOuter = GetScriptableTop();
nsPIDOMWindowOuter* topOuter = GetInProcessScriptableTop();
NS_ENSURE_TRUE(topOuter, false);
nsGlobalWindowInner* topInner =
@ -2480,7 +2480,8 @@ void nsPIDOMWindowInner::TryToCacheTopInnerWindow() {
MOZ_ASSERT(window);
if (nsCOMPtr<nsPIDOMWindowOuter> topOutter = window->GetScriptableTop()) {
if (nsCOMPtr<nsPIDOMWindowOuter> topOutter =
window->GetInProcessScriptableTop()) {
mTopInnerWindow = topOutter->GetCurrentInnerWindow();
}
}
@ -2625,25 +2626,26 @@ Nullable<WindowProxyHolder> nsGlobalWindowInner::GetParent(
}
/**
* 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,
@ -5397,14 +5399,14 @@ nsGlobalWindowInner::CallState nsGlobalWindowInner::CallOnChildren(
}
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);
}
@ -5566,14 +5568,14 @@ nsresult nsGlobalWindowInner::FireDelayedDOMEvents() {
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);
}
@ -5594,13 +5596,13 @@ nsresult nsGlobalWindowInner::FireDelayedDOMEvents() {
// 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() {
@ -5609,7 +5611,7 @@ nsIPrincipal* nsGlobalWindowInner::GetTopLevelPrincipal() {
return nullptr;
}
nsPIDOMWindowOuter* topLevelOuterWindow = GetTopInternal();
nsPIDOMWindowOuter* topLevelOuterWindow = GetInProcessTopInternal();
if (!topLevelOuterWindow) {
return nullptr;
}
@ -5640,7 +5642,7 @@ nsIPrincipal* nsGlobalWindowInner::GetTopLevelStorageAreaPrincipal() {
return nullptr;
}
nsPIDOMWindowOuter* outerWindow = GetParentInternal();
nsPIDOMWindowOuter* outerWindow = GetInProcessParentInternal();
if (!outerWindow) {
// No outer window available!
return nullptr;

Просмотреть файл

@ -409,10 +409,10 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
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);
@ -631,7 +631,7 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
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;
@ -1037,7 +1037,7 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
nsresult DefineArgumentsProperty(nsIArray* aArguments);
// Get the parent, returns null if this is a toplevel window
nsPIDOMWindowOuter* GetParentInternal();
nsPIDOMWindowOuter* GetInProcessParentInternal();
public:
// popup tracking
@ -1498,17 +1498,18 @@ 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);
}
@ -1534,7 +1535,7 @@ inline bool nsGlobalWindowInner::IsPopupSpamWindow() {
}
inline bool nsGlobalWindowInner::IsFrame() {
return GetParentInternal() != nullptr;
return GetInProcessParentInternal() != nullptr;
}
#endif /* nsGlobalWindowInner_h___ */

Просмотреть файл

@ -1642,17 +1642,17 @@ bool nsGlobalWindowOuter::ComputeIsSecureContext(Document* aDocument,
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
}
@ -1795,7 +1795,7 @@ static JS::RealmCreationOptions& SelectZone(
}
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
@ -2405,13 +2405,14 @@ void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) {
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.
@ -2425,7 +2426,7 @@ void nsGlobalWindowOuter::SetDocShell(nsDocShell* aDocShell) {
// 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 {
@ -2587,7 +2588,7 @@ void nsGlobalWindowOuter::UpdateParentTarget() {
mMessageManager = nsContentUtils::TryGetBrowserChildGlobal(frameElement);
if (!mMessageManager) {
nsGlobalWindowOuter* topWin = GetScriptableTopInternal();
nsGlobalWindowOuter* topWin = GetInProcessScriptableTopInternal();
if (topWin) {
frameElement = topWin->GetFrameElementInternal();
mMessageManager = nsContentUtils::TryGetBrowserChildGlobal(frameElement);
@ -2615,7 +2616,7 @@ void nsGlobalWindowOuter::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
}
bool nsGlobalWindowOuter::ShouldPromptToBlockDialogs() {
nsGlobalWindowOuter* topWindowOuter = GetScriptableTopInternal();
nsGlobalWindowOuter* topWindowOuter = GetInProcessScriptableTopInternal();
if (!topWindowOuter) {
NS_ASSERTION(!mDocShell,
"ShouldPromptToBlockDialogs() called without a top window?");
@ -2632,7 +2633,7 @@ bool nsGlobalWindowOuter::ShouldPromptToBlockDialogs() {
}
bool nsGlobalWindowOuter::AreDialogsEnabled() {
nsGlobalWindowOuter* topWindowOuter = GetScriptableTopInternal();
nsGlobalWindowOuter* topWindowOuter = GetInProcessScriptableTopInternal();
if (!topWindowOuter) {
NS_ERROR("AreDialogsEnabled() called without a top window?");
return false;
@ -2700,7 +2701,7 @@ bool nsGlobalWindowOuter::ConfirmDialogIfNeeded() {
}
void nsGlobalWindowOuter::DisableDialogs() {
nsGlobalWindowOuter* topWindowOuter = GetScriptableTopInternal();
nsGlobalWindowOuter* topWindowOuter = GetInProcessScriptableTopInternal();
if (!topWindowOuter) {
NS_ERROR("DisableDialogs() called without a top window?");
return;
@ -2715,7 +2716,7 @@ void nsGlobalWindowOuter::DisableDialogs() {
}
void nsGlobalWindowOuter::EnableDialogs() {
nsGlobalWindowOuter* topWindowOuter = GetScriptableTopInternal();
nsGlobalWindowOuter* topWindowOuter = GetInProcessScriptableTopInternal();
if (!topWindowOuter) {
NS_ERROR("EnableDialogs() called without a top window?");
return;
@ -2784,7 +2785,7 @@ nsIPrincipal* nsGlobalWindowOuter::GetPrincipal() {
// a document into the window.
nsCOMPtr<nsIScriptObjectPrincipal> objPrincipal =
do_QueryInterface(GetParentInternal());
do_QueryInterface(GetInProcessParentInternal());
if (objPrincipal) {
return objPrincipal->GetPrincipal();
@ -2807,7 +2808,7 @@ nsIPrincipal* nsGlobalWindowOuter::GetEffectiveStoragePrincipal() {
// the parent window for the storage principal.
nsCOMPtr<nsIScriptObjectPrincipal> objPrincipal =
do_QueryInterface(GetParentInternal());
do_QueryInterface(GetInProcessParentInternal());
if (objPrincipal) {
return objPrincipal->GetEffectiveStoragePrincipal();
@ -2951,7 +2952,7 @@ void nsPIDOMWindowOuter::SetServiceWorkersTestingEnabled(bool aEnabled) {
// 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;
@ -2960,7 +2961,7 @@ void nsPIDOMWindowOuter::SetServiceWorkersTestingEnabled(bool 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;
}
@ -2973,13 +2974,13 @@ Nullable<WindowProxyHolder> nsGlobalWindowOuter::GetParentOuter() {
}
/**
* 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;
}
@ -2988,16 +2989,16 @@ nsPIDOMWindowOuter* nsGlobalWindowOuter::GetScriptableParent() {
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;
}
@ -3005,7 +3006,7 @@ nsPIDOMWindowOuter* nsGlobalWindowOuter::GetScriptableParentOrNull() {
* 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;
}
@ -3041,9 +3042,9 @@ static nsresult GetTopImpl(nsGlobalWindowOuter* aWin, nsIURI* aURIBeingLoaded,
prevParent = parent;
if (aScriptable) {
parent = parent->GetScriptableParent();
parent = parent->GetInProcessScriptableParent();
} else {
parent = parent->GetParent();
parent = parent->GetInProcessParent();
}
if (aExcludingExtensionAccessibleContentFrames) {
@ -3093,13 +3094,14 @@ static nsresult GetTopImpl(nsGlobalWindowOuter* aWin, nsIURI* aURIBeingLoaded,
}
/**
* 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,
@ -3107,7 +3109,7 @@ nsPIDOMWindowOuter* nsGlobalWindowOuter::GetScriptableTop() {
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,
@ -3161,7 +3163,7 @@ already_AddRefed<nsPIDOMWindowOuter> nsGlobalWindowOuter::GetContentInternal(
// 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();
}
@ -3181,7 +3183,8 @@ already_AddRefed<nsPIDOMWindowOuter> nsGlobalWindowOuter::GetContentInternal(
baseWin->GetVisibility(&visible);
if (!visible) {
mDocShell->GetSameTypeRootTreeItem(getter_AddRefs(primaryContent));
mDocShell->GetInProcessSameTypeRootTreeItem(
getter_AddRefs(primaryContent));
}
}
}
@ -4464,7 +4467,8 @@ 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);
@ -4946,7 +4950,7 @@ void nsGlobalWindowOuter::FocusOuter() {
// 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 =
@ -5620,7 +5624,7 @@ bool nsGlobalWindowOuter::PopupWhitelisted() {
return true;
}
nsCOMPtr<nsPIDOMWindowOuter> parent = GetParent();
nsCOMPtr<nsPIDOMWindowOuter> parent = GetInProcessParent();
if (parent == this) {
return false;
}
@ -5687,7 +5691,7 @@ void nsGlobalWindowOuter::FireAbuseEvents(
const nsAString& aPopupWindowFeatures) {
// fetch the URI of the window requesting the opened window
nsCOMPtr<nsPIDOMWindowOuter> window = GetTop();
nsCOMPtr<nsPIDOMWindowOuter> window = GetInProcessTop();
if (!window) {
return;
}
@ -6372,9 +6376,9 @@ void nsGlobalWindowOuter::ReallyCloseWindow() {
}
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?");
@ -6437,7 +6441,7 @@ void nsGlobalWindowOuter::EnterModalState() {
}
void nsGlobalWindowOuter::LeaveModalState() {
nsGlobalWindowOuter* topWin = GetScriptableTopInternal();
nsGlobalWindowOuter* topWin = GetInProcessScriptableTopInternal();
if (!topWin) {
NS_ERROR("Uh, LeaveModalState() called w/o a reachable top window?");
@ -6479,7 +6483,7 @@ void nsGlobalWindowOuter::LeaveModalState() {
}
bool nsGlobalWindowOuter::IsInModalState() {
nsGlobalWindowOuter* topWin = GetScriptableTopInternal();
nsGlobalWindowOuter* topWin = GetInProcessScriptableTopInternal();
if (!topWin) {
// IsInModalState() getting called w/o a reachable top window is a bit
@ -6718,7 +6722,7 @@ EventListenerManager* nsGlobalWindowOuter::GetExistingListenerManager() const {
//*****************************************************************************
nsPIDOMWindowOuter* nsGlobalWindowOuter::GetPrivateParent() {
nsCOMPtr<nsPIDOMWindowOuter> parent = GetParent();
nsCOMPtr<nsPIDOMWindowOuter> parent = GetInProcessParent();
if (this == parent) {
nsCOMPtr<nsIContent> chromeElement(do_QueryInterface(mChromeEventHandler));
@ -6735,7 +6739,7 @@ nsPIDOMWindowOuter* nsGlobalWindowOuter::GetPrivateParent() {
}
nsPIDOMWindowOuter* nsGlobalWindowOuter::GetPrivateRoot() {
nsCOMPtr<nsPIDOMWindowOuter> top = GetTop();
nsCOMPtr<nsPIDOMWindowOuter> top = GetInProcessTop();
nsCOMPtr<nsIContent> chromeElement(do_QueryInterface(mChromeEventHandler));
if (chromeElement) {
@ -6743,7 +6747,7 @@ nsPIDOMWindowOuter* nsGlobalWindowOuter::GetPrivateRoot() {
if (doc) {
nsCOMPtr<nsPIDOMWindowOuter> parent = doc->GetWindow();
if (parent) {
top = parent->GetTop();
top = parent->GetInProcessTop();
}
}
}
@ -7080,8 +7084,8 @@ nsresult nsGlobalWindowOuter::FireDelayedDOMEvents() {
// nsGlobalWindowOuter: Window Control Functions
//*****************************************************************************
nsPIDOMWindowOuter* nsGlobalWindowOuter::GetParentInternal() {
nsCOMPtr<nsPIDOMWindowOuter> parent = GetParent();
nsPIDOMWindowOuter* nsGlobalWindowOuter::GetInProcessParentInternal() {
nsCOMPtr<nsPIDOMWindowOuter> parent = GetInProcessParent();
if (parent && parent != this) {
return parent;
@ -7444,7 +7448,7 @@ void nsGlobalWindowOuter::EnsureSizeAndPositionUpToDate() {
// 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);
}
}
@ -7723,7 +7727,7 @@ mozilla::dom::TabGroup* nsGlobalWindowOuter::TabGroupOuter() {
// 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");
@ -7758,7 +7762,7 @@ mozilla::dom::TabGroup* nsGlobalWindowOuter::TabGroupOuter() {
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);
@ -7805,7 +7809,8 @@ nsGlobalWindowOuter::TemporarilyDisableDialogs::TemporarilyDisableDialogs(
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 "

Просмотреть файл

@ -359,17 +359,17 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
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);
@ -555,9 +555,9 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
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(
@ -747,7 +747,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
static nsGlobalWindowInner* CallerInnerWindow(JSContext* aCx);
// Get the parent, returns null if this is a toplevel window
nsPIDOMWindowOuter* GetParentInternal();
nsPIDOMWindowOuter* GetInProcessParentInternal();
public:
// popup tracking
@ -1176,16 +1176,17 @@ 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);
}
@ -1203,14 +1204,14 @@ inline nsGlobalWindowInner* nsGlobalWindowOuter::EnsureInnerWindowInternal() {
}
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(

Просмотреть файл

@ -296,7 +296,7 @@ already_AddRefed<ChildSHistory> nsHistory::GetSessionHistory() const {
// 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);

Просмотреть файл

@ -1954,7 +1954,7 @@ void nsJSContext::MaybeRunNextCollectorSlice(nsIDocShell* aDocShell,
}
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;

Просмотреть файл

@ -3051,7 +3051,7 @@ bool nsObjectLoadingContent::ShouldPlay(FallbackType& aReason) {
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);

Просмотреть файл

@ -348,8 +348,8 @@ class nsPIDOMWindowInner : public mozIDOMWindow {
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 {
@ -778,24 +778,25 @@ class nsPIDOMWindowOuter : public mozIDOMWindowProxy {
* 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;

Просмотреть файл

@ -204,7 +204,7 @@ static void UpdateDocShellOrientationLock(nsPIDOMWindowInner* aWindow,
}
nsCOMPtr<nsIDocShellTreeItem> root;
docShell->GetSameTypeRootTreeItem(getter_AddRefs(root));
docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(root));
nsCOMPtr<nsIDocShell> rootShell(do_QueryInterface(root));
if (!rootShell) {
return;

Просмотреть файл

@ -224,14 +224,15 @@ static void CollectWindowReports(nsGlobalWindowInner* aWindow,
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);
}
@ -816,10 +817,10 @@ void nsWindowMemoryReporter::CheckForGhostWindows(
// 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;
}
@ -844,12 +845,12 @@ void nsWindowMemoryReporter::CheckForGhostWindows(
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) {

Просмотреть файл

@ -227,11 +227,11 @@ BrowserElementParent::OpenWindowInProcess(BrowsingContext* aOpenerWindow,
// 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);

Просмотреть файл

@ -460,8 +460,9 @@ nsresult EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
Document* doc = node->OwnerDoc();
while (doc) {
doc->SetUserHasInteracted();
doc = nsContentUtils::IsChildOfSameType(doc) ? doc->GetParentDocument()
: nullptr;
doc = nsContentUtils::IsChildOfSameType(doc)
? doc->GetInProcessParentDocument()
: nullptr;
}
}
}
@ -1140,11 +1141,11 @@ bool EventStateManager::WalkESMTreeToHandleAccessKey(
}
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;
@ -1180,7 +1181,7 @@ bool EventStateManager::WalkESMTreeToHandleAccessKey(
// 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
@ -3253,8 +3254,8 @@ nsresult EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
!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)) {
@ -4389,7 +4390,7 @@ void EventStateManager::NotifyMouseOver(WidgetMouseEvent* aMouseEvent,
// 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()) {

Просмотреть файл

@ -1207,8 +1207,8 @@ nsresult HTMLCanvasElement::RegisterFrameCaptureListener(
return NS_ERROR_FAILURE;
}
while (doc->GetParentDocument()) {
doc = doc->GetParentDocument();
while (doc->GetInProcessParentDocument()) {
doc = doc->GetInProcessParentDocument();
}
nsPresContext* context = doc->GetPresContext();

Просмотреть файл

@ -739,7 +739,7 @@ nsresult HTMLFormElement::DoSecureToInsecureSubmitCheck(nsIURI* aActionURL,
// 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;

Просмотреть файл

@ -6691,7 +6691,8 @@ already_AddRefed<nsIPrincipal> HTMLMediaElement::GetTopLevelPrincipal() {
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;
}

Просмотреть файл

@ -537,7 +537,7 @@ nsresult nsHTMLDocument::StartDocumentLoad(const char* aCommand,
// and parentContentViewer
nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
if (docShell) {
docShell->GetSameTypeParent(getter_AddRefs(parentAsItem));
docShell->GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
}
nsCOMPtr<nsIDocShell> parent(do_QueryInterface(parentAsItem));

Просмотреть файл

@ -1015,7 +1015,7 @@ nsresult ContentChild::ProvideWindowCommon(
nsCOMPtr<nsPIDOMWindowInner> parentTopInnerWindow;
if (aParent) {
nsCOMPtr<nsPIDOMWindowOuter> parentTopWindow =
nsPIDOMWindowOuter::From(aParent)->GetTop();
nsPIDOMWindowOuter::From(aParent)->GetInProcessTop();
if (parentTopWindow) {
parentTopInnerWindow = parentTopWindow->GetCurrentInnerWindow();
}

Просмотреть файл

@ -594,7 +594,8 @@ nsJSChannel::AsyncOpen(nsIStreamListener* aListener) {
nsLoadFlags loadFlags;
mStreamChannel->GetLoadFlags(&loadFlags);
if (loadFlags & LOAD_DOCUMENT_URI) {
mDocumentOnloadBlockedOn = mDocumentOnloadBlockedOn->GetParentDocument();
mDocumentOnloadBlockedOn =
mDocumentOnloadBlockedOn->GetInProcessParentDocument();
}
}
if (mDocumentOnloadBlockedOn) {

Просмотреть файл

@ -40,7 +40,7 @@ static Document* ApproverDocOf(const Document& aDocument) {
}
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
ds->GetSameTypeRootTreeItem(getter_AddRefs(rootTreeItem));
ds->GetInProcessSameTypeRootTreeItem(getter_AddRefs(rootTreeItem));
if (!rootTreeItem) {
return nullptr;
}

Просмотреть файл

@ -142,7 +142,7 @@ BackgroundVideoDecodingPermissionObserver::GetOwnerWindow() const {
return nullptr;
}
nsCOMPtr<nsPIDOMWindowOuter> topWin = outerWin->GetTop();
nsCOMPtr<nsPIDOMWindowOuter> topWin = outerWin->GetInProcessTop();
return topWin.forget();
}
@ -166,7 +166,7 @@ bool BackgroundVideoDecodingPermissionObserver::IsValidEventSender(
return false;
}
nsCOMPtr<nsPIDOMWindowOuter> senderTop = senderOuter->GetTop();
nsCOMPtr<nsPIDOMWindowOuter> senderTop = senderOuter->GetInProcessTop();
if (!senderTop) {
return false;
}

Просмотреть файл

@ -3929,10 +3929,10 @@ void MediaManager::IterateWindowListeners(nsPIDOMWindowInner* aWindow,
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;

Просмотреть файл

@ -421,7 +421,8 @@ already_AddRefed<DetailedPromise> MediaKeys::Init(ErrorResult& aRv) {
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,

Просмотреть файл

@ -1128,12 +1128,12 @@ bool PaymentRequest::InFullyActiveDocument() {
// 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;
}

Просмотреть файл

@ -500,7 +500,8 @@ nsresult PaymentRequestManager::CreatePayment(
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();

Просмотреть файл

@ -623,7 +623,8 @@ bool PerformanceTiming::IsTopLevelContentDocument() const {
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;
}

Просмотреть файл

@ -2813,7 +2813,8 @@ NS_IMETHODIMP nsPluginInstanceOwner::CreateWidget(void) {
// 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

Просмотреть файл

@ -469,7 +469,7 @@ bool PresentationRequest::IsProhibitMixedSecurityContexts(Document* aDocument) {
return true;
}
doc = doc->GetParentDocument();
doc = doc->GetInProcessParentDocument();
}
return false;

Просмотреть файл

@ -3139,7 +3139,8 @@ bool ScriptLoader::ReadyToExecuteParserBlockingScripts() {
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)) {

Просмотреть файл

@ -118,7 +118,7 @@ bool FramingChecker::CheckOneFrameOptionsPolicy(nsIHttpChannel* aHttpChannel,
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;
}
@ -138,9 +138,10 @@ bool FramingChecker::CheckOneFrameOptionsPolicy(nsIHttpChannel* aHttpChannel,
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) {
@ -155,8 +156,8 @@ bool FramingChecker::CheckOneFrameOptionsPolicy(nsIHttpChannel* aHttpChannel,
// 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()) {

Просмотреть файл

@ -1473,7 +1473,8 @@ nsCSPContext::PermitsAncestry(nsIDocShell* aDocShell,
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) {

Просмотреть файл

@ -90,7 +90,7 @@ class nsMixedContentEvent : public Runnable {
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!");
@ -852,7 +852,7 @@ nsresult nsMixedContentBlocker::ShouldLoad(
// 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
@ -899,7 +899,8 @@ nsresult nsMixedContentBlocker::ShouldLoad(
// update the parent to the grandparent.
nsCOMPtr<nsIDocShellTreeItem> newParentTreeItem;
parentTreeItem->GetSameTypeParent(getter_AddRefs(newParentTreeItem));
parentTreeItem->GetInProcessSameTypeParent(
getter_AddRefs(newParentTreeItem));
parentTreeItem = newParentTreeItem;
} // end while loop.

Просмотреть файл

@ -212,7 +212,7 @@ static bool WindowCannotReceiveSensorEvent(nsPIDOMWindowInner* aWindow) {
}
// 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) {

Просмотреть файл

@ -1178,7 +1178,8 @@ class AsyncOpenRunnable final : public WebSocketMainThreadRunnable {
}
uint64_t windowID = 0;
nsCOMPtr<nsPIDOMWindowOuter> topWindow = aWindow->GetScriptableTop();
nsCOMPtr<nsPIDOMWindowOuter> topWindow =
aWindow->GetInProcessScriptableTop();
nsCOMPtr<nsPIDOMWindowInner> topInner;
if (topWindow) {
topInner = topWindow->GetCurrentInnerWindow();
@ -1400,7 +1401,8 @@ already_AddRefed<WebSocket> WebSocket::ConstructorCommon(
}
uint64_t windowID = 0;
nsCOMPtr<nsPIDOMWindowOuter> topWindow = outerWindow->GetScriptableTop();
nsCOMPtr<nsPIDOMWindowOuter> topWindow =
outerWindow->GetInProcessScriptableTop();
nsCOMPtr<nsPIDOMWindowInner> topInner;
if (topWindow) {
topInner = topWindow->GetCurrentInnerWindow();
@ -2719,7 +2721,7 @@ nsresult WebSocketImpl::GetLoadingPrincipal(nsIPrincipal** aPrincipal) {
}
nsCOMPtr<nsPIDOMWindowOuter> parentWindow =
innerWindow->GetScriptableParent();
innerWindow->GetInProcessScriptableParent();
if (NS_WARN_IF(!parentWindow)) {
return NS_ERROR_DOM_SECURITY_ERR;
}
@ -2744,7 +2746,8 @@ nsresult WebSocketImpl::GetLoadingPrincipal(nsIPrincipal** aPrincipal) {
break;
}
if (parentWindow->GetScriptableTop() == innerWindow->GetScriptableTop()) {
if (parentWindow->GetInProcessScriptableTop() ==
innerWindow->GetInProcessScriptableTop()) {
break;
}

Просмотреть файл

@ -482,7 +482,7 @@ RefPtr<PerformanceInfoPromise> WorkerDebugger::ReportPerformanceInfo() {
if (win) {
nsPIDOMWindowOuter* outer = win->GetOuterWindow();
if (outer) {
top = outer->GetTop();
top = outer->GetInProcessTop();
if (top) {
windowID = top->WindowID();
isTopLevel = outer->IsTopLevelWindow();

Просмотреть файл

@ -2508,7 +2508,7 @@ nsresult WorkerPrivate::GetLoadInfo(JSContext* aCx, nsPIDOMWindowInner* aWindow,
if (document->GetSandboxFlags() & SANDBOXED_ORIGIN) {
nsCOMPtr<Document> tmpDoc = document;
do {
tmpDoc = tmpDoc->GetParentDocument();
tmpDoc = tmpDoc->GetInProcessParentDocument();
} while (tmpDoc && tmpDoc->GetSandboxFlags() & SANDBOXED_ORIGIN);
if (tmpDoc) {

Просмотреть файл

@ -2890,7 +2890,7 @@ nsresult XMLHttpRequestMainThread::SendInternal(const BodyExtractorBase* aBody,
if (GetOwner()) {
if (nsCOMPtr<nsPIDOMWindowOuter> topWindow =
GetOwner()->GetOuterWindow()->GetTop()) {
GetOwner()->GetOuterWindow()->GetInProcessTop()) {
if (nsCOMPtr<nsPIDOMWindowInner> topInner =
topWindow->GetCurrentInnerWindow()) {
mSuspendedDoc = topWindow->GetExtantDoc();

Просмотреть файл

@ -19,7 +19,7 @@ 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

Просмотреть файл

@ -635,7 +635,7 @@ EditorSpellCheck::UpdateCurrentDictionary(
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) {

Просмотреть файл

@ -193,7 +193,8 @@ nsCString ImageCacheKey::GetTopLevelBaseDomain(Document* aDocument,
// 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

Просмотреть файл

@ -357,7 +357,7 @@ void AccessibleCaretEventHub::Init() {
curDocShell->AddWeakScrollObserver(this);
nsCOMPtr<nsIDocShellTreeItem> tmp;
curDocShell->GetSameTypeParent(getter_AddRefs(tmp));
curDocShell->GetInProcessSameTypeParent(getter_AddRefs(tmp));
curDocShell = do_QueryInterface(tmp);
} while (curDocShell);
@ -383,7 +383,7 @@ void AccessibleCaretEventHub::Terminate() {
curDocShell->RemoveWeakScrollObserver(this);
nsCOMPtr<nsIDocShellTreeItem> tmp;
curDocShell->GetSameTypeParent(getter_AddRefs(tmp));
curDocShell->GetInProcessSameTypeParent(getter_AddRefs(tmp));
curDocShell = do_QueryInterface(tmp);
}

Просмотреть файл

@ -6357,7 +6357,7 @@ already_AddRefed<PresShell> PresShell::GetParentPresShellForEventHandling() {
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);
@ -7157,7 +7157,7 @@ nsIFrame* PresShell::EventHandler::GetFrameForHandlingEventWith(
}
Document* retargetEventDoc = aRetargetDocument;
while (!retargetPresShell) {
retargetEventDoc = retargetEventDoc->GetParentDocument();
retargetEventDoc = retargetEventDoc->GetInProcessParentDocument();
if (!retargetEventDoc) {
return nullptr;
}
@ -8244,7 +8244,7 @@ PresShell::EventHandler::GetDocumentURIToCompareWithBlacklist(
// 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();

Просмотреть файл

@ -4159,7 +4159,7 @@ nsCSSFrameConstructor::FindXULMenubarData(const Element& aElement,
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.

Просмотреть файл

@ -672,7 +672,7 @@ nsresult nsDocumentViewer::SyncParentSubDocMap() {
}
nsCOMPtr<nsIDocShellTreeItem> parent;
docShell->GetParent(getter_AddRefs(parent));
docShell->GetInProcessParent(getter_AddRefs(parent));
nsCOMPtr<nsPIDOMWindowOuter> parent_win =
parent ? parent->GetWindow() : nullptr;
@ -1104,14 +1104,14 @@ nsDocumentViewer::LoadComplete(nsresult aStatus) {
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() &&
@ -1421,11 +1421,11 @@ nsresult nsDocumentViewer::PermitUnloadInternal(uint32_t* aPermitUnloadFlags,
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));
@ -1538,10 +1538,10 @@ static void AttachContainerRecurse(nsIDocShell* aShell) {
// 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);
}
@ -1694,10 +1694,10 @@ static void DetachContainerRecurse(nsIDocShell* aShell) {
// 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);
}
@ -1971,10 +1971,10 @@ nsDocumentViewer::SetDocumentInternal(Document* aDocument,
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);
}
}
@ -2167,7 +2167,7 @@ nsDocumentViewer::Show(void) {
// 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) {
@ -2669,10 +2669,10 @@ void nsDocumentViewer::CallChildren(CallChildFunc aFunc, void* aClosure) {
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) {
@ -3216,7 +3216,7 @@ nsDocumentViewer::GetContentSize(int32_t* aWidth, int32_t* aHeight) {
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.
@ -3904,7 +3904,7 @@ void nsDocumentViewer::SetIsPrintingInDocShellTree(
if (aIsPrintingOrPP) {
while (parentItem) {
nsCOMPtr<nsIDocShellTreeItem> parent;
parentItem->GetSameTypeParent(getter_AddRefs(parent));
parentItem->GetInProcessSameTypeParent(getter_AddRefs(parent));
if (!parent) {
break;
}
@ -3928,10 +3928,10 @@ void nsDocumentViewer::SetIsPrintingInDocShellTree(
// 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);

Просмотреть файл

@ -7442,7 +7442,7 @@ nsDeviceContext* nsLayoutUtils::GetDeviceContextForScreenInfo(
}
nsCOMPtr<nsIDocShellTreeItem> parentItem;
docShell->GetParent(getter_AddRefs(parentItem));
docShell->GetInProcessParent(getter_AddRefs(parentItem));
docShell = do_QueryInterface(parentItem);
}

Просмотреть файл

@ -612,7 +612,7 @@ nsresult nsPresContext::Init(nsDeviceContext* aDeviceContext) {
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
@ -625,7 +625,7 @@ nsresult nsPresContext::Init(nsDeviceContext* aDeviceContext) {
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);

Просмотреть файл

@ -741,7 +741,7 @@ 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();

Просмотреть файл

@ -142,7 +142,7 @@ PrintPreviewUserEventSuppressor::HandleEvent(Event* aEvent) {
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();

Просмотреть файл

@ -779,7 +779,7 @@ bool nsComputedDOMStyle::NeedsToFlush() const {
// 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;

Просмотреть файл

@ -166,7 +166,7 @@ float Gecko_MediaFeatures_GetResolution(const Document* aDocument) {
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;

Просмотреть файл

@ -134,15 +134,15 @@ static void DumpAWebShell(nsIDocShellTreeItem* aShellItem, FILE* 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);
}
@ -174,10 +174,10 @@ static void DumpContentRecur(nsIDocShell* aDocShell, FILE* 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);
@ -208,10 +208,10 @@ static void DumpFramesRecur(nsIDocShell* aDocShell, FILE* 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);
@ -242,10 +242,10 @@ static void DumpViewsRecur(nsIDocShell* aDocShell, FILE* 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);

Просмотреть файл

@ -1180,7 +1180,7 @@ bool nsXULPopupManager::IsChildOfDocShell(Document* aDoc,
if (docShellItem == aExpected) return true;
nsCOMPtr<nsIDocShellTreeItem> parent;
docShellItem->GetParent(getter_AddRefs(parent));
docShellItem->GetInProcessParent(getter_AddRefs(parent));
docShellItem = parent;
}

Просмотреть файл

@ -45,7 +45,7 @@ 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();
@ -165,7 +165,8 @@ LoadInfo::LoadInfo(
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();
@ -205,7 +206,7 @@ LoadInfo::LoadInfo(
// 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());
@ -377,7 +378,8 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* aOuterWindow,
// 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);

Просмотреть файл

@ -800,7 +800,7 @@ void nsHtml5TreeOpExecutor::MaybeComplainAboutCharset(const char* aMsgId,
// 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;
}

Просмотреть файл

@ -113,7 +113,7 @@ nsSecureBrowserUIImpl::PrepareForContentChecks() {
if (docShell->ItemType() == nsIDocShellTreeItem::typeContent) {
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(docShell);
nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
Unused << docShellTreeItem->GetSameTypeRootTreeItem(
Unused << docShellTreeItem->GetInProcessSameTypeRootTreeItem(
getter_AddRefs(sameTypeRoot));
MOZ_ASSERT(
sameTypeRoot,

Просмотреть файл

@ -347,7 +347,7 @@ bool CheckContentBlockingAllowList(nsPIDOMWindowInner* aWindow) {
return entry.Data().mResult;
}
nsPIDOMWindowOuter* top = aWindow->GetScriptableTop();
nsPIDOMWindowOuter* top = aWindow->GetInProcessScriptableTop();
if (top) {
nsIURI* topWinURI = top->GetDocumentURI();
Document* doc = top->GetExtantDoc();
@ -605,7 +605,7 @@ already_AddRefed<nsPIDOMWindowOuter> GetTopWindow(nsPIDOMWindowInner* aWindow) {
nsCOMPtr<nsPIDOMWindowOuter> pwin;
auto* outer = nsGlobalWindowOuter::Cast(aWindow->GetOuterWindow());
if (outer) {
pwin = outer->GetScriptableTop();
pwin = outer->GetInProcessScriptableTop();
}
if (!pwin) {
@ -872,7 +872,8 @@ AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(
}
}
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."));
@ -1163,7 +1164,7 @@ bool AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(
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"));

Просмотреть файл

@ -345,13 +345,13 @@ nsWebBrowser::GetItemType(int32_t* aItemType) {
}
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;
@ -363,28 +363,31 @@ nsWebBrowser::GetRootTreeItem(nsIDocShellTreeItem** 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);
@ -445,7 +448,7 @@ nsWebBrowser::SetTreeOwner(nsIDocShellTreeOwner* aTreeOwner) {
//*****************************************************************************
NS_IMETHODIMP
nsWebBrowser::GetChildCount(int32_t* aChildCount) {
nsWebBrowser::GetInProcessChildCount(int32_t* aChildCount) {
NS_ENSURE_ARG_POINTER(aChildCount);
*aChildCount = 0;
return NS_OK;
@ -462,7 +465,8 @@ nsWebBrowser::RemoveChild(nsIDocShellTreeItem* aChild) {
}
NS_IMETHODIMP
nsWebBrowser::GetChildAt(int32_t aIndex, nsIDocShellTreeItem** aChild) {
nsWebBrowser::GetInProcessChildAt(int32_t aIndex,
nsIDocShellTreeItem** aChild) {
return NS_ERROR_UNEXPECTED;
}

Просмотреть файл

@ -426,7 +426,7 @@ static bool CheckParentFrames(nsPIDOMWindowOuter* aWindow,
}
auto* piWin = aWindow;
while ((piWin = piWin->GetScriptableParentOrNull())) {
while ((piWin = piWin->GetInProcessScriptableParentOrNull())) {
auto* win = nsGlobalWindowOuter::Cast(piWin);
auto* principal = BasePrincipal::Cast(win->GetPrincipal());

Просмотреть файл

@ -774,7 +774,7 @@ bool WindowShouldMatchActiveTab(nsPIDOMWindowOuter* aWin) {
return false;
}
nsCOMPtr<nsPIDOMWindowOuter> parent = aWin->GetParent();
nsCOMPtr<nsPIDOMWindowOuter> parent = aWin->GetInProcessParent();
MOZ_ASSERT(parent != nullptr);
return WindowShouldMatchActiveTab(parent);
}

Просмотреть файл

@ -1438,7 +1438,7 @@ int32_t nsFormFillController::GetIndexOfDocShell(nsIDocShell* aDocShell) {
// 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);

Просмотреть файл

@ -103,14 +103,14 @@ void SessionStoreUtils::ForEachNonDynamicChildFrame(
}
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;
@ -1047,13 +1047,13 @@ static void CollectedSessionStorageInternal(
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;
}

Просмотреть файл

@ -372,7 +372,7 @@ nsresult nsTypeAheadFind::FindItNow(bool aIsLinksOnly,
nsCOMPtr<nsIDocShellTreeItem> rootContentTreeItem;
nsCOMPtr<nsIDocShell> currentDocShell;
startingDocShell->GetSameTypeRootTreeItem(
startingDocShell->GetInProcessSameTypeRootTreeItem(
getter_AddRefs(rootContentTreeItem));
nsCOMPtr<nsIDocShell> rootContentDocShell =
do_QueryInterface(rootContentTreeItem);
@ -533,7 +533,7 @@ nsresult nsTypeAheadFind::FindItNow(bool aIsLinksOnly,
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;

Просмотреть файл

@ -852,7 +852,8 @@ nsresult nsWindowWatcher::OpenWindowInternal(
nsCOMPtr<nsPIDOMWindowInner> parentTopInnerWindow;
if (parentWindow) {
nsCOMPtr<nsPIDOMWindowOuter> parentTopWindow = parentWindow->GetTop();
nsCOMPtr<nsPIDOMWindowOuter> parentTopWindow =
parentWindow->GetInProcessTop();
if (parentTopWindow) {
parentTopInnerWindow = parentTopWindow->GetCurrentInnerWindow();
}

Просмотреть файл

@ -112,7 +112,7 @@ bool AddonManagerWebAPI::IsAPIEnabled(JSContext* aCx, JSObject* aGlobal) {
// 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;
}
@ -128,7 +128,7 @@ bool AddonManagerWebAPI::IsAPIEnabled(JSContext* aCx, JSObject* aGlobal) {
return false;
}
doc = doc->GetParentDocument();
doc = doc->GetInProcessParentDocument();
if (!doc) {
// Getting here means something has been torn down so fail safe.
return false;

Просмотреть файл

@ -981,7 +981,7 @@ nsDocLoader::GetIsTopLevel(bool* aResult) {
nsCOMPtr<nsPIDOMWindowOuter> piwindow = nsPIDOMWindowOuter::From(window);
NS_ENSURE_STATE(piwindow);
nsCOMPtr<nsPIDOMWindowOuter> topWindow = piwindow->GetTop();
nsCOMPtr<nsPIDOMWindowOuter> topWindow = piwindow->GetInProcessTop();
*aResult = piwindow == topWindow;
}

Просмотреть файл

@ -40,7 +40,7 @@ already_AddRefed<nsIWidget> WidgetUtils::DOMWindowToWidget(
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;