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

Unified Diff: components/variations/variations_seed_processor.h

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/variations_seed_processor.h
diff --git a/components/variations/variations_seed_processor.h b/components/variations/variations_seed_processor.h
index a7ddd5c3118ac04daf641ac576cf782a311bea4d..bcb938ad064d7005eb383c6a38b42273ad865734 100644
--- a/components/variations/variations_seed_processor.h
+++ b/components/variations/variations_seed_processor.h
@@ -39,18 +39,26 @@ class VariationsSeedProcessor {
virtual ~VariationsSeedProcessor();
// Creates field trials from the specified variations |seed|, based on the
- // specified configuration, as specified in the parameters.
- void CreateTrialsFromSeed(const VariationsSeed& seed,
- const std::string& locale,
- const base::Time& reference_date,
- const base::Version& version,
- Study_Channel channel,
- Study_FormFactor form_factor,
- const std::string& hardware_class,
- const std::string& session_consistency_country,
- const std::string& permanent_consistency_country,
- const UIStringOverrideCallback& override_callback,
- base::FeatureList* feature_list);
+ // specified configuration, as specified in the parameters. Any study that
+ // should use low entropy will use |low_entropy_provider| for group
+ // selection. These studies are defined by ShouldStudyUseLowEntropy;
+ void CreateTrialsFromSeed(
+ const VariationsSeed& seed,
+ const std::string& locale,
+ const base::Time& reference_date,
+ const base::Version& version,
+ Study_Channel channel,
+ Study_FormFactor form_factor,
+ const std::string& hardware_class,
+ 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);
+
+ // If the given |study| should alwoys use low entropy. This is true for any
+ // study that can send data to other Google properties.
+ static bool ShouldStudyUseLowEntropy(const Study& study);
private:
friend class VariationsSeedProcessorTest;
@@ -77,10 +85,14 @@ class VariationsSeedProcessor {
bool AllowVariationIdWithForcingFlag(const Study& study);
// Creates and registers a field trial from the |processed_study| data.
- // Disables the trial if |processed_study.is_expired| is true.
- void CreateTrialFromStudy(const ProcessedStudy& processed_study,
- const UIStringOverrideCallback& override_callback,
- base::FeatureList* feature_list);
+ // Disables the trial if |processed_study.is_expired| is true. Uses
+ // |low_entropy_provider| if ShouldStudyUseLowEntropy returns true for the
+ // study.
+ void CreateTrialFromStudy(
+ const ProcessedStudy& processed_study,
+ const UIStringOverrideCallback& override_callback,
+ const base::FieldTrial::EntropyProvider* low_entropy_provider,
+ base::FeatureList* feature_list);
DISALLOW_COPY_AND_ASSIGN(VariationsSeedProcessor);
};
« no previous file with comments | « components/variations/service/variations_service_unittest.cc ('k') | components/variations/variations_seed_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698