OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_TRACING_PROCESS_METRICS_MEMORY_DUMP_MANAGER_H_ | |
6 #define COMPONENTS_TRACING_PROCESS_METRICS_MEMORY_DUMP_MANAGER_H_ | |
7 | |
8 #include "base/containers/scoped_ptr_map.h" | |
9 #include "base/macros.h" | |
10 #include "base/memory/singleton.h" | |
11 #include "base/process/process_handle.h" | |
12 #include "components/tracing/tracing_export.h" | |
13 | |
14 namespace tracing { | |
15 | |
16 class ProcessMetricsMemoryDumpProvider; | |
17 | |
18 // Creates and registeres the ProcessMetricsMemoryDumpProvider for current | |
19 // process and its children. Controls the lifetime of the providers. | |
20 class TRACING_EXPORT ProcessMetricsMemoryDumpManager { | |
Primiano Tucci (use gerrit)
2015/11/17 10:44:12
hmm we have way too many managers in memory-infra.
ssid
2015/11/17 11:13:07
This would mean that there is a global std::map (n
ssid
2015/11/17 13:55:06
Done.
| |
21 public: | |
22 static ProcessMetricsMemoryDumpManager* GetInstance(); | |
23 | |
24 // Pass base::kNullProcessHandle to register for current process. | |
25 void RegisterForProcess(base::ProcessHandle process); | |
26 void UnregisterForProcess(base::ProcessHandle process); | |
27 | |
28 private: | |
29 friend struct base::DefaultSingletonTraits<ProcessMetricsMemoryDumpManager>; | |
30 | |
31 using ProcessMetricsDumpProvidersMap = | |
32 base::ScopedPtrMap<base::ProcessHandle, | |
33 scoped_ptr<ProcessMetricsMemoryDumpProvider>>; | |
34 | |
35 ProcessMetricsMemoryDumpManager(); | |
36 ~ProcessMetricsMemoryDumpManager(); | |
37 | |
38 ProcessMetricsDumpProvidersMap process_metrics_providers_map_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(ProcessMetricsMemoryDumpManager); | |
41 }; | |
42 | |
43 } // namespace tracing | |
44 | |
45 #endif // COMPONENTS_TRACING_PROCESS_METRICS_MEMORY_DUMP_MANAGER_H_ | |
OLD | NEW |