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

Side by Side Diff: chrome/common/variations/variations_util.cc

Issue 2236293002: Resolve conflict in chrome://flags and field trial config. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/variations/variations_util.h" 5 #include "chrome/common/variations/variations_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 for (size_t j = 0; j < group.params_size; ++j) { 85 for (size_t j = 0; j < group.params_size; ++j) {
86 const FieldTrialGroupParams& param = group.params[j]; 86 const FieldTrialGroupParams& param = group.params[j];
87 params[param.key] = param.value; 87 params[param.key] = param.value;
88 } 88 }
89 variations::AssociateVariationParams(group.study, group.group_name, 89 variations::AssociateVariationParams(group.study, group.group_name,
90 params); 90 params);
91 } 91 }
92 base::FieldTrial* trial = 92 base::FieldTrial* trial =
93 base::FieldTrialList::CreateFieldTrial(group.study, group.group_name); 93 base::FieldTrialList::CreateFieldTrial(group.study, group.group_name);
94 94
95 if (!trial) {
96 DLOG(WARNING) << "Field trial config study skipped: " << group.study
97 << "." << group.group_name
98 << " (it is overridden from chrome://flags)";
99 continue;
100 }
101
95 for (size_t j = 0; j < group.enable_features_size; ++j) { 102 for (size_t j = 0; j < group.enable_features_size; ++j) {
96 feature_list->RegisterFieldTrialOverride( 103 feature_list->RegisterFieldTrialOverride(
97 group.enable_features[j], base::FeatureList::OVERRIDE_ENABLE_FEATURE, 104 group.enable_features[j], base::FeatureList::OVERRIDE_ENABLE_FEATURE,
98 trial); 105 trial);
99 } 106 }
100 for (size_t j = 0; j < group.disable_features_size; ++j) { 107 for (size_t j = 0; j < group.disable_features_size; ++j) {
101 feature_list->RegisterFieldTrialOverride( 108 feature_list->RegisterFieldTrialOverride(
102 group.disable_features[j], 109 group.disable_features[j],
103 base::FeatureList::OVERRIDE_DISABLE_FEATURE, trial); 110 base::FeatureList::OVERRIDE_DISABLE_FEATURE, trial);
104 } 111 }
105 } 112 }
106 } 113 }
107 114
108 void AssociateDefaultFieldTrialConfig(base::FeatureList* feature_list) { 115 void AssociateDefaultFieldTrialConfig(base::FeatureList* feature_list) {
109 AssociateParamsFromFieldTrialConfig(kFieldTrialConfig, feature_list); 116 AssociateParamsFromFieldTrialConfig(kFieldTrialConfig, feature_list);
110 } 117 }
111 118
112 } // namespace chrome_variations 119 } // namespace chrome_variations
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698