OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "services/resource_coordinator/memory/coordinator/process_map.h" | 5 #include "services/resource_coordinator/memory_instrumentation/process_map.h" |
6 | 6 |
7 #include "base/process/process_handle.h" | 7 #include "base/process/process_handle.h" |
8 #include "mojo/public/cpp/bindings/binding.h" | 8 #include "mojo/public/cpp/bindings/binding.h" |
9 #include "services/resource_coordinator/public/interfaces/memory/memory_instrume
ntation.mojom.h" | 9 #include "services/resource_coordinator/public/interfaces/memory_instrumentation
/memory_instrumentation.mojom.h" |
10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
11 #include "services/service_manager/public/cpp/identity.h" | 11 #include "services/service_manager/public/cpp/identity.h" |
12 #include "services/service_manager/public/interfaces/constants.mojom.h" | 12 #include "services/service_manager/public/interfaces/constants.mojom.h" |
13 #include "services/service_manager/public/interfaces/service_manager.mojom.h" | 13 #include "services/service_manager/public/interfaces/service_manager.mojom.h" |
14 | 14 |
15 namespace memory_instrumentation { | 15 namespace memory_instrumentation { |
16 | 16 |
17 ProcessMap::ProcessMap(service_manager::Connector* connector) : binding_(this) { | 17 ProcessMap::ProcessMap(service_manager::Connector* connector) : binding_(this) { |
18 if (!connector) | 18 if (!connector) |
19 return; // Happens in unittests. | 19 return; // Happens in unittests. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 instances_.erase(identity); | 54 instances_.erase(identity); |
55 } | 55 } |
56 | 56 |
57 base::ProcessId ProcessMap::GetProcessId( | 57 base::ProcessId ProcessMap::GetProcessId( |
58 const service_manager::Identity& identity) const { | 58 const service_manager::Identity& identity) const { |
59 auto it = instances_.find(identity); | 59 auto it = instances_.find(identity); |
60 return it != instances_.end() ? it->second : base::kNullProcessId; | 60 return it != instances_.end() ? it->second : base::kNullProcessId; |
61 } | 61 } |
62 | 62 |
63 } // namespace memory_instrumentation | 63 } // namespace memory_instrumentation |
OLD | NEW |