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

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..eb3695c326998fb509b8b800a26cefa1f4988e88 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(
+ GetLowEntropyProvider());
// 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);
+ feature_list, low_entropy_provider.get());
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::GetLowEntropyProvider() {
Alexei Svitkine (slow) 2016/05/17 16:31:35 Nit: CreateLowEntropyProvider. Although, maybe no
jwd 2016/05/18 13:24:18 Done. Yeah, it's for the tests.
+ return state_manager_->CreateLowEntropyProvider();
+}
+
bool VariationsService::LoadSeed(VariationsSeed* seed) {
return seed_store_.LoadSeed(seed);
}
@@ -740,7 +748,7 @@ void VariationsService::PerformSimulationWithVersion(
const base::ElapsedTimer timer;
std::unique_ptr<const base::FieldTrial::EntropyProvider> entropy_provider =
- state_manager_->CreateEntropyProvider();
+ state_manager_->CreateDefaultEntropyProvider();
variations::VariationsSeedSimulator seed_simulator(*entropy_provider);
const std::string latest_country =

Powered by Google App Engine
This is Rietveld 408576698