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

Unified Diff: components/variations/service/variations_service.cc

Issue 1984003002: Use low entropy for studies that send experiment IDs to Google properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: components/variations/service/variations_service.cc
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc
index d1f4cf3d7004042d5c82d5126f36a1a5c8889601..b583668618d532c1a7c083b56b0807786b62a2b7 100644
--- a/components/variations/service/variations_service.cc
+++ b/components/variations/service/variations_service.cc
@@ -336,6 +336,9 @@ bool VariationsService::CreateTrialsFromSeed(base::FeatureList* feature_list) {
const std::string latest_country =
local_state_->GetString(prefs::kVariationsCountry);
+
+ std::unique_ptr<const base::FieldTrial::EntropyProvider> low_entropy_provider(
+ CreateLowEntropyProvider());
// Note that passing |&ui_string_overrider_| via base::Unretained below is
// safe because the callback is executed synchronously. It is not possible
// to pass UIStringOverrider itself to VariationSeedProcesor as variations
@@ -347,7 +350,7 @@ bool VariationsService::CreateTrialsFromSeed(base::FeatureList* feature_list) {
LoadPermanentConsistencyCountry(current_version, latest_country),
base::Bind(&UIStringOverrider::OverrideUIString,
base::Unretained(&ui_string_overrider_)),
- feature_list);
+ low_entropy_provider.get(), feature_list);
const base::Time now = base::Time::Now();
@@ -595,6 +598,11 @@ bool VariationsService::StoreSeed(const std::string& seed_data,
return true;
}
+std::unique_ptr<const base::FieldTrial::EntropyProvider>
+VariationsService::CreateLowEntropyProvider() {
+ return state_manager_->CreateLowEntropyProvider();
+}
+
bool VariationsService::LoadSeed(VariationsSeed* seed) {
return seed_store_.LoadSeed(seed);
}
@@ -739,9 +747,12 @@ void VariationsService::PerformSimulationWithVersion(
const base::ElapsedTimer timer;
- std::unique_ptr<const base::FieldTrial::EntropyProvider> entropy_provider =
- state_manager_->CreateEntropyProvider();
- variations::VariationsSeedSimulator seed_simulator(*entropy_provider);
+ std::unique_ptr<const base::FieldTrial::EntropyProvider> default_provider =
+ state_manager_->CreateDefaultEntropyProvider();
+ std::unique_ptr<const base::FieldTrial::EntropyProvider> low_provider =
+ state_manager_->CreateLowEntropyProvider();
+ variations::VariationsSeedSimulator seed_simulator(*default_provider,
+ *low_provider);
const std::string latest_country =
local_state_->GetString(prefs::kVariationsCountry);
« no previous file with comments | « components/variations/service/variations_service.h ('k') | components/variations/service/variations_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698