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 #ifndef CHROME_BROWSER_METRICS_PROCESS_MEMORY_METRICS_EMITTER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_PROCESS_MEMORY_METRICS_EMITTER_H_ |
6 #define CHROME_BROWSER_METRICS_PROCESS_MEMORY_METRICS_EMITTER_H_ | 6 #define CHROME_BROWSER_METRICS_PROCESS_MEMORY_METRICS_EMITTER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.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 | 10 |
11 // This class asynchronously fetches memory metrics for each process, and then | 11 // This class asynchronously fetches memory metrics for each process, and then |
12 // emits UMA metrics from those metrics. | 12 // emits UMA metrics from those metrics. |
13 // Each instance is self-owned, and will delete itself once it has finished | 13 // Each instance is self-owned, and will delete itself once it has finished |
14 // emitting metrics. | 14 // emitting metrics. |
15 // This class is an analog to MetricsMemoryDetails, but uses the resource | 15 // This class is an analog to MetricsMemoryDetails, but uses the resource |
16 // coordinator service to fetch data, rather than doing all the processing | 16 // coordinator service to fetch data, rather than doing all the processing |
17 // manually. | 17 // manually. |
18 class ProcessMemoryMetricsEmitter | 18 class ProcessMemoryMetricsEmitter |
19 : public base::RefCountedThreadSafe<ProcessMemoryMetricsEmitter> { | 19 : public base::RefCountedThreadSafe<ProcessMemoryMetricsEmitter> { |
(...skipping 14 matching lines...) Expand all Loading... |
34 | 34 |
35 private: | 35 private: |
36 friend class base::RefCountedThreadSafe<ProcessMemoryMetricsEmitter>; | 36 friend class base::RefCountedThreadSafe<ProcessMemoryMetricsEmitter>; |
37 | 37 |
38 memory_instrumentation::mojom::CoordinatorPtr coordinator_; | 38 memory_instrumentation::mojom::CoordinatorPtr coordinator_; |
39 | 39 |
40 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryMetricsEmitter); | 40 DISALLOW_COPY_AND_ASSIGN(ProcessMemoryMetricsEmitter); |
41 }; | 41 }; |
42 | 42 |
43 #endif // CHROME_BROWSER_METRICS_PROCESS_MEMORY_METRICS_EMITTER_H_ | 43 #endif // CHROME_BROWSER_METRICS_PROCESS_MEMORY_METRICS_EMITTER_H_ |
OLD | NEW |