Index: third_party/WebKit/Source/core/dom/SecurityContext.cpp |
diff --git a/third_party/WebKit/Source/core/dom/SecurityContext.cpp b/third_party/WebKit/Source/core/dom/SecurityContext.cpp |
index dfce6551911360c73671df76b692b549be74aa97..6d3c37f513ef4efdd0150b87a74c8b0e45515edc 100644 |
--- a/third_party/WebKit/Source/core/dom/SecurityContext.cpp |
+++ b/third_party/WebKit/Source/core/dom/SecurityContext.cpp |
@@ -29,6 +29,7 @@ |
#include "core/frame/csp/ContentSecurityPolicy.h" |
#include "platform/RuntimeEnabledFeatures.h" |
#include "platform/weborigin/SecurityOrigin.h" |
+#include "public/platform/Platform.h" |
namespace blink { |
@@ -100,12 +101,14 @@ void SecurityContext::enforceSuborigin(const Suborigin& suborigin) { |
} |
void SecurityContext::setFeaturePolicyFromHeader( |
- const WebParsedFeaturePolicy& parsedHeader, |
- FeaturePolicy* parentFeaturePolicy) { |
+ const WebParsedFeaturePolicyHeader& parsedHeader, |
+ const WebFeaturePolicy* parentFeaturePolicy) { |
DCHECK(!m_featurePolicy); |
- m_featurePolicy = FeaturePolicy::createFromParentPolicy(parentFeaturePolicy, |
- m_securityOrigin); |
- m_featurePolicy->setHeaderPolicy(parsedHeader); |
+ |
+ // Compose the new policy based on the parent policy, with the new header |
+ WebSecurityOrigin origin = WebSecurityOrigin(m_securityOrigin); |
+ m_featurePolicy.reset(Platform::current()->createFeaturePolicy( |
+ parentFeaturePolicy, parsedHeader, origin)); |
} |
} // namespace blink |