| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "chrome/browser/metrics/metrics_memory_details.h" | 18 #include "chrome/browser/metrics/metrics_memory_details.h" |
| 19 #include "components/metrics/metrics_service_client.h" | 19 #include "components/metrics/metrics_service_client.h" |
| 20 #include "components/metrics/profiler/tracking_synchronizer_observer.h" | 20 #include "components/metrics/profiler/tracking_synchronizer_observer.h" |
| 21 #include "components/omnibox/browser/omnibox_event_global_tracker.h" | 21 #include "components/omnibox/browser/omnibox_event_global_tracker.h" |
| 22 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
| 23 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
| 24 | 24 |
| 25 class AntiVirusMetricsProvider; |
| 25 class ChromeOSMetricsProvider; | 26 class ChromeOSMetricsProvider; |
| 26 class GoogleUpdateMetricsProviderWin; | 27 class GoogleUpdateMetricsProviderWin; |
| 27 class PluginMetricsProvider; | 28 class PluginMetricsProvider; |
| 28 class PrefRegistrySimple; | 29 class PrefRegistrySimple; |
| 29 class PrefService; | 30 class PrefService; |
| 30 | 31 |
| 31 #if !defined(OS_CHROMEOS) | 32 #if !defined(OS_CHROMEOS) |
| 32 class SigninStatusMetricsProvider; | 33 class SigninStatusMetricsProvider; |
| 33 #endif | 34 #endif |
| 34 | 35 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void OnInitTaskGotHardwareClass(); | 97 void OnInitTaskGotHardwareClass(); |
| 97 | 98 |
| 98 // Callback that continues the init task by loading plugin information. | 99 // Callback that continues the init task by loading plugin information. |
| 99 void OnInitTaskGotBluetoothAdapter(); | 100 void OnInitTaskGotBluetoothAdapter(); |
| 100 | 101 |
| 101 // Called after the Plugin init task has been completed that continues the | 102 // Called after the Plugin init task has been completed that continues the |
| 102 // init task by launching a task to gather Google Update statistics. | 103 // init task by launching a task to gather Google Update statistics. |
| 103 void OnInitTaskGotPluginInfo(); | 104 void OnInitTaskGotPluginInfo(); |
| 104 | 105 |
| 105 // Called after GoogleUpdate init task has been completed that continues the | 106 // Called after GoogleUpdate init task has been completed that continues the |
| 107 // init task by loading AntiVirus metrics. |
| 108 void OnInitTaskGotGoogleUpdateData(); |
| 109 |
| 110 // Called after AntiVirus init task has been completed that continues the |
| 106 // init task by loading drive metrics. | 111 // init task by loading drive metrics. |
| 107 void OnInitTaskGotGoogleUpdateData(); | 112 void OnInitTaskGotAntiVirusData(); |
| 108 | 113 |
| 109 // Called after the drive metrics init task has been completed that continues | 114 // Called after the drive metrics init task has been completed that continues |
| 110 // the init task by loading profiler data. | 115 // the init task by loading profiler data. |
| 111 void OnInitTaskGotDriveMetrics(); | 116 void OnInitTaskGotDriveMetrics(); |
| 112 | 117 |
| 113 // Returns true iff profiler data should be included in the next metrics log. | 118 // Returns true iff profiler data should be included in the next metrics log. |
| 114 // NOTE: This method is probabilistic and also updates internal state as a | 119 // NOTE: This method is probabilistic and also updates internal state as a |
| 115 // side-effect when called, so it should only be called once per log. | 120 // side-effect when called, so it should only be called once per log. |
| 116 bool ShouldIncludeProfilerDataInLog(); | 121 bool ShouldIncludeProfilerDataInLog(); |
| 117 | 122 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 #if defined(ENABLE_PLUGINS) | 188 #if defined(ENABLE_PLUGINS) |
| 184 // The PluginMetricsProvider instance that was registered with | 189 // The PluginMetricsProvider instance that was registered with |
| 185 // MetricsService. Has the same lifetime as |metrics_service_|. | 190 // MetricsService. Has the same lifetime as |metrics_service_|. |
| 186 PluginMetricsProvider* plugin_metrics_provider_; | 191 PluginMetricsProvider* plugin_metrics_provider_; |
| 187 #endif | 192 #endif |
| 188 | 193 |
| 189 #if defined(OS_WIN) | 194 #if defined(OS_WIN) |
| 190 // The GoogleUpdateMetricsProviderWin instance that was registered with | 195 // The GoogleUpdateMetricsProviderWin instance that was registered with |
| 191 // MetricsService. Has the same lifetime as |metrics_service_|. | 196 // MetricsService. Has the same lifetime as |metrics_service_|. |
| 192 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; | 197 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; |
| 198 |
| 199 // The AntiVirusMetricsProvider instance that was registered with |
| 200 // MetricsService. Has the same lifetime as |metrics_service_|. |
| 201 AntiVirusMetricsProvider* antivirus_metrics_provider_; |
| 193 #endif | 202 #endif |
| 194 | 203 |
| 195 // The DriveMetricsProvider instance that was registered with MetricsService. | 204 // The DriveMetricsProvider instance that was registered with MetricsService. |
| 196 // Has the same lifetime as |metrics_service_|. | 205 // Has the same lifetime as |metrics_service_|. |
| 197 metrics::DriveMetricsProvider* drive_metrics_provider_; | 206 metrics::DriveMetricsProvider* drive_metrics_provider_; |
| 198 | 207 |
| 199 // Callback that is called when initial metrics gathering is complete. | 208 // Callback that is called when initial metrics gathering is complete. |
| 200 base::Closure finished_init_task_callback_; | 209 base::Closure finished_init_task_callback_; |
| 201 | 210 |
| 202 // The MemoryGrowthTracker instance that tracks memory usage growth in | 211 // The MemoryGrowthTracker instance that tracks memory usage growth in |
| (...skipping 15 matching lines...) Expand all Loading... |
| 218 // Whether this client has already uploaded profiler data during this session. | 227 // Whether this client has already uploaded profiler data during this session. |
| 219 // Profiler data is uploaded at most once per session. | 228 // Profiler data is uploaded at most once per session. |
| 220 bool has_uploaded_profiler_data_; | 229 bool has_uploaded_profiler_data_; |
| 221 | 230 |
| 222 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; | 231 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; |
| 223 | 232 |
| 224 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); | 233 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); |
| 225 }; | 234 }; |
| 226 | 235 |
| 227 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 236 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |