| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // | 340 // |
| 341 // To support one-time randomized field trials, specify a non-NULL | 341 // To support one-time randomized field trials, specify a non-NULL |
| 342 // |entropy_provider| which should be a source of uniformly distributed | 342 // |entropy_provider| which should be a source of uniformly distributed |
| 343 // entropy values. Takes ownership of |entropy_provider|. If one time | 343 // entropy values. Takes ownership of |entropy_provider|. If one time |
| 344 // randomization is not desired, pass in NULL for |entropy_provider|. | 344 // randomization is not desired, pass in NULL for |entropy_provider|. |
| 345 explicit FieldTrialList(const FieldTrial::EntropyProvider* entropy_provider); | 345 explicit FieldTrialList(const FieldTrial::EntropyProvider* entropy_provider); |
| 346 | 346 |
| 347 // Destructor Release()'s references to all registered FieldTrial instances. | 347 // Destructor Release()'s references to all registered FieldTrial instances. |
| 348 ~FieldTrialList(); | 348 ~FieldTrialList(); |
| 349 | 349 |
| 350 // TODO(asvitkine): Temporary function to diagnose http://crbug.com/359406. |
| 351 // Remove when that bug is fixed. This enables using a global map that checks |
| 352 // the state of field trials between possible FieldTrialList instances. If |
| 353 // enabled, a CHECK will be hit if it's seen that a field trial is given a |
| 354 // different state then what was specified to a renderer process launch |
| 355 // command line. |
| 356 static void EnableGlobalStateChecks(); |
| 357 |
| 350 // Get a FieldTrial instance from the factory. | 358 // Get a FieldTrial instance from the factory. |
| 351 // | 359 // |
| 352 // |name| is used to register the instance with the FieldTrialList class, | 360 // |name| is used to register the instance with the FieldTrialList class, |
| 353 // and can be used to find the trial (only one trial can be present for each | 361 // and can be used to find the trial (only one trial can be present for each |
| 354 // name). |default_group_name| is the name of the default group which will | 362 // name). |default_group_name| is the name of the default group which will |
| 355 // be chosen if none of the subsequent appended groups get to be chosen. | 363 // be chosen if none of the subsequent appended groups get to be chosen. |
| 356 // |default_group_number| can receive the group number of the default group as | 364 // |default_group_number| can receive the group number of the default group as |
| 357 // AppendGroup returns the number of the subsequence groups. |trial_name| and | 365 // AppendGroup returns the number of the subsequence groups. |trial_name| and |
| 358 // |default_group_name| may not be empty but |default_group_number| can be | 366 // |default_group_name| may not be empty but |default_group_number| can be |
| 359 // NULL if the value is not needed. | 367 // NULL if the value is not needed. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 526 |
| 519 // List of observers to be notified when a group is selected for a FieldTrial. | 527 // List of observers to be notified when a group is selected for a FieldTrial. |
| 520 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; | 528 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; |
| 521 | 529 |
| 522 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); | 530 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); |
| 523 }; | 531 }; |
| 524 | 532 |
| 525 } // namespace base | 533 } // namespace base |
| 526 | 534 |
| 527 #endif // BASE_METRICS_FIELD_TRIAL_H_ | 535 #endif // BASE_METRICS_FIELD_TRIAL_H_ |
| OLD | NEW |