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

Side by Side Diff: base/metrics/field_trial.h

Issue 1306653004: Expand FeatureList to support FieldTrial association. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 2 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 | « base/feature_list_unittest.cc ('k') | base/metrics/field_trial.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // FieldTrial is a class for handling details of statistical experiments 5 // FieldTrial is a class for handling details of statistical experiments
6 // performed by actual users in the field (i.e., in a shipped or beta product). 6 // performed by actual users in the field (i.e., in a shipped or beta product).
7 // All code is called exclusively on the UI thread currently. 7 // All code is called exclusively on the UI thread currently.
8 // 8 //
9 // The simplest example is an experiment to see whether one of two options 9 // The simplest example is an experiment to see whether one of two options
10 // produces "better" results across our user population. In that scenario, UMA 10 // produces "better" results across our user population. In that scenario, UMA
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // any/all observers that this finalized group number has presumably been used 142 // any/all observers that this finalized group number has presumably been used
143 // (queried), and will never change. Note that this will force an instance to 143 // (queried), and will never change. Note that this will force an instance to
144 // participate, and make it illegal to attempt to probabilistically add any 144 // participate, and make it illegal to attempt to probabilistically add any
145 // other groups to the trial. 145 // other groups to the trial.
146 int group(); 146 int group();
147 147
148 // If the group's name is empty, a string version containing the group number 148 // If the group's name is empty, a string version containing the group number
149 // is used as the group name. This causes a winner to be chosen if none was. 149 // is used as the group name. This causes a winner to be chosen if none was.
150 const std::string& group_name(); 150 const std::string& group_name();
151 151
152 // Finalizes the group choice and returns the chosen group, but does not mark
153 // the trial as active - so its state will not be reported until group_name()
154 // or similar is called.
155 const std::string& GetGroupNameWithoutActivation();
156
152 // Set the field trial as forced, meaning that it was setup earlier than 157 // Set the field trial as forced, meaning that it was setup earlier than
153 // the hard coded registration of the field trial to override it. 158 // the hard coded registration of the field trial to override it.
154 // This allows the code that was hard coded to register the field trial to 159 // This allows the code that was hard coded to register the field trial to
155 // still succeed even though the field trial has already been registered. 160 // still succeed even though the field trial has already been registered.
156 // This must be called after appending all the groups, since we will make 161 // This must be called after appending all the groups, since we will make
157 // the group choice here. Note that this is a NOOP for already forced trials. 162 // the group choice here. Note that this is a NOOP for already forced trials.
158 // And, as the rest of the FieldTrial code, this is not thread safe and must 163 // And, as the rest of the FieldTrial code, this is not thread safe and must
159 // be done from the UI thread. 164 // be done from the UI thread.
160 void SetForced(); 165 void SetForced();
161 166
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 521
517 // List of observers to be notified when a group is selected for a FieldTrial. 522 // List of observers to be notified when a group is selected for a FieldTrial.
518 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; 523 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_;
519 524
520 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); 525 DISALLOW_COPY_AND_ASSIGN(FieldTrialList);
521 }; 526 };
522 527
523 } // namespace base 528 } // namespace base
524 529
525 #endif // BASE_METRICS_FIELD_TRIAL_H_ 530 #endif // BASE_METRICS_FIELD_TRIAL_H_
OLDNEW
« no previous file with comments | « base/feature_list_unittest.cc ('k') | base/metrics/field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698