Bug 1498720 - Ensure that we revoke a subframe's storage access when it is removed from the DOM r=baku

Differential Revision: https://phabricator.services.mozilla.com/D8615
This commit is contained in:
Ehsan Akhgari
2018-10-15 10:37:11 +00:00
parent 43e94dc391
commit a00e095d4d
2 changed files with 12 additions and 0 deletions

View File

@@ -2988,6 +2988,12 @@ nsDocShell::SetDocLoaderParent(nsDocLoader* aParent)
// Our parent has changed. Recompute scriptability.
RecomputeCanExecuteScripts();
nsCOMPtr<nsPIDOMWindowOuter> window = GetWindow();
if (window) {
auto* win = nsGlobalWindowOuter::Cast(window);
win->ParentWindowChanged();
}
NS_ASSERTION(mInheritPrivateBrowsingId || wasPrivate == UsePrivateBrowsing(),
"Private browsing state changed while inheritance was disabled");

View File

@@ -737,6 +737,12 @@ public:
return GetExtantDoc() && GetExtantDoc()->IsInSyncOperation();
}
void ParentWindowChanged()
{
// Reset our storage access flag when we get reparented.
mHasStorageAccess = false;
}
public:
int32_t GetInnerWidthOuter(mozilla::ErrorResult& aError);
protected: