Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: components/metrics/metrics_service.h

Issue 2333283005: Move EntropyProvider Source From MetricsService to MetricsServicesManager (Closed)
Patch Set: CR Feedback Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // This file defines a service that collects information about the user 5 // This file defines a service that collects information about the user
6 // experience in order to help improve future versions of the app. 6 // experience in order to help improve future versions of the app.
7 7
8 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_H_ 8 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_H_
9 #define COMPONENTS_METRICS_METRICS_SERVICE_H_ 9 #define COMPONENTS_METRICS_METRICS_SERVICE_H_
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Returns the install date of the application, in seconds since the epoch. 117 // Returns the install date of the application, in seconds since the epoch.
118 int64_t GetInstallDate(); 118 int64_t GetInstallDate();
119 119
120 // Returns the date at which the current metrics client ID was created as 120 // Returns the date at which the current metrics client ID was created as
121 // an int64_t containing seconds since the epoch. 121 // an int64_t containing seconds since the epoch.
122 int64_t GetMetricsReportingEnabledDate(); 122 int64_t GetMetricsReportingEnabledDate();
123 123
124 // Returns true if the last session exited cleanly. 124 // Returns true if the last session exited cleanly.
125 bool WasLastShutdownClean() const; 125 bool WasLastShutdownClean() const;
126 126
127 // Returns the preferred entropy provider used to seed persistent activities
128 // based on whether or not metrics reporting will be permitted on this client.
129 //
130 // If metrics reporting is enabled, this method returns an entropy provider
131 // that has a high source of entropy, partially based on the client ID.
132 // Otherwise, it returns an entropy provider that is based on a low entropy
133 // source.
134 std::unique_ptr<const base::FieldTrial::EntropyProvider>
135 CreateEntropyProvider();
136
137 // At startup, prefs needs to be called with a list of all the pref names and 127 // At startup, prefs needs to be called with a list of all the pref names and
138 // types we'll be using. 128 // types we'll be using.
139 static void RegisterPrefs(PrefRegistrySimple* registry); 129 static void RegisterPrefs(PrefRegistrySimple* registry);
140 130
141 // HistogramFlattener: 131 // HistogramFlattener:
142 void RecordDelta(const base::HistogramBase& histogram, 132 void RecordDelta(const base::HistogramBase& histogram,
143 const base::HistogramSamples& snapshot) override; 133 const base::HistogramSamples& snapshot) override;
144 void InconsistencyDetected( 134 void InconsistencyDetected(
145 base::HistogramBase::Inconsistency problem) override; 135 base::HistogramBase::Inconsistency problem) override;
146 void UniqueInconsistencyDetected( 136 void UniqueInconsistencyDetected(
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 // Weak pointers factory used for saving state. All weak pointers managed by 497 // Weak pointers factory used for saving state. All weak pointers managed by
508 // this factory are invalidated in ScheduleNextStateSave. 498 // this factory are invalidated in ScheduleNextStateSave.
509 base::WeakPtrFactory<MetricsService> state_saver_factory_; 499 base::WeakPtrFactory<MetricsService> state_saver_factory_;
510 500
511 DISALLOW_COPY_AND_ASSIGN(MetricsService); 501 DISALLOW_COPY_AND_ASSIGN(MetricsService);
512 }; 502 };
513 503
514 } // namespace metrics 504 } // namespace metrics
515 505
516 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ 506 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698