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 COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_H_ | 5 #ifndef COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_H_ |
6 #define COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_H_ | 6 #define COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/metrics/field_trial.h" | |
11 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 class FilePath; | 15 class FilePath; |
15 } | 16 } |
16 | 17 |
17 namespace metrics { | 18 namespace metrics { |
18 class MetricsService; | 19 class MetricsService; |
19 class MetricsServiceClient; | 20 class MetricsServiceClient; |
20 class MetricsStateManager; | 21 class MetricsStateManager; |
(...skipping 14 matching lines...) Expand all Loading... | |
35 // MetricsServicesManager is a helper class for embedders that use the various | 36 // MetricsServicesManager is a helper class for embedders that use the various |
36 // metrics-related services in a Chrome-like fashion: MetricsService (via its | 37 // metrics-related services in a Chrome-like fashion: MetricsService (via its |
37 // client), RapporService and VariationsService. | 38 // client), RapporService and VariationsService. |
38 class MetricsServicesManager { | 39 class MetricsServicesManager { |
39 public: | 40 public: |
40 // Creates the MetricsServicesManager with the given client. | 41 // Creates the MetricsServicesManager with the given client. |
41 explicit MetricsServicesManager( | 42 explicit MetricsServicesManager( |
42 std::unique_ptr<MetricsServicesManagerClient> client); | 43 std::unique_ptr<MetricsServicesManagerClient> client); |
43 virtual ~MetricsServicesManager(); | 44 virtual ~MetricsServicesManager(); |
44 | 45 |
46 // Returns the preferred entropy provider used to seed persistent activities | |
47 // based on whether or not metrics reporting is permitted on this client. | |
48 // | |
49 // If there's consent to report metrics, this method returns an entropy | |
50 // provider that has a high source of entropy, partially based on the client | |
51 // ID. Otherwise, it returns an entropy provider that is based on a low | |
52 // entropy source. | |
53 std::unique_ptr<const base::FieldTrial::EntropyProvider> | |
54 CreateEntropyProvider(); | |
brettw
2016/09/14 22:22:03
Indent 4 spaces as above.
sdefresne
2016/09/15 11:30:07
I think this is correctly indented (at least this
robliao
2016/09/15 14:31:18
The stated rule:
If you break after the return typ
| |
55 | |
45 // Returns the MetricsService, creating it if it hasn't been created yet (and | 56 // Returns the MetricsService, creating it if it hasn't been created yet (and |
46 // additionally creating the MetricsServiceClient in that case). | 57 // additionally creating the MetricsServiceClient in that case). |
47 metrics::MetricsService* GetMetricsService(); | 58 metrics::MetricsService* GetMetricsService(); |
48 | 59 |
49 // Returns the RapporService, creating it if it hasn't been created yet. | 60 // Returns the RapporService, creating it if it hasn't been created yet. |
50 rappor::RapporService* GetRapporService(); | 61 rappor::RapporService* GetRapporService(); |
51 | 62 |
52 // Returns the VariationsService, creating it if it hasn't been created yet. | 63 // Returns the VariationsService, creating it if it hasn't been created yet. |
53 variations::VariationsService* GetVariationsService(); | 64 variations::VariationsService* GetVariationsService(); |
54 | 65 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 | 111 |
101 // The VariationsService, for server-side experiments infrastructure. | 112 // The VariationsService, for server-side experiments infrastructure. |
102 std::unique_ptr<variations::VariationsService> variations_service_; | 113 std::unique_ptr<variations::VariationsService> variations_service_; |
103 | 114 |
104 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); | 115 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); |
105 }; | 116 }; |
106 | 117 |
107 } // namespace metrics_services_manager | 118 } // namespace metrics_services_manager |
108 | 119 |
109 #endif // COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_H_ | 120 #endif // COMPONENTS_METRICS_SERVICES_MANAGER_METRICS_SERVICES_MANAGER_H_ |
OLD | NEW |