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

Side by Side Diff: components/variations/variations_seed_simulator.cc

Issue 421663003: Move variations component code to variations namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix Created 6 years, 5 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 | Annotate | Revision Log
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 "components/variations/variations_seed_simulator.h" 5 #include "components/variations/variations_seed_simulator.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "components/variations/processed_study.h" 10 #include "components/variations/processed_study.h"
11 #include "components/variations/proto/study.pb.h" 11 #include "components/variations/proto/study.pb.h"
12 #include "components/variations/study_filtering.h" 12 #include "components/variations/study_filtering.h"
13 #include "components/variations/variations_associated_data.h" 13 #include "components/variations/variations_associated_data.h"
14 14
15 namespace chrome_variations { 15 namespace variations {
16 16
17 namespace { 17 namespace {
18 18
19 // Fills in |current_state| with the current process' active field trials, as a 19 // Fills in |current_state| with the current process' active field trials, as a
20 // map of trial names to group names. 20 // map of trial names to group names.
21 void GetCurrentTrialState(std::map<std::string, std::string>* current_state) { 21 void GetCurrentTrialState(std::map<std::string, std::string>* current_state) {
22 base::FieldTrial::ActiveGroups trial_groups; 22 base::FieldTrial::ActiveGroups trial_groups;
23 base::FieldTrialList::GetActiveFieldTrialGroups(&trial_groups); 23 base::FieldTrialList::GetActiveFieldTrialGroups(&trial_groups);
24 for (size_t i = 0; i < trial_groups.size(); ++i) 24 for (size_t i = 0; i < trial_groups.size(); ++i)
25 (*current_state)[trial_groups[i].trial_name] = trial_groups[i].group_name; 25 (*current_state)[trial_groups[i].trial_name] = trial_groups[i].group_name;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 !experiment->has_forcing_flag()) { 242 !experiment->has_forcing_flag()) {
243 return ConvertExperimentTypeToChangeType(experiment->type()); 243 return ConvertExperimentTypeToChangeType(experiment->type());
244 } 244 }
245 245
246 // Current group exists in the study - check whether its params changed. 246 // Current group exists in the study - check whether its params changed.
247 if (!VariationParamsAreEqual(study, *experiment)) 247 if (!VariationParamsAreEqual(study, *experiment))
248 return ConvertExperimentTypeToChangeType(experiment->type()); 248 return ConvertExperimentTypeToChangeType(experiment->type());
249 return NO_CHANGE; 249 return NO_CHANGE;
250 } 250 }
251 251
252 } // namespace chrome_variations 252 } // namespace variations
OLDNEW
« 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