Index: base/metrics/field_trial.cc |
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc |
index 245f2bf02a6a6e07c4ff0f625c91397f2c04a657..6d4f2eb06b2d47c28dde9c2389e68d4814551cae 100644 |
--- a/base/metrics/field_trial.cc |
+++ b/base/metrics/field_trial.cc |
@@ -170,6 +170,21 @@ void FieldTrial::EnableBenchmarking() { |
enable_benchmarking_ = true; |
} |
+void FieldTrial::SetForced() { |
+ // We might have been forced before (e.g., by CreateFieldTrial) and it's |
+ // first come first served, e.g., command line switch has precedence. |
+ if (forced_) |
jar (doing other things)
2012/05/07 18:58:01
How does this handle "races?" I'm curious about s
MAD
2012/05/07 19:11:24
From what I understand of this code, this is as ra
jar (doing other things)
2012/05/07 19:46:19
Maybe my memory is failing me, but the current (ol
MAD
2012/05/07 20:00:53
This contract of a single FieldTrial per name stil
|
+ return; |
+ // Explicit forcing should only be for cases where we want to set the group |
+ // probabilities before the hard coded field trial setup is executed. So |
+ // there must have been at least one non-default group appended at that point. |
+ DCHECK_GT(next_group_number_, kDefaultGroupNumber + 1); |
+ |
+ // And we must finalize the group choice before we mark ourselves as forced. |
+ group(); |
jar (doing other things)
2012/05/07 18:58:01
Here again, how does this play in an async case?
MAD
2012/05/07 19:11:24
I'm not sure which "async case" you are talking ab
jar (doing other things)
2012/05/07 19:46:19
Perhaps if this is supposed to run on the UI threa
MAD
2012/05/07 20:00:53
Unfortunately, we can access the BrowserThread cla
|
+ forced_ = true; |
+} |
+ |
FieldTrial::~FieldTrial() {} |
void FieldTrial::SetGroupChoice(const std::string& name, int number) { |