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

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: Codereview: added TODO comment for implementing allow* attributes in the container policy parser 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 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

Powered by Google App Engine
This is Rietveld 408576698