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

Unified Diff: third_party/WebKit/public/platform/WebFeaturePolicy.h

Issue 2680083002: Initial Implementation of Iframe Attribute for Feature Policy (Part 1) (Closed)
Patch Set: Moved hash function for WebFeaturePolicyFeature to where the enum is defined for ODR purpose 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/public/platform/WebFeaturePolicy.h
diff --git a/third_party/WebKit/public/platform/WebFeaturePolicy.h b/third_party/WebKit/public/platform/WebFeaturePolicy.h
index a2c03f79605f67d1a78cbbdc5b27ad6869d3a1f9..77ce4ea9a7068cd7f8b589f224c825ae7a5c7fb6 100644
--- a/third_party/WebKit/public/platform/WebFeaturePolicy.h
+++ b/third_party/WebKit/public/platform/WebFeaturePolicy.h
@@ -8,6 +8,9 @@
#include "WebSecurityOrigin.h"
#include "WebString.h"
#include "WebVector.h"
+#if INSIDE_BLINK
+#include "wtf/HashSet.h"
+#endif
namespace blink {
@@ -22,6 +25,50 @@ struct WebFeaturePolicy {
using WebParsedFeaturePolicy = WebVector<WebFeaturePolicy::ParsedWhitelist>;
+enum class WebFeaturePolicyFeature {
Rick Byers 2017/02/09 20:59:59 iclelland is landing this now in https://coderevie
lunalu1 2017/02/09 23:19:04 Yeah, but I think it might be easier for me to lan
+ NotFound = 0,
+ DocumentCookie,
+ DocumentDomain,
+ DocumentWrite,
+ Geolocation,
+ Fullscreen,
+ MidiFeature,
+ Notifications,
+ Payment,
+ Push,
+ SyncScript,
+ SyncXHR,
+ Usermedia,
+ Vibrate,
+ WebRTC,
+ LAST_FEATURE = WebRTC
+};
+
} // namespace blink
+#if INSIDE_BLINK
+namespace WTF {
+
+template <>
+struct DefaultHash<blink::WebFeaturePolicyFeature> {
+ STATIC_ONLY(DefaultHash);
+ using Hash = IntHash<blink::WebFeaturePolicyFeature>;
+};
+
+template <>
+struct HashTraits<blink::WebFeaturePolicyFeature>
+ : GenericHashTraits<blink::WebFeaturePolicyFeature> {
+ STATIC_ONLY(HashTraits);
+ static bool isDeletedValue(const blink::WebFeaturePolicyFeature& value) {
+ return value == static_cast<blink::WebFeaturePolicyFeature>(-1);
+ }
+ static void constructDeletedValue(blink::WebFeaturePolicyFeature& slot,
+ bool) {
+ slot = static_cast<blink::WebFeaturePolicyFeature>(-1);
+ }
+};
+
+} // namespace WTF
+#endif
+
#endif // WebFeaturePolicy_h

Powered by Google App Engine
This is Rietveld 408576698