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

Unified Diff: components/variations/variations_seed_simulator.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/variations_seed_simulator.cc
diff --git a/components/variations/variations_seed_simulator.cc b/components/variations/variations_seed_simulator.cc
index a9a2f87669258f6b7911f543d3433e0b4c21630f..ea56739c1fdcda893883333ab9ff9ba514a24fe0 100644
--- a/components/variations/variations_seed_simulator.cc
+++ b/components/variations/variations_seed_simulator.cc
@@ -13,6 +13,7 @@
#include "components/variations/proto/study.pb.h"
#include "components/variations/study_filtering.h"
#include "components/variations/variations_associated_data.h"
+#include "components/variations/variations_seed_processor.h"
namespace variations {
@@ -103,9 +104,10 @@ VariationsSeedSimulator::Result::~Result() {
}
VariationsSeedSimulator::VariationsSeedSimulator(
- const base::FieldTrial::EntropyProvider& entropy_provider)
- : entropy_provider_(entropy_provider) {
-}
+ const base::FieldTrial::EntropyProvider& default_entropy_provider,
+ const base::FieldTrial::EntropyProvider& low_entropy_provider)
+ : default_entropy_provider_(default_entropy_provider),
+ low_entropy_provider_(low_entropy_provider) {}
VariationsSeedSimulator::~VariationsSeedSimulator() {
}
@@ -209,8 +211,13 @@ VariationsSeedSimulator::PermanentStudyGroupChanged(
const Study& study = *processed_study.study();
DCHECK_EQ(Study_Consistency_PERMANENT, study.consistency());
- const std::string simulated_group = SimulateGroupAssignment(entropy_provider_,
- processed_study);
+ const base::FieldTrial::EntropyProvider& entropy_provider =
+ VariationsSeedProcessor::ShouldStudyUseLowEntropy(study)
+ ? low_entropy_provider_
+ : default_entropy_provider_;
+
+ const std::string simulated_group =
+ SimulateGroupAssignment(entropy_provider, processed_study);
const Study_Experiment* experiment = FindExperiment(study, selected_group);
if (simulated_group != selected_group) {
if (experiment)
« no previous file with comments | « components/variations/variations_seed_simulator.h ('k') | components/variations/variations_seed_simulator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698