Bug 1582716 - Remove nsDocShell::GetIsOnlyToplevelInTabGroup. r=nika
We can remove isOnlyToplevelInTabGroup entirely since we have BrowsingContext/BrowsingContextGroup exposed through chrome-webidl. Checking if a browsing context is the only top level (auxilliary or otherwise) is only a matter of checking that there isn't a parent, and that the size of the browsing context group is 1. Differential Revision: https://phabricator.services.mozilla.com/D46590
This commit is contained in:
@@ -13464,35 +13464,6 @@ nsCommandManager* nsDocShell::GetCommandManager() {
|
||||
return mCommandManager;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetIsOnlyToplevelInTabGroup(bool* aResult) {
|
||||
MOZ_ASSERT(aResult);
|
||||
|
||||
nsPIDOMWindowOuter* outer = GetWindow();
|
||||
MOZ_ASSERT(outer);
|
||||
|
||||
// If we are not toplevel then we are not the only toplevel window in the
|
||||
// tab group.
|
||||
if (outer->GetInProcessScriptableParentOrNull()) {
|
||||
*aResult = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// If we have any other toplevel windows in our tab group, then we are not
|
||||
// the only toplevel window in the tab group.
|
||||
nsTArray<nsPIDOMWindowOuter*> toplevelWindows =
|
||||
outer->TabGroup()->GetTopLevelWindows();
|
||||
if (toplevelWindows.Length() > 1) {
|
||||
*aResult = false;
|
||||
return NS_OK;
|
||||
}
|
||||
MOZ_ASSERT(toplevelWindows.Length() == 1);
|
||||
MOZ_ASSERT(toplevelWindows[0] == outer);
|
||||
|
||||
*aResult = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetAwaitingLargeAlloc(bool* aResult) {
|
||||
MOZ_ASSERT(aResult);
|
||||
|
||||
Reference in New Issue
Block a user