| 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 int* default_group_number); | 397 int* default_group_number); |
| 398 | 398 |
| 399 // The Find() method can be used to test to see if a named Trial was already | 399 // The Find() method can be used to test to see if a named Trial was already |
| 400 // registered, or to retrieve a pointer to it from the global map. | 400 // registered, or to retrieve a pointer to it from the global map. |
| 401 static FieldTrial* Find(const std::string& name); | 401 static FieldTrial* Find(const std::string& name); |
| 402 | 402 |
| 403 // Returns the group number chosen for the named trial, or | 403 // Returns the group number chosen for the named trial, or |
| 404 // FieldTrial::kNotFinalized if the trial does not exist. | 404 // FieldTrial::kNotFinalized if the trial does not exist. |
| 405 static int FindValue(const std::string& name); | 405 static int FindValue(const std::string& name); |
| 406 | 406 |
| 407 // Returns the group name chosen for the named trial, or the | 407 // Returns the group name chosen for the named trial, or the empty string if |
| 408 // empty string if the trial does not exist. | 408 // the trial does not exist. The first call of this function on a given field |
| 409 // trial will mark it as active, so that its state will be reported with usage |
| 410 // metrics, crashes, etc. |
| 409 static std::string FindFullName(const std::string& name); | 411 static std::string FindFullName(const std::string& name); |
| 410 | 412 |
| 411 // Returns true if the named trial has been registered. | 413 // Returns true if the named trial has been registered. |
| 412 static bool TrialExists(const std::string& name); | 414 static bool TrialExists(const std::string& name); |
| 413 | 415 |
| 414 // Creates a persistent representation of active FieldTrial instances for | 416 // Creates a persistent representation of active FieldTrial instances for |
| 415 // resurrection in another process. This allows randomization to be done in | 417 // resurrection in another process. This allows randomization to be done in |
| 416 // one process, and secondary processes can be synchronized on the result. | 418 // one process, and secondary processes can be synchronized on the result. |
| 417 // The resulting string contains the name and group name pairs of all | 419 // The resulting string contains the name and group name pairs of all |
| 418 // registered FieldTrials for which the group has been chosen and externally | 420 // registered FieldTrials for which the group has been chosen and externally |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 513 |
| 512 // List of observers to be notified when a group is selected for a FieldTrial. | 514 // List of observers to be notified when a group is selected for a FieldTrial. |
| 513 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; | 515 scoped_refptr<ObserverListThreadSafe<Observer> > observer_list_; |
| 514 | 516 |
| 515 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); | 517 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); |
| 516 }; | 518 }; |
| 517 | 519 |
| 518 } // namespace base | 520 } // namespace base |
| 519 | 521 |
| 520 #endif // BASE_METRICS_FIELD_TRIAL_H_ | 522 #endif // BASE_METRICS_FIELD_TRIAL_H_ |
| OLD | NEW |