| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSPropertyIDTemplates_h | 5 #ifndef CSSPropertyIDTemplates_h |
| 6 #define CSSPropertyIDTemplates_h | 6 #define CSSPropertyIDTemplates_h |
| 7 | 7 |
| 8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
| 9 #include "wtf/HashFunctions.h" | 9 #include "wtf/HashFunctions.h" |
| 10 #include "wtf/HashTraits.h" | 10 #include "wtf/HashTraits.h" |
| 11 | 11 |
| 12 namespace WTF { | 12 namespace WTF { |
| 13 template <> | 13 template <> |
| 14 struct DefaultHash<blink::CSSPropertyID> { | 14 struct DefaultHash<blink::CSSPropertyID> { |
| 15 typedef IntHash<unsigned> Hash; | 15 typedef IntHash<unsigned> Hash; |
| 16 }; | 16 }; |
| 17 template <> | 17 template <> |
| 18 struct HashTraits<blink::CSSPropertyID> | 18 struct HashTraits<blink::CSSPropertyID> |
| 19 : GenericHashTraits<blink::CSSPropertyID> { | 19 : GenericHashTraits<blink::CSSPropertyID> { |
| 20 static const bool emptyValueIsZero = true; | 20 static const bool emptyValueIsZero = true; |
| 21 static void constructDeletedValue(blink::CSSPropertyID& slot, bool) { | 21 static void constructDeletedValue(blink::CSSPropertyID& slot, bool) { |
| 22 slot = | 22 slot = static_cast<blink::CSSPropertyID>(blink::numCSSPropertyIDs); |
| 23 static_cast<blink::CSSPropertyID>(blink::lastUnresolvedCSSProperty + 1); | |
| 24 } | 23 } |
| 25 static bool isDeletedValue(blink::CSSPropertyID value) { | 24 static bool isDeletedValue(blink::CSSPropertyID value) { |
| 26 return value == (blink::lastUnresolvedCSSProperty + 1); | 25 return value == blink::numCSSPropertyIDs; |
| 27 } | 26 } |
| 28 }; | 27 }; |
| 29 } // namespace WTF | 28 } // namespace WTF |
| 30 | 29 |
| 31 #endif // CSSPropertyIDTemplates_h | 30 #endif // CSSPropertyIDTemplates_h |
| OLD | NEW |