Chromium Code Reviews| Index: third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp |
| diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp |
| index 02f1303888eae3656e4783b74fe7f884c7a29863..45f9e37c46e15ec7d7d4276fcc94045bbc0f2b07 100644 |
| --- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp |
| +++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp |
| @@ -113,4 +113,20 @@ WebParsedFeaturePolicy parseFeaturePolicy(const String& policy, |
| return whitelists; |
| } |
| +// TODO(lunalu): also take information of allowfullscreen and |
| +// allowpaymentrequest into account when constructing the whitelist. |
| +WebParsedFeaturePolicy getContainerPolicyFromAllowedFeatures( |
| + const WebVector<WebFeaturePolicyFeature>& features, |
| + RefPtr<SecurityOrigin> origin) { |
| + Vector<WebParsedFeaturePolicyDeclaration> whitelists; |
| + for (const WebFeaturePolicyFeature feature : features) { |
| + WebParsedFeaturePolicyDeclaration whitelist; |
| + whitelist.feature = feature; |
| + whitelist.origins = |
| + Vector<WebSecurityOrigin>(static_cast<size_t>(1), {origin}); |
|
iclelland
2017/03/15 17:14:54
I think that "1UL" is usually enough to avoid the
|
| + whitelists.push_back(whitelist); |
| + } |
| + return whitelists; |
| +} |
| + |
| } // namespace blink |