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 String16WTF_h | 5 #ifndef String16WTF_h |
6 #define String16WTF_h | 6 #define String16WTF_h |
7 | 7 |
8 #include "platform/Decimal.h" | 8 #include "platform/Decimal.h" |
9 #include "public/platform/WebString.h" | 9 #include "public/platform/WebString.h" |
10 #include "wtf/text/StringBuilder.h" | 10 #include "wtf/text/StringBuilder.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 }; | 131 }; |
132 | 132 |
133 template<> | 133 template<> |
134 struct HashTraits<String16> : SimpleClassHashTraits<String16> { | 134 struct HashTraits<String16> : SimpleClassHashTraits<String16> { |
135 static const bool hasIsEmptyValueFunction = true; | 135 static const bool hasIsEmptyValueFunction = true; |
136 static bool isEmptyValue(const String16& a) { return a.impl().isNull(); } | 136 static bool isEmptyValue(const String16& a) { return a.impl().isNull(); } |
137 }; | 137 }; |
138 | 138 |
139 } // namespace WTF | 139 } // namespace WTF |
140 | 140 |
| 141 namespace std { |
| 142 template<> struct hash<String16> { |
| 143 std::size_t operator()(const String16& string) const |
| 144 { |
| 145 return StringHash::hash(string.impl()); |
| 146 } |
| 147 }; |
| 148 |
| 149 } // namespace std |
| 150 |
141 #endif // !defined(String16WTF_h) | 151 #endif // !defined(String16WTF_h) |
OLD | NEW |