mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 761448, be more strict when to allow docshell loads, r=bz, a=akeybl
This commit is contained in:
parent
f4ef6a6269
commit
06af3cb460
@ -8651,6 +8651,8 @@ nsDocShell::InternalLoad(nsIURI * aURI,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_ENSURE_STATE(!HasUnloadedParent());
|
||||
|
||||
rv = CheckLoadingPermissions();
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
@ -12440,3 +12442,23 @@ nsDocShell::GetAsyncPanZoomEnabled(bool* aOut)
|
||||
*aOut = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
nsDocShell::HasUnloadedParent()
|
||||
{
|
||||
nsCOMPtr<nsIDocShellTreeItem> currentTreeItem = this;
|
||||
while (currentTreeItem) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
|
||||
currentTreeItem->GetParent(getter_AddRefs(parentTreeItem));
|
||||
nsCOMPtr<nsIDocShell> parent = do_QueryInterface(parentTreeItem);
|
||||
if (parent) {
|
||||
bool inUnload = false;
|
||||
parent->GetIsInUnload(&inUnload);
|
||||
if (inUnload) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
currentTreeItem.swap(parentTreeItem);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -675,6 +675,8 @@ protected:
|
||||
|
||||
FrameType GetInheritedFrameType();
|
||||
|
||||
bool HasUnloadedParent();
|
||||
|
||||
// hash of session storages, keyed by domain
|
||||
nsInterfaceHashtable<nsCStringHashKey, nsIDOMStorage> mStorages;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user