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

Unified Diff: chrome/browser/metrics/metrics_service.cc

Issue 10830241: Inform GetEntropySource of whether or not metrics reporting will be enabled. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: thakis nit Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/metrics/metrics_service.h ('k') | chrome/browser/metrics/metrics_service_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_service.cc
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 0916dcbb6f3f4a7a3fc19500772cbefae1db1d15..b118692cbbfe9e8512c3ab336afb21ac46589f8b 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -502,7 +502,8 @@ MetricsService::MetricsService()
next_window_id_(0),
ALLOW_THIS_IN_INITIALIZER_LIST(self_ptr_factory_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(state_saver_factory_(this)),
- waiting_for_asynchronous_reporting_step_(false) {
+ waiting_for_asynchronous_reporting_step_(false),
+ entropy_source_returned_(LAST_ENTROPY_NONE) {
DCHECK(IsSingleThreaded());
InitializeMetricsState();
@@ -538,7 +539,7 @@ std::string MetricsService::GetClientId() {
return client_id_;
}
-std::string MetricsService::GetEntropySource() {
+std::string MetricsService::GetEntropySource(bool reporting_will_be_enabled) {
// For metrics reporting-enabled users, we combine the client ID and low
// entropy source to get the final entropy source. Otherwise, only use the low
// entropy source.
@@ -547,8 +548,11 @@ std::string MetricsService::GetEntropySource() {
// know the low entropy source.
// 2) It makes the final entropy source resettable.
std::string low_entropy_source = base::IntToString(GetLowEntropySource());
- if (reporting_active())
+ if (reporting_will_be_enabled) {
+ entropy_source_returned_ = LAST_ENTROPY_HIGH;
return client_id_ + low_entropy_source;
+ }
+ entropy_source_returned_ = LAST_ENTROPY_LOW;
return low_entropy_source;
}
« no previous file with comments | « chrome/browser/metrics/metrics_service.h ('k') | chrome/browser/metrics/metrics_service_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698