Bug 1612147 - Don't store FeaturePolicy in BrowsingContext. r=smaug
Syncing the container FeaturePolicy across BrowsingContext is actually a bit more heavy-handed than necessary. We only ever need a container FeaturePolicy when inheriting a FeaturePolicy in exactly the document the container contains. Not every process that the tree the container is a part of. So instead of storing a FeaturePolicy in a synced field, we manually send it to the correct WindowGlobalChild (which corresponds to a document) and retrieve it from there. Differential Revision: https://phabricator.services.mozilla.com/D61479
This commit is contained in:
@@ -81,6 +81,13 @@ Document* WindowContext::GetExtantDoc() const {
|
||||
return innerWindow ? innerWindow->GetExtantDoc() : nullptr;
|
||||
}
|
||||
|
||||
WindowGlobalChild* WindowContext::GetWindowGlobalChild() const {
|
||||
MOZ_ASSERT(XRE_IsContentProcess());
|
||||
NS_ENSURE_TRUE(XRE_IsContentProcess(), nullptr);
|
||||
nsGlobalWindowInner* innerWindow = GetInnerWindow();
|
||||
return innerWindow ? innerWindow->GetWindowGlobalChild() : nullptr;
|
||||
}
|
||||
|
||||
WindowContext* WindowContext::GetParentWindowContext() {
|
||||
return mBrowsingContext->GetParentWindowContext();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user