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

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: Removed getAllowedFeatureNames() from HTMLIFrameElement 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
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 44d6c96359a7499994c6a3ded2c65001bcdcc404..cee06033f88565f2a39fc6d2388964db0c35b35d 100644
--- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
+++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
@@ -59,6 +59,39 @@ const FeaturePolicy::Feature kVibrateFeature{
const FeaturePolicy::Feature kWebRTC{
"webrtc", FeaturePolicy::FeatureDefault::EnableForAll};
+WebFeaturePolicyFeature FeaturePolicy::getWebFeaturePolicyFeature(
+ const String& feature) {
+ if (feature == "cookie")
+ return WebFeaturePolicyFeature::DocumentCookie;
+ if (feature == "domain")
+ return WebFeaturePolicyFeature::DocumentDomain;
+ if (feature == "docwrite")
+ return WebFeaturePolicyFeature::DocumentWrite;
+ if (feature == "fullscreen")
+ return WebFeaturePolicyFeature::Fullscreen;
+ if (feature == "geolocation")
+ return WebFeaturePolicyFeature::Geolocation;
+ if (feature == "midi")
+ return WebFeaturePolicyFeature::MidiFeature;
+ if (feature == "notifications")
+ return WebFeaturePolicyFeature::Notifications;
+ if (feature == "payment")
+ return WebFeaturePolicyFeature::Payment;
+ if (feature == "push")
+ return WebFeaturePolicyFeature::Push;
+ if (feature == "sync-script")
+ return WebFeaturePolicyFeature::SyncScript;
+ if (feature == "sync-xhr")
+ return WebFeaturePolicyFeature::SyncXHR;
+ if (feature == "usermedia")
+ return WebFeaturePolicyFeature::Usermedia;
+ if (feature == "vibrate")
+ return WebFeaturePolicyFeature::Vibrate;
+ if (feature == "webrtc")
+ return WebFeaturePolicyFeature::WebRTC;
+ return WebFeaturePolicyFeature::NotFound;
+}
+
// static
std::unique_ptr<FeaturePolicy::Whitelist> FeaturePolicy::Whitelist::from(
const WebFeaturePolicy::ParsedWhitelist& parsedWhitelist) {

Powered by Google App Engine
This is Rietveld 408576698