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/bind.h" | |
Ilya Sherman
2014/05/21 13:37:07
nit: base/callback.h
Alexei Svitkine (slow)
2014/05/21 14:20:15
Done.
| |
12 #include "base/memory/weak_ptr.h" | |
11 #include "components/metrics/metrics_service_client.h" | 13 #include "components/metrics/metrics_service_client.h" |
12 | 14 |
13 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient | 15 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient |
14 // that depends on chrome/. | 16 // that depends on chrome/. |
15 class ChromeMetricsServiceClient : public metrics::MetricsServiceClient { | 17 class ChromeMetricsServiceClient : public metrics::MetricsServiceClient { |
16 public: | 18 public: |
17 ChromeMetricsServiceClient(); | 19 ChromeMetricsServiceClient(); |
18 virtual ~ChromeMetricsServiceClient(); | 20 virtual ~ChromeMetricsServiceClient(); |
19 | 21 |
20 // metrics::MetricsServiceClient: | 22 // metrics::MetricsServiceClient: |
21 virtual void SetClientID(const std::string& client_id) OVERRIDE; | 23 virtual void SetClientID(const std::string& client_id) OVERRIDE; |
22 virtual bool IsOffTheRecordSessionActive() OVERRIDE; | 24 virtual bool IsOffTheRecordSessionActive() OVERRIDE; |
23 virtual std::string GetApplicationLocale() OVERRIDE; | 25 virtual std::string GetApplicationLocale() OVERRIDE; |
24 virtual bool GetBrand(std::string* brand_code) OVERRIDE; | 26 virtual bool GetBrand(std::string* brand_code) OVERRIDE; |
25 virtual metrics::SystemProfileProto::Channel GetChannel() OVERRIDE; | 27 virtual metrics::SystemProfileProto::Channel GetChannel() OVERRIDE; |
26 virtual std::string GetVersionString() OVERRIDE; | 28 virtual std::string GetVersionString() OVERRIDE; |
29 virtual void OnFinalLogCollection(const base::Closure& done_callback) | |
30 OVERRIDE; | |
Ilya Sherman
2014/05/21 13:37:07
nit: Hmm, this name is not super clear as to what
Alexei Svitkine (slow)
2014/05/21 14:20:15
Done. Went with CollectFinalMetrics().
| |
27 | 31 |
28 private: | 32 private: |
33 // Callbacks for various stages of final log info collection. Do not call | |
34 // these directly. | |
35 void OnMemoryDetailCollectionDone(); | |
36 void OnHistogramSynchronizationDone(); | |
37 | |
38 // Saved callback received from OnFinalLogCollection(). | |
39 base::Closure final_log_collection_done_callback_; | |
40 | |
41 // Indicates that an asynchronous reporting step is running. | |
42 bool waiting_for_asynchronous_reporting_step_; | |
43 | |
44 // Number of async histogram fetch requests in progress. | |
45 int num_async_histogram_fetches_in_progress_; | |
46 | |
47 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; | |
48 | |
29 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); | 49 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); |
30 }; | 50 }; |
31 | 51 |
32 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 52 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |