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

Unified Diff: mojo/edk/system/channel_endpoint_id.h

Issue 683583002: Update mojo sdk to rev e083961bf11fd0c94d40be8853761da529b6d444 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: mojo/edk/system/channel_endpoint_id.h
diff --git a/mojo/edk/system/channel_endpoint_id.h b/mojo/edk/system/channel_endpoint_id.h
index c67325878c6fbe3c69f0b1b8a600216ff3309064..241871e46aa9e4f2c427dc0fe48a2b844ad4a426 100644
--- a/mojo/edk/system/channel_endpoint_id.h
+++ b/mojo/edk/system/channel_endpoint_id.h
@@ -13,6 +13,7 @@
#include "base/containers/hash_tables.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
+#include "build/build_config.h"
#include "mojo/edk/system/system_impl_export.h"
namespace mojo {
@@ -132,9 +133,11 @@ class MOJO_SYSTEM_IMPL_EXPORT RemoteChannelEndpointIdGenerator {
// Define "hash" functions for |ChannelEndpointId|s, so they can be used in hash
// tables.
// TODO(vtl): Once we can use |std::unordered_{map,set}|, update this (and
-// remove the base/containers/hash_tables.h include).
+// remove the base/containers/hash_tables.h and build/build_config.h includes).
namespace BASE_HASH_NAMESPACE {
+#if defined(COMPILER_GCC)
jamesr 2014/10/27 20:28:20 actually we don't need this any more, the hashing
Aaron Boodman 2014/10/28 22:38:47 Done.
+
template <>
struct hash<mojo::system::ChannelEndpointId> {
size_t operator()(mojo::system::ChannelEndpointId channel_endpoint_id) const {
@@ -142,6 +145,13 @@ struct hash<mojo::system::ChannelEndpointId> {
}
};
+#elif defined(COMPILER_MSVC)
+
+inline size_t hash_value(mojo::system::ChannelEndpointId channel_endpoint_id) {
+ return static_cast<size_t>(channel_endpoint_id.value());
+}
+#endif
+
} // namespace BASE_HASH_NAMESPACE
#endif // MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_ID_H_

Powered by Google App Engine
This is Rietveld 408576698