diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 0a8a5b3e2905..fd625d7ec892 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -2823,29 +2823,6 @@ nsDocShell::GetSameTypeRootTreeItemIgnoreBrowserBoundaries( return NS_OK; } -/* static */ -bool nsDocShell::CanAccessItem(nsIDocShellTreeItem* aTargetItem, - nsIDocShellTreeItem* aAccessingItem, - bool aConsiderOpener) { - MOZ_ASSERT(aTargetItem, "Must have target item!"); - - if (!aAccessingItem) { - // Good to go - return true; - } - - nsCOMPtr targetDS = do_QueryInterface(aTargetItem); - nsCOMPtr accessingDS = do_QueryInterface(aAccessingItem); - if (!targetDS || !accessingDS) { - // We must be able to convert both to nsIDocShell. - return false; - } - - return Cast(accessingDS) - ->mBrowsingContext->CanAccess(Cast(targetDS)->mBrowsingContext, - aConsiderOpener); -} - void nsDocShell::AssertOriginAttributesMatchPrivateBrowsing() { // Chrome docshells must not have a private browsing OriginAttribute // Content docshells must maintain the equality: diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index 422a94c3f6f0..0223416f7b20 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -539,11 +539,8 @@ class nsDocShell final : public nsDocLoader, nsDocShell(mozilla::dom::BrowsingContext* aBrowsingContext, uint64_t aContentWindowID); - // Security checks to prevent frameset spoofing. See comments at - // implementation sites. - static bool CanAccessItem(nsIDocShellTreeItem* aTargetItem, - nsIDocShellTreeItem* aAccessingItem, - bool aConsiderOpener = true); + // Security check to prevent frameset spoofing. See comments at + // implementation site. static bool ValidateOrigin(nsIDocShellTreeItem* aOriginTreeItem, nsIDocShellTreeItem* aTargetTreeItem);