Chromium Code Reviews| Index: base/metrics/field_trial.h |
| =================================================================== |
| --- base/metrics/field_trial.h (revision 70854) |
| +++ base/metrics/field_trial.h (working copy) |
| @@ -112,6 +112,17 @@ |
| // number is used as the group name. |
| std::string group_name() const { return group_name_; } |
| + // Set the duration after which we will disable Field Trials. We will subtract |
| + // build time from application start time and if the difference is greater |
| + // than the duration that is specified via the following function, then we |
| + // disable field trails and the field trials revert to the 'default' bucket. |
| + void SetDurationAfterWhichDisableFieldTrials(base::TimeDelta duration) { |
|
jar (doing other things)
2011/01/09 07:00:04
nit: for classes as arguments, pass in:
const CLAS
jar (doing other things)
2011/01/09 07:00:04
nit: Since this is an instance of FieldTrial, we o
rtenneti
2011/01/09 23:16:42
Done.
rtenneti
2011/01/09 23:16:42
Done.
|
| + duration_after_which_disable_field_trials_ = duration; |
| + } |
| + base::TimeDelta durationAfterWhichDisableFieldTrials() { |
| + return duration_after_which_disable_field_trials_; |
| + } |
| + |
| // Helper function for the most common use: as an argument to specifiy the |
| // name of a HISTOGRAM. Use the original histogram name as the name_prefix. |
| static std::string MakeName(const std::string& name_prefix, |
| @@ -120,6 +131,9 @@ |
| // Enable benchmarking sets field trials to a common setting. |
| static void EnableBenchmarking(); |
| + // Get build time. |
| + static Time GetBuildTime(); |
| + |
| private: |
| friend class RefCounted<FieldTrial>; |
| @@ -143,6 +157,11 @@ |
| int next_group_number_; |
| + // duration after which we should disable field_trails. |
| + base::TimeDelta duration_after_which_disable_field_trials_; |
| + |
| + bool disable_field_trails_; |
| + |
| // The pseudo-randomly assigned group number. |
| // This is kNotParticipating if no group has been assigned. |
| int group_; |