Index: content/child/blink_platform_impl.cc |
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc |
index 7c6dfda8dbe3b236e86e401a012c9ad968530544..ef1703731c00c409395fa99bc1102a33da21c364 100644 |
--- a/content/child/blink_platform_impl.cc |
+++ b/content/child/blink_platform_impl.cc |
@@ -39,6 +39,7 @@ |
#include "content/app/strings/grit/content_strings.h" |
#include "content/child/child_thread_impl.h" |
#include "content/child/content_child_helpers.h" |
+#include "content/child/feature_policy/feature_policy_platform.h" |
#include "content/child/notifications/notification_dispatcher.h" |
#include "content/child/notifications/notification_manager.h" |
#include "content/child/push_messaging/push_dispatcher.h" |
@@ -856,4 +857,24 @@ int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) { |
ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8())); |
} |
+blink::WebFeaturePolicy* BlinkPlatformImpl::createFeaturePolicy( |
+ const blink::WebFeaturePolicy* parentPolicy, |
+ const blink::WebParsedFeaturePolicyHeader& policyHeader, |
+ const blink::WebSecurityOrigin& origin) { |
+ std::unique_ptr<FeaturePolicy> policy = FeaturePolicy::CreateFromParentPolicy( |
+ static_cast<const FeaturePolicy*>(parentPolicy), url::Origin(origin)); |
+ policy->SetHeaderPolicy(FeaturePolicyHeaderFromWeb(policyHeader)); |
+ return policy.release(); |
+} |
+ |
+bool BlinkPlatformImpl::isFeatureEnabledByPolicy( |
+ const blink::WebFeaturePolicy* policy, |
+ blink::WebFeaturePolicyFeature feature, |
+ const blink::WebSecurityOrigin& origin) { |
+ // if (!policy) |
+ // return FeaturePolicy::IsFeatureAllowedByDefault(""); |
+ return static_cast<const FeaturePolicy*>(policy)->IsFeatureEnabledForOrigin( |
+ feature, url::Origin(origin)); |
+} |
+ |
} // namespace content |