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

Unified Diff: components/variations/variations_seed_processor.cc

Issue 2119713002: Fix crash when variation parameters are set in chrome://flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small fix #2 Created 4 years, 6 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
« no previous file with comments | « no previous file | components/variations/variations_seed_processor_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/variations_seed_processor.cc
diff --git a/components/variations/variations_seed_processor.cc b/components/variations/variations_seed_processor.cc
index fb4d7e56700188ce290b8ade8c9fcd3c4e8b93c2..b152ddb302c813e886ec27cebf11bafbd0900d44 100644
--- a/components/variations/variations_seed_processor.cc
+++ b/components/variations/variations_seed_processor.cc
@@ -221,6 +221,16 @@ void VariationsSeedProcessor::CreateTrialFromStudy(
base::FeatureList* feature_list) {
const Study& study = *processed_study.study();
+ // If the trial already exists, check if the selected group exists in the
+ // |processed_study|. If not, there is nothing to do here.
+ base::FieldTrial* existing_trial = base::FieldTrialList::Find(study.name());
+ if (existing_trial) {
+ int experiment_index = processed_study.GetExperimentIndexByName(
+ existing_trial->GetGroupNameWithoutActivation());
+ if (experiment_index == -1)
+ return;
+ }
+
// Check if any experiments need to be forced due to a command line
// flag. Force the first experiment with an existing flag.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
« no previous file with comments | « no previous file | components/variations/variations_seed_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698