| 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 MOJO_PUBLIC_CPP_BINDINGS_LIB_WTF_HASH_UTIL_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_WTF_HASH_UTIL_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_WTF_HASH_UTIL_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_WTF_HASH_UTIL_H_ |
| 7 | 7 |
| 8 #include <type_traits> | 8 #include <type_traits> |
| 9 | 9 |
| 10 #include "mojo/public/cpp/bindings/lib/hash_util.h" | 10 #include "mojo/public/cpp/bindings/lib/hash_util.h" |
| 11 #include "mojo/public/cpp/bindings/struct_ptr.h" | 11 #include "mojo/public/cpp/bindings/struct_ptr.h" |
| 12 #include "third_party/WebKit/Source/wtf/HashFunctions.h" | 12 #include "third_party/WebKit/Source/platform/wtf/HashFunctions.h" |
| 13 #include "third_party/WebKit/Source/wtf/text/StringHash.h" | 13 #include "third_party/WebKit/Source/platform/wtf/text/StringHash.h" |
| 14 #include "third_party/WebKit/Source/wtf/text/WTFString.h" | 14 #include "third_party/WebKit/Source/platform/wtf/text/WTFString.h" |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 namespace internal { | 17 namespace internal { |
| 18 | 18 |
| 19 template <typename T> | 19 template <typename T> |
| 20 size_t WTFHashCombine(size_t seed, const T& value) { | 20 size_t WTFHashCombine(size_t seed, const T& value) { |
| 21 // Based on proposal in: | 21 // Based on proposal in: |
| 22 // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf | 22 // http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf |
| 23 // | 23 // |
| 24 // TODO(tibell): We'd like to use WTF::DefaultHash instead of std::hash, but | 24 // TODO(tibell): We'd like to use WTF::DefaultHash instead of std::hash, but |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 123 } |
| 124 static bool IsDeletedValue(const mojo::InlinedStructPtr<T>& value) { | 124 static bool IsDeletedValue(const mojo::InlinedStructPtr<T>& value) { |
| 125 return mojo::internal::InlinedStructPtrWTFHelper< | 125 return mojo::internal::InlinedStructPtrWTFHelper< |
| 126 T>::IsHashTableDeletedValue(value); | 126 T>::IsHashTableDeletedValue(value); |
| 127 } | 127 } |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 } // namespace WTF | 130 } // namespace WTF |
| 131 | 131 |
| 132 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_WTF_HASH_UTIL_H_ | 132 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_WTF_HASH_UTIL_H_ |
| OLD | NEW |