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

Unified Diff: base/metrics/field_trial.h

Issue 10382018: Added a SetForced method to allow forcing a new set of group bucketting. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Better wording for the header comments of the new method. Created 8 years, 7 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') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/field_trial.h
diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h
index 87683a1921cfdfd9cb2642ec066b1c695570fe8f..480718738c662213ecfb08fe8b900d3078497d15 100644
--- a/base/metrics/field_trial.h
+++ b/base/metrics/field_trial.h
@@ -152,6 +152,16 @@ class BASE_EXPORT FieldTrial : public RefCounted<FieldTrial> {
// Enable benchmarking sets field trials to a common setting.
static void EnableBenchmarking();
+ // Set the field trial as forced, meaning that it was setup earlier than
+ // the hard coded registration of the field trial to override it.
+ // This allows the code that was hard coded to register the field trial to
+ // still succeed even though the field trial has already been registered.
+ // This must be called after appending all the groups, since we will make
+ // the group choice here. Note that this is a NOOP for already forced trials.
+ // And, as the rest of the FieldTrial code, this is not thread safe and must
+ // be done from the UI thread.
+ void SetForced();
+
private:
// Allow tests to access our innards for testing purposes.
FRIEND_TEST_ALL_PREFIXES(FieldTrialTest, Registration);
« no previous file with comments | « no previous file | base/metrics/field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698