Chromium Code Reviews| 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 |