Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp |
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
index 83912c85c72ef76136a71665479b9a957ef579fc..4f59ccb9a14309b907c15cd5e498825ec070ddda 100644 |
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
@@ -87,6 +87,7 @@ |
#include "platform/PluginScriptForbiddenScope.h" |
#include "platform/ScriptForbiddenScope.h" |
#include "platform/UserGestureIndicator.h" |
+#include "platform/feature_policy/FeaturePolicy.h" |
#include "platform/network/HTTPParsers.h" |
#include "platform/network/ResourceRequest.h" |
#include "platform/scroll/ScrollAnimatorBase.h" |
@@ -581,6 +582,17 @@ void FrameLoader::didBeginDocument() { |
OriginTrialContext::addTokensFromHeader( |
m_frame->document(), |
m_documentLoader->response().httpHeaderField(HTTPNames::Origin_Trial)); |
+ if (RuntimeEnabledFeatures::featurePolicyEnabled()) { |
+ FeaturePolicy* featurePolicy = FeaturePolicy::createFromParentPolicy( |
+ (isLoadingMainFrame() |
+ ? nullptr |
+ : m_frame->client()->parent()->getFeaturePolicy()), |
+ m_frame->securityContext()->getSecurityOrigin()); |
+ featurePolicy->setHeaderPolicy( |
+ m_documentLoader->response().httpHeaderField( |
+ HTTPNames::Feature_Policy)); |
+ m_frame->setFeaturePolicy(featurePolicy); |
+ } |
} |
if (m_documentLoader) { |