OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |