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/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
15 #include "chrome/browser/metrics/network_stats_uploader.h" | 15 #include "chrome/browser/metrics/network_stats_uploader.h" |
16 #include "components/metrics/metrics_service_client.h" | 16 #include "components/metrics/metrics_service_client.h" |
17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
19 | 19 |
| 20 class ChromeOSMetricsProvider; |
20 class MetricsService; | 21 class MetricsService; |
21 | 22 |
22 namespace metrics { | 23 namespace metrics { |
23 class MetricsStateManager; | 24 class MetricsStateManager; |
24 } | 25 } |
25 | 26 |
26 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient | 27 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient |
27 // that depends on chrome/. | 28 // that depends on chrome/. |
28 class ChromeMetricsServiceClient : public metrics::MetricsServiceClient, | 29 class ChromeMetricsServiceClient : public metrics::MetricsServiceClient, |
29 public content::NotificationObserver { | 30 public content::NotificationObserver { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void CountBrowserCrashDumpAttempts(); | 79 void CountBrowserCrashDumpAttempts(); |
79 #endif // OS_WIN | 80 #endif // OS_WIN |
80 | 81 |
81 base::ThreadChecker thread_checker_; | 82 base::ThreadChecker thread_checker_; |
82 | 83 |
83 // The MetricsService that |this| is a client of. | 84 // The MetricsService that |this| is a client of. |
84 scoped_ptr<MetricsService> metrics_service_; | 85 scoped_ptr<MetricsService> metrics_service_; |
85 | 86 |
86 content::NotificationRegistrar registrar_; | 87 content::NotificationRegistrar registrar_; |
87 | 88 |
| 89 // On ChromeOS, holds a weak pointer to the ChromeOSMetricsProvider instance |
| 90 // that has been registered with MetricsService. On other platforms, is NULL. |
| 91 ChromeOSMetricsProvider* chromeos_metrics_provider_; |
| 92 |
88 NetworkStatsUploader network_stats_uploader_; | 93 NetworkStatsUploader network_stats_uploader_; |
89 | 94 |
90 // Saved callback received from CollectFinalMetrics(). | 95 // Saved callback received from CollectFinalMetrics(). |
91 base::Closure collect_final_metrics_done_callback_; | 96 base::Closure collect_final_metrics_done_callback_; |
92 | 97 |
93 // Indicates that collect final metrics step is running. | 98 // Indicates that collect final metrics step is running. |
94 bool waiting_for_collect_final_metrics_step_; | 99 bool waiting_for_collect_final_metrics_step_; |
95 | 100 |
96 // Number of async histogram fetch requests in progress. | 101 // Number of async histogram fetch requests in progress. |
97 int num_async_histogram_fetches_in_progress_; | 102 int num_async_histogram_fetches_in_progress_; |
98 | 103 |
99 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; | 104 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; |
100 | 105 |
101 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); | 106 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); |
102 }; | 107 }; |
103 | 108 |
104 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 109 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |