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

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

Issue 2923563003: Move container policy logic to frame owner classes. (Closed)
Patch Set: Addressing nits Created 3 years, 6 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 f9ab84fb18b8b07399c6a882e0887d78984035f9..3e21a0ce3ab417cb8caff4b9ddba0ba98d839cc1 100644
--- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
+++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
@@ -12,19 +12,6 @@
namespace blink {
-namespace {
-
-void AddAllowFeatureToList(
- WebFeaturePolicyFeature feature,
- Vector<WebParsedFeaturePolicyDeclaration>& whitelists) {
- WebParsedFeaturePolicyDeclaration whitelist;
- whitelist.feature = feature;
- whitelist.matches_all_origins = true;
- whitelists.push_back(whitelist);
-}
-
-} // namespace
-
WebParsedFeaturePolicy ParseFeaturePolicy(const String& policy,
RefPtr<SecurityOrigin> origin,
Vector<String>* messages) {
@@ -97,37 +84,6 @@ WebParsedFeaturePolicy ParseFeaturePolicy(const String& policy,
return whitelists;
}
-WebParsedFeaturePolicy GetContainerPolicyFromAllowedFeatures(
- const WebVector<WebFeaturePolicyFeature>& features,
- bool allowfullscreen,
- bool allowpayment,
- RefPtr<SecurityOrigin> origin) {
- Vector<WebParsedFeaturePolicyDeclaration> whitelists;
- bool override_payment = false;
- bool override_fullscreen = false;
- for (const WebFeaturePolicyFeature feature : features) {
- // Container policy should override "allowfullscreen" and
- // "allowpaymentrequest" policies.
- if (feature == WebFeaturePolicyFeature::kPayment)
- override_payment = true;
- if (feature == WebFeaturePolicyFeature::kFullscreen)
- override_fullscreen = true;
-
- WebParsedFeaturePolicyDeclaration whitelist;
- whitelist.feature = feature;
- whitelist.origins = Vector<WebSecurityOrigin>(1UL, {origin});
- whitelists.push_back(whitelist);
- }
- // If allowfullscreen attribute is present and no fullscreen policy is set,
- // enable the feature for all origins; similarly for allowpaymentrequest.
- if (allowpayment && !override_payment)
- AddAllowFeatureToList(WebFeaturePolicyFeature::kPayment, whitelists);
- if (allowfullscreen && !override_fullscreen)
- AddAllowFeatureToList(WebFeaturePolicyFeature::kFullscreen, whitelists);
-
- return whitelists;
-}
-
bool IsSupportedInFeaturePolicy(WebFeaturePolicyFeature feature) {
switch (feature) {
// TODO(lunalu): Re-enabled fullscreen in feature policy once tests have

Powered by Google App Engine
This is Rietveld 408576698