mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
Bug 1543068 - P1.5 Remove InheritedEmbedderPolicy r=nika
I believe it's the right thing to do. COEP inherits opener's COEP and is overwritten if COEP by response is stricter. i.e., we no more need the inherited one. Differential Revision: https://phabricator.services.mozilla.com/D40143 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2247427ef2
commit
895ebba7c1
@ -134,12 +134,12 @@ already_AddRefed<BrowsingContext> BrowsingContext::Create(
|
||||
context->mName = aName;
|
||||
context->mOpenerId = aOpener ? aOpener->Id() : 0;
|
||||
context->mEmbedderPolicy = nsILoadInfo::EMBEDDER_POLICY_NULL;
|
||||
context->mInheritedEmbedderPolicy = nsILoadInfo::EMBEDDER_POLICY_NULL;
|
||||
|
||||
BrowsingContext* inherit = aParent ? aParent : aOpener;
|
||||
if (inherit) {
|
||||
context->mOpenerPolicy = inherit->mOpenerPolicy;
|
||||
context->mInheritedEmbedderPolicy = inherit->mEmbedderPolicy;
|
||||
// CORPP 3.1.3 https://mikewest.github.io/corpp/#integration-html
|
||||
context->mEmbedderPolicy = inherit->mEmbedderPolicy;
|
||||
}
|
||||
|
||||
Register(context);
|
||||
|
@ -13,7 +13,6 @@
|
||||
MOZ_BC_FIELD(Name, nsString)
|
||||
MOZ_BC_FIELD(Closed, bool)
|
||||
MOZ_BC_FIELD(EmbedderPolicy, nsILoadInfo::CrossOriginEmbedderPolicy)
|
||||
MOZ_BC_FIELD(InheritedEmbedderPolicy, nsILoadInfo::CrossOriginEmbedderPolicy)
|
||||
MOZ_BC_FIELD(OpenerPolicy, nsILoadInfo::CrossOriginOpenerPolicy)
|
||||
|
||||
// The current opener for this BrowsingContext. This is a weak reference, and
|
||||
|
@ -7528,7 +7528,7 @@ nsresult nsHttpChannel::ProcessCrossOriginEmbedderPolicyHeader() {
|
||||
}
|
||||
|
||||
nsILoadInfo::CrossOriginEmbedderPolicy documentPolicy =
|
||||
ctx->GetInheritedEmbedderPolicy();
|
||||
ctx->GetEmbedderPolicy();
|
||||
nsILoadInfo::CrossOriginEmbedderPolicy resultPolicy =
|
||||
nsILoadInfo::EMBEDDER_POLICY_NULL;
|
||||
rv = GetResponseEmbedderPolicy(&resultPolicy);
|
||||
@ -7536,13 +7536,13 @@ nsresult nsHttpChannel::ProcessCrossOriginEmbedderPolicyHeader() {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
ctx->SetEmbedderPolicy(resultPolicy);
|
||||
|
||||
if (documentPolicy != nsILoadInfo::EMBEDDER_POLICY_NULL &&
|
||||
resultPolicy == nsILoadInfo::EMBEDDER_POLICY_NULL) {
|
||||
return NS_ERROR_BLOCKED_BY_POLICY;
|
||||
}
|
||||
|
||||
ctx->SetEmbedderPolicy(resultPolicy);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user