Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Unified Diff: third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp

Issue 2739203002: Initial Implementation of Iframe Attribute for Feature Policy (Part 3) (Closed)
Patch Set: Bug fix: frame owner does not always exist. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698