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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/containers/scoped_ptr_map.h" | 12 #include "base/containers/scoped_ptr_map.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
16 #include "chrome/browser/metrics/metrics_memory_details.h" | 16 #include "chrome/browser/metrics/metrics_memory_details.h" |
17 #include "components/metrics/metrics_service_client.h" | 17 #include "components/metrics/metrics_service_client.h" |
18 #include "components/metrics/profiler/tracking_synchronizer_observer.h" | 18 #include "components/metrics/profiler/tracking_synchronizer_observer.h" |
19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
21 | 21 |
22 class ChromeOSMetricsProvider; | 22 class ChromeOSMetricsProvider; |
23 class DriveMetricsProvider; | |
24 class GoogleUpdateMetricsProviderWin; | 23 class GoogleUpdateMetricsProviderWin; |
25 class PluginMetricsProvider; | 24 class PluginMetricsProvider; |
26 class PrefRegistrySimple; | 25 class PrefRegistrySimple; |
27 class PrefService; | 26 class PrefService; |
28 class ProcessResourceUsage; | 27 class ProcessResourceUsage; |
29 | 28 |
30 #if !defined(OS_CHROMEOS) && !defined(OS_IOS) | 29 #if !defined(OS_CHROMEOS) && !defined(OS_IOS) |
31 class SigninStatusMetricsProvider; | 30 class SigninStatusMetricsProvider; |
32 #endif | 31 #endif |
33 | 32 |
34 namespace base { | 33 namespace base { |
35 class FilePath; | 34 class FilePath; |
36 } // namespace base | 35 } // namespace base |
37 | 36 |
38 namespace metrics { | 37 namespace metrics { |
| 38 class DriveMetricsProvider; |
39 class MetricsService; | 39 class MetricsService; |
40 class MetricsStateManager; | 40 class MetricsStateManager; |
41 class ProfilerMetricsProvider; | 41 class ProfilerMetricsProvider; |
42 } // namespace metrics | 42 } // namespace metrics |
43 | 43 |
44 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient | 44 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient |
45 // that depends on chrome/. | 45 // that depends on chrome/. |
46 class ChromeMetricsServiceClient | 46 class ChromeMetricsServiceClient |
47 : public metrics::MetricsServiceClient, | 47 : public metrics::MetricsServiceClient, |
48 public metrics::TrackingSynchronizerObserver, | 48 public metrics::TrackingSynchronizerObserver, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 #endif | 167 #endif |
168 | 168 |
169 #if defined(OS_WIN) | 169 #if defined(OS_WIN) |
170 // The GoogleUpdateMetricsProviderWin instance that was registered with | 170 // The GoogleUpdateMetricsProviderWin instance that was registered with |
171 // MetricsService. Has the same lifetime as |metrics_service_|. | 171 // MetricsService. Has the same lifetime as |metrics_service_|. |
172 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; | 172 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; |
173 #endif | 173 #endif |
174 | 174 |
175 // The DriveMetricsProvider instance that was registered with MetricsService. | 175 // The DriveMetricsProvider instance that was registered with MetricsService. |
176 // Has the same lifetime as |metrics_service_|. | 176 // Has the same lifetime as |metrics_service_|. |
177 DriveMetricsProvider* drive_metrics_provider_; | 177 metrics::DriveMetricsProvider* drive_metrics_provider_; |
178 | 178 |
179 // Callback that is called when initial metrics gathering is complete. | 179 // Callback that is called when initial metrics gathering is complete. |
180 base::Closure finished_gathering_initial_metrics_callback_; | 180 base::Closure finished_gathering_initial_metrics_callback_; |
181 | 181 |
182 // The MemoryGrowthTracker instance that tracks memory usage growth in | 182 // The MemoryGrowthTracker instance that tracks memory usage growth in |
183 // MemoryDetails. | 183 // MemoryDetails. |
184 MemoryGrowthTracker memory_growth_tracker_; | 184 MemoryGrowthTracker memory_growth_tracker_; |
185 | 185 |
186 // Callback to determine whether or not a cellular network is currently being | 186 // Callback to determine whether or not a cellular network is currently being |
187 // used. | 187 // used. |
188 base::Callback<void(bool*)> cellular_callback_; | 188 base::Callback<void(bool*)> cellular_callback_; |
189 | 189 |
190 // Time of this object's creation. | 190 // Time of this object's creation. |
191 const base::TimeTicks start_time_; | 191 const base::TimeTicks start_time_; |
192 | 192 |
193 // Map of ProcessResourceUsage from render process host IDs. | 193 // Map of ProcessResourceUsage from render process host IDs. |
194 base::ScopedPtrMap<int, scoped_ptr<ProcessResourceUsage>> | 194 base::ScopedPtrMap<int, scoped_ptr<ProcessResourceUsage>> |
195 host_resource_usage_map_; | 195 host_resource_usage_map_; |
196 | 196 |
197 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; | 197 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; |
198 | 198 |
199 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); | 199 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); |
200 }; | 200 }; |
201 | 201 |
202 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 202 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |