Index: services/service_manager/public/cpp/identity.h |
diff --git a/services/service_manager/public/cpp/identity.h b/services/service_manager/public/cpp/identity.h |
index 7df541e11b2da36efbf5013f7a050547a96f681b..022c4a05576b360a7b5b3ffc9b58738085206080 100644 |
--- a/services/service_manager/public/cpp/identity.h |
+++ b/services/service_manager/public/cpp/identity.h |
@@ -7,6 +7,8 @@ |
#include <string> |
+#include "base/hash.h" |
+ |
namespace service_manager { |
// Represents the identity of an application. |
@@ -42,4 +44,16 @@ class Identity { |
} // namespace service_manager |
+namespace std { |
+ |
+template <> |
+struct hash<service_manager::Identity> { |
+ std::size_t operator()(const service_manager::Identity& identity) const { |
+ return base::Hash(identity.name() + identity.user_id() + |
+ identity.instance()); |
+ } |
+}; |
+ |
+} // namespace std |
+ |
#endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_IDENTITY_H_ |