| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/variations/variations_seed_processor.h" | 5 #include "components/variations/variations_seed_processor.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include <map> | 9 #include <map> |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 10 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 11 #include "base/feature_list.h" | 13 #include "base/feature_list.h" |
| 12 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 14 #include "components/variations/processed_study.h" | 16 #include "components/variations/processed_study.h" |
| 15 #include "components/variations/study_filtering.h" | 17 #include "components/variations/study_filtering.h" |
| 16 #include "components/variations/variations_associated_data.h" | 18 #include "components/variations/variations_associated_data.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } else if (experiment.feature_association().has_forcing_feature_off()) { | 206 } else if (experiment.feature_association().has_forcing_feature_off()) { |
| 205 feature_list->AssociateReportingFieldTrial( | 207 feature_list->AssociateReportingFieldTrial( |
| 206 experiment.feature_association().forcing_feature_off(), | 208 experiment.feature_association().forcing_feature_off(), |
| 207 base::FeatureList::OVERRIDE_DISABLE_FEATURE, trial); | 209 base::FeatureList::OVERRIDE_DISABLE_FEATURE, trial); |
| 208 } | 210 } |
| 209 ForceExperimentState(study, experiment, override_callback, trial); | 211 ForceExperimentState(study, experiment, override_callback, trial); |
| 210 return; | 212 return; |
| 211 } | 213 } |
| 212 } | 214 } |
| 213 | 215 |
| 214 uint32 randomization_seed = 0; | 216 uint32_t randomization_seed = 0; |
| 215 base::FieldTrial::RandomizationType randomization_type = | 217 base::FieldTrial::RandomizationType randomization_type = |
| 216 base::FieldTrial::SESSION_RANDOMIZED; | 218 base::FieldTrial::SESSION_RANDOMIZED; |
| 217 if (study.has_consistency() && | 219 if (study.has_consistency() && |
| 218 study.consistency() == Study_Consistency_PERMANENT && | 220 study.consistency() == Study_Consistency_PERMANENT && |
| 219 // If all assignments are to a single group, no need to enable one time | 221 // If all assignments are to a single group, no need to enable one time |
| 220 // randomization (which is more expensive to compute), since the result | 222 // randomization (which is more expensive to compute), since the result |
| 221 // will be the same. | 223 // will be the same. |
| 222 !processed_study.all_assignments_to_one_group()) { | 224 !processed_study.all_assignments_to_one_group()) { |
| 223 randomization_type = base::FieldTrial::ONE_TIME_RANDOMIZED; | 225 randomization_type = base::FieldTrial::ONE_TIME_RANDOMIZED; |
| 224 if (study.has_randomization_seed()) | 226 if (study.has_randomization_seed()) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 // The field trial was defined from |study|, so the active experiment's name | 284 // The field trial was defined from |study|, so the active experiment's name |
| 283 // must be in the |study|. | 285 // must be in the |study|. |
| 284 DCHECK_NE(-1, experiment_index); | 286 DCHECK_NE(-1, experiment_index); |
| 285 | 287 |
| 286 ApplyUIStringOverrides(study.experiment(experiment_index), | 288 ApplyUIStringOverrides(study.experiment(experiment_index), |
| 287 override_callback); | 289 override_callback); |
| 288 } | 290 } |
| 289 } | 291 } |
| 290 | 292 |
| 291 } // namespace variations | 293 } // namespace variations |
| OLD | NEW |