OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROME_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 15 matching lines...) Expand all Loading... |
26 class ChromeOSMetricsProvider; | 26 class ChromeOSMetricsProvider; |
27 class GoogleUpdateMetricsProviderWin; | 27 class GoogleUpdateMetricsProviderWin; |
28 class PluginMetricsProvider; | 28 class PluginMetricsProvider; |
29 class PrefRegistrySimple; | 29 class PrefRegistrySimple; |
30 class PrefService; | 30 class PrefService; |
31 | 31 |
32 #if !defined(OS_CHROMEOS) | 32 #if !defined(OS_CHROMEOS) |
33 class SigninStatusMetricsProvider; | 33 class SigninStatusMetricsProvider; |
34 #endif | 34 #endif |
35 | 35 |
| 36 namespace browser_watcher { |
| 37 class WatcherMetricsProviderWin; |
| 38 } // namespace browser_watcher |
| 39 |
36 namespace metrics { | 40 namespace metrics { |
37 class DriveMetricsProvider; | 41 class DriveMetricsProvider; |
38 class MetricsService; | 42 class MetricsService; |
39 class MetricsStateManager; | 43 class MetricsStateManager; |
40 class ProfilerMetricsProvider; | 44 class ProfilerMetricsProvider; |
41 } // namespace metrics | 45 } // namespace metrics |
42 | 46 |
43 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient | 47 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient |
44 // that depends on chrome/. | 48 // that depends on chrome/. |
45 class ChromeMetricsServiceClient | 49 class ChromeMetricsServiceClient |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void OnInitTaskGotPluginInfo(); | 106 void OnInitTaskGotPluginInfo(); |
103 | 107 |
104 // Called after GoogleUpdate init task has been completed that continues the | 108 // Called after GoogleUpdate init task has been completed that continues the |
105 // init task by loading AntiVirus metrics. | 109 // init task by loading AntiVirus metrics. |
106 void OnInitTaskGotGoogleUpdateData(); | 110 void OnInitTaskGotGoogleUpdateData(); |
107 | 111 |
108 // Called after AntiVirus init task has been completed that continues the | 112 // Called after AntiVirus init task has been completed that continues the |
109 // init task by loading drive metrics. | 113 // init task by loading drive metrics. |
110 void OnInitTaskGotAntiVirusData(); | 114 void OnInitTaskGotAntiVirusData(); |
111 | 115 |
112 // Called after the drive metrics init task has been completed that continues | 116 // Called after the drive metrics init task has been completed to continue |
113 // the init task by loading profiler data. | 117 // the init task by optionally collecting postmortem reports. |
114 void OnInitTaskGotDriveMetrics(); | 118 void OnInitTaskGotDriveMetrics(); |
115 | 119 |
| 120 // Called after the postmortem report collection task has been completed to |
| 121 // continue the init task by loading profiler data. |
| 122 void OnInitTaskCollectedPostmortemReports(); |
| 123 |
116 // Returns true iff profiler data should be included in the next metrics log. | 124 // Returns true iff profiler data should be included in the next metrics log. |
117 // NOTE: This method is probabilistic and also updates internal state as a | 125 // NOTE: This method is probabilistic and also updates internal state as a |
118 // side-effect when called, so it should only be called once per log. | 126 // side-effect when called, so it should only be called once per log. |
119 bool ShouldIncludeProfilerDataInLog(); | 127 bool ShouldIncludeProfilerDataInLog(); |
120 | 128 |
121 // TrackingSynchronizerObserver: | 129 // TrackingSynchronizerObserver: |
122 void ReceivedProfilerData( | 130 void ReceivedProfilerData( |
123 const metrics::ProfilerDataAttributes& attributes, | 131 const metrics::ProfilerDataAttributes& attributes, |
124 const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase, | 132 const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase, |
125 const metrics::ProfilerEvents& past_profiler_events) override; | 133 const metrics::ProfilerEvents& past_profiler_events) override; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // The PluginMetricsProvider instance that was registered with | 196 // The PluginMetricsProvider instance that was registered with |
189 // MetricsService. Has the same lifetime as |metrics_service_|. | 197 // MetricsService. Has the same lifetime as |metrics_service_|. |
190 PluginMetricsProvider* plugin_metrics_provider_; | 198 PluginMetricsProvider* plugin_metrics_provider_; |
191 #endif | 199 #endif |
192 | 200 |
193 #if defined(OS_WIN) | 201 #if defined(OS_WIN) |
194 // The GoogleUpdateMetricsProviderWin instance that was registered with | 202 // The GoogleUpdateMetricsProviderWin instance that was registered with |
195 // MetricsService. Has the same lifetime as |metrics_service_|. | 203 // MetricsService. Has the same lifetime as |metrics_service_|. |
196 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; | 204 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; |
197 | 205 |
| 206 // The WatcherMetricsProviderWin instance that was registered with |
| 207 // MetricsService. Has the same lifetime as |metrics_service_|. |
| 208 browser_watcher::WatcherMetricsProviderWin* watcher_metrics_provider_; |
| 209 |
198 // The AntiVirusMetricsProvider instance that was registered with | 210 // The AntiVirusMetricsProvider instance that was registered with |
199 // MetricsService. Has the same lifetime as |metrics_service_|. | 211 // MetricsService. Has the same lifetime as |metrics_service_|. |
200 AntiVirusMetricsProvider* antivirus_metrics_provider_; | 212 AntiVirusMetricsProvider* antivirus_metrics_provider_; |
201 #endif | 213 #endif |
202 | 214 |
203 // The DriveMetricsProvider instance that was registered with MetricsService. | 215 // The DriveMetricsProvider instance that was registered with MetricsService. |
204 // Has the same lifetime as |metrics_service_|. | 216 // Has the same lifetime as |metrics_service_|. |
205 metrics::DriveMetricsProvider* drive_metrics_provider_; | 217 metrics::DriveMetricsProvider* drive_metrics_provider_; |
206 | 218 |
207 // Callback that is called when initial metrics gathering is complete. | 219 // Callback that is called when initial metrics gathering is complete. |
(...skipping 18 matching lines...) Expand all Loading... |
226 // Whether this client has already uploaded profiler data during this session. | 238 // Whether this client has already uploaded profiler data during this session. |
227 // Profiler data is uploaded at most once per session. | 239 // Profiler data is uploaded at most once per session. |
228 bool has_uploaded_profiler_data_; | 240 bool has_uploaded_profiler_data_; |
229 | 241 |
230 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; | 242 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; |
231 | 243 |
232 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); | 244 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); |
233 }; | 245 }; |
234 | 246 |
235 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 247 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |