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

Unified Diff: services/service_manager/public/cpp/identity.h

Issue 2875673003: [Memory-UMA] Add ProcessMap, an Identity to Pid map (Closed)
Patch Set: Rebase Created 3 years, 7 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
« no previous file with comments | « services/resource_coordinator/memory/coordinator/process_map.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « services/resource_coordinator/memory/coordinator/process_map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698