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

Unified Diff: third_party/WebKit/Source/core/html/WebFeaturePolicyFeatureHash.h

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/core/html/WebFeaturePolicyFeatureHash.h
diff --git a/third_party/WebKit/Source/core/html/WebFeaturePolicyFeatureHash.h b/third_party/WebKit/Source/core/html/WebFeaturePolicyFeatureHash.h
new file mode 100644
index 0000000000000000000000000000000000000000..3539019ab710acffba3e74553fdda09d95a9dbf5
--- /dev/null
+++ b/third_party/WebKit/Source/core/html/WebFeaturePolicyFeatureHash.h
@@ -0,0 +1,34 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
iclelland 2017/02/08 15:06:24 2017 here, too
lunalu1 2017/02/08 19:50:30 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WebFeaturePolicyFeatureHash_h
+#define WebFeaturePolicyFeatureHash_h
+
+#include "public/platform/WebFeaturePolicy.h"
+#include "wtf/HashSet.h"
+
+namespace WTF {
+
+template <>
+struct DefaultHash<blink::WebFeaturePolicyFeature> {
+ STATIC_ONLY(DefaultHash);
+ using Hash = IntHash<blink::WebFeaturePolicyFeature>;
+};
+
+template <>
+struct HashTraits<blink::WebFeaturePolicyFeature>
+ : UnsignedWithZeroKeyHashTraits<blink::WebFeaturePolicyFeature> {
iclelland 2017/02/08 15:06:24 I think you could use a GenericHashTraits here, si
lunalu1 2017/02/08 19:50:30 Done.
+ 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 // WebFeaturePolicyFeatureHash_h

Powered by Google App Engine
This is Rietveld 408576698