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

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

Issue 2680083002: Initial Implementation of Iframe Attribute for Feature Policy (Part 1) (Closed)
Patch Set: Codereview: nit Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f2d6cf5d8e37698a773244b532c72dc583bef7c0..cc07f33c685125a005bab321803a8f04089a884a 100644
--- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
+++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
@@ -4,6 +4,7 @@
#include "platform/feature_policy/FeaturePolicy.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/json/JSONValues.h"
#include "platform/network/HTTPParsers.h"
#include "platform/weborigin/KURL.h"
@@ -59,6 +60,41 @@ const FeaturePolicy::Feature kVibrateFeature{
const FeaturePolicy::Feature kWebRTC{
"webrtc", FeaturePolicy::FeatureDefault::EnableForAll};
+WebFeaturePolicyFeature FeaturePolicy::getWebFeaturePolicyFeature(
+ const String& feature) {
+ if (feature == "fullscreen")
+ return WebFeaturePolicyFeature::Fullscreen;
+ if (feature == "payment")
+ return WebFeaturePolicyFeature::Payment;
+ if (feature == "vibrate")
+ return WebFeaturePolicyFeature::Vibrate;
+ if (feature == "usermedia")
+ return WebFeaturePolicyFeature::Usermedia;
+ if (RuntimeEnabledFeatures::featurePolicyExperimentalFeaturesEnabled()) {
+ if (feature == "cookie")
+ return WebFeaturePolicyFeature::DocumentCookie;
+ if (feature == "domain")
+ return WebFeaturePolicyFeature::DocumentDomain;
+ if (feature == "docwrite")
+ return WebFeaturePolicyFeature::DocumentWrite;
+ if (feature == "geolocation")
+ return WebFeaturePolicyFeature::Geolocation;
+ if (feature == "midi")
+ return WebFeaturePolicyFeature::MidiFeature;
+ if (feature == "notifications")
+ return WebFeaturePolicyFeature::Notifications;
+ if (feature == "push")
+ return WebFeaturePolicyFeature::Push;
+ if (feature == "sync-script")
+ return WebFeaturePolicyFeature::SyncScript;
+ if (feature == "sync-xhr")
+ return WebFeaturePolicyFeature::SyncXHR;
+ if (feature == "webrtc")
+ return WebFeaturePolicyFeature::WebRTC;
+ }
+ return WebFeaturePolicyFeature::NotFound;
+}
+
// static
std::unique_ptr<FeaturePolicy::Whitelist> FeaturePolicy::Whitelist::from(
const WebParsedFeaturePolicyDeclaration& parsedDeclaration) {
« no previous file with comments | « third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698