Chromium Code Reviews| 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)); |
|
raymes
2017/01/19 02:40:57
It looks like we never need to access anything in
iclelland
2017/01/19 05:40:40
I think that might make sense as the final step in
|
| + return policy.release(); |
| +} |
| + |
| +bool BlinkPlatformImpl::isFeatureEnabledByPolicy( |
|
raymes
2017/01/19 02:40:56
I don't have a problem with this being a standalon
iclelland
2017/01/19 05:40:40
That caused me some grief -- it seems like the obv
|
| + const blink::WebFeaturePolicy* policy, |
| + blink::WebFeaturePolicyFeature feature, |
| + const blink::WebSecurityOrigin& origin) { |
| + // if (!policy) |
| + // return FeaturePolicy::IsFeatureAllowedByDefault(""); |
|
raymes
2017/01/19 02:40:56
Hmm, what is this bit for?
iclelland
2017/01/19 05:40:40
Thanks, that's not moved yet -- it was a placehold
|
| + return static_cast<const FeaturePolicy*>(policy)->IsFeatureEnabledForOrigin( |
| + feature, url::Origin(origin)); |
| +} |
| + |
| } // namespace content |