| Index: components/variations/variations_seed_processor.cc
|
| diff --git a/components/variations/variations_seed_processor.cc b/components/variations/variations_seed_processor.cc
|
| index c7690ca5052bde7b5c03b3ed6a78430ab65a25bb..fb4d7e56700188ce290b8ade8c9fcd3c4e8b93c2 100644
|
| --- a/components/variations/variations_seed_processor.cc
|
| +++ b/components/variations/variations_seed_processor.cc
|
| @@ -187,6 +187,7 @@ void VariationsSeedProcessor::CreateTrialsFromSeed(
|
| const std::string& session_consistency_country,
|
| const std::string& permanent_consistency_country,
|
| const UIStringOverrideCallback& override_callback,
|
| + const base::FieldTrial::EntropyProvider* low_entropy_provider,
|
| base::FeatureList* feature_list) {
|
| std::vector<ProcessedStudy> filtered_studies;
|
| FilterAndValidateStudies(seed, locale, reference_date, version, channel,
|
| @@ -195,12 +196,28 @@ void VariationsSeedProcessor::CreateTrialsFromSeed(
|
| permanent_consistency_country, &filtered_studies);
|
|
|
| for (size_t i = 0; i < filtered_studies.size(); ++i)
|
| - CreateTrialFromStudy(filtered_studies[i], override_callback, feature_list);
|
| + CreateTrialFromStudy(filtered_studies[i], override_callback,
|
| + low_entropy_provider, feature_list);
|
| +}
|
| +
|
| +// static
|
| +bool VariationsSeedProcessor::ShouldStudyUseLowEntropy(const Study& study) {
|
| + for (int i = 0; i < study.experiment_size(); ++i) {
|
| + const Study_Experiment& experiment = study.experiment(i);
|
| + if (experiment.has_google_web_experiment_id() ||
|
| + experiment.has_google_web_trigger_experiment_id() ||
|
| + experiment.has_google_update_experiment_id() ||
|
| + experiment.has_chrome_sync_experiment_id()) {
|
| + return true;
|
| + }
|
| + }
|
| + return false;
|
| }
|
|
|
| void VariationsSeedProcessor::CreateTrialFromStudy(
|
| const ProcessedStudy& processed_study,
|
| const UIStringOverrideCallback& override_callback,
|
| + const base::FieldTrial::EntropyProvider* low_entropy_provider,
|
| base::FeatureList* feature_list) {
|
| const Study& study = *processed_study.study();
|
|
|
| @@ -255,7 +272,8 @@ void VariationsSeedProcessor::CreateTrialFromStudy(
|
| study.name(), processed_study.total_probability(),
|
| study.default_experiment_name(),
|
| base::FieldTrialList::kNoExpirationYear, 1, 1, randomization_type,
|
| - randomization_seed, NULL));
|
| + randomization_seed, NULL,
|
| + ShouldStudyUseLowEntropy(study) ? low_entropy_provider : NULL));
|
|
|
| bool has_overrides = false;
|
| bool enables_or_disables_features = false;
|
|
|