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 42f4a1ec8aabf4d51d0a905abaf34787c4512c3c..daa9d3a40b8bb14cf87cc61fa4d1bd42b6b2862e 100644 |
--- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp |
+++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp |
@@ -110,4 +110,19 @@ 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>(1UL, {origin}); |
+ whitelists.push_back(whitelist); |
+ } |
+ return whitelists; |
+} |
+ |
} // namespace blink |