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> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 if (study.has_randomization_seed()) | 267 if (study.has_randomization_seed()) |
268 randomization_seed = study.randomization_seed(); | 268 randomization_seed = study.randomization_seed(); |
269 } | 269 } |
270 | 270 |
271 // The trial is created without specifying an expiration date because the | 271 // The trial is created without specifying an expiration date because the |
272 // expiration check in field_trial.cc is based on the build date. Instead, | 272 // expiration check in field_trial.cc is based on the build date. Instead, |
273 // the expiration check using |reference_date| is done explicitly below. | 273 // the expiration check using |reference_date| is done explicitly below. |
274 scoped_refptr<base::FieldTrial> trial( | 274 scoped_refptr<base::FieldTrial> trial( |
275 base::FieldTrialList::FactoryGetFieldTrialWithRandomizationSeed( | 275 base::FieldTrialList::FactoryGetFieldTrialWithRandomizationSeed( |
276 study.name(), processed_study.total_probability(), | 276 study.name(), processed_study.total_probability(), |
277 study.default_experiment_name(), | 277 processed_study.GetDefaultExperimentName(), |
278 base::FieldTrialList::kNoExpirationYear, 1, 1, randomization_type, | 278 base::FieldTrialList::kNoExpirationYear, 1, 1, randomization_type, |
279 randomization_seed, NULL, | 279 randomization_seed, NULL, |
280 ShouldStudyUseLowEntropy(study) ? low_entropy_provider : NULL)); | 280 ShouldStudyUseLowEntropy(study) ? low_entropy_provider : NULL)); |
281 | 281 |
282 bool has_overrides = false; | 282 bool has_overrides = false; |
283 bool enables_or_disables_features = false; | 283 bool enables_or_disables_features = false; |
284 for (int i = 0; i < study.experiment_size(); ++i) { | 284 for (int i = 0; i < study.experiment_size(); ++i) { |
285 const Study_Experiment& experiment = study.experiment(i); | 285 const Study_Experiment& experiment = study.experiment(i); |
286 RegisterExperimentParams(study, experiment); | 286 RegisterExperimentParams(study, experiment); |
287 | 287 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 // The field trial was defined from |study|, so the active experiment's name | 329 // The field trial was defined from |study|, so the active experiment's name |
330 // must be in the |study|. | 330 // must be in the |study|. |
331 DCHECK_NE(-1, experiment_index); | 331 DCHECK_NE(-1, experiment_index); |
332 | 332 |
333 ApplyUIStringOverrides(study.experiment(experiment_index), | 333 ApplyUIStringOverrides(study.experiment(experiment_index), |
334 override_callback); | 334 override_callback); |
335 } | 335 } |
336 } | 336 } |
337 | 337 |
338 } // namespace variations | 338 } // namespace variations |
OLD | NEW |