Bug 1616775 - P1. Add IsThirdPartyWindow and IsThirdPartyTrackingResourceWindow fields to WindowContext. r=timhuang,baku,farre

We have to add "IsThirdPartyWindow" in WindowContext because we need to know if
a BrowsingContext is third-party (The browsing context may be not
in-process).

Differential Revision: https://phabricator.services.mozilla.com/D71010
This commit is contained in:
Dimi Lee
2020-04-23 14:24:56 +00:00
parent fd6b9db668
commit 8231ed1337
4 changed files with 41 additions and 8 deletions

View File

@@ -61,6 +61,18 @@ void WindowContext::SendCommitTransaction(ContentChild* aChild,
aChild->SendCommitWindowContextTransaction(this, aTxn, aEpoch);
}
bool WindowContext::CanSet(FieldIndex<IDX_IsThirdPartyWindow>,
const bool& IsThirdPartyWindow,
ContentParent* aSource) {
return mBrowsingContext->CheckOnlyOwningProcessCanSet(aSource);
}
bool WindowContext::CanSet(FieldIndex<IDX_IsThirdPartyTrackingResourceWindow>,
const bool& aIsThirdPartyTrackingResourceWindow,
ContentParent* aSource) {
return mBrowsingContext->CheckOnlyOwningProcessCanSet(aSource);
}
already_AddRefed<WindowContext> WindowContext::Create(
WindowGlobalChild* aWindow) {
MOZ_RELEASE_ASSERT(XRE_IsContentProcess(),