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

Unified Diff: base/metrics/field_trial.h

Issue 6213001: disable field trials if the build is 30 days or older (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/metrics/field_trial.cc » ('j') | base/metrics/field_trial.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | base/metrics/field_trial.cc » ('j') | base/metrics/field_trial.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698