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

Unified Diff: base/metrics/field_trial.cc

Issue 11359136: Make it so disabled field trials are not reported as active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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
Index: base/metrics/field_trial.cc
===================================================================
--- base/metrics/field_trial.cc (revision 166931)
+++ base/metrics/field_trial.cc (working copy)
@@ -145,7 +145,8 @@
int FieldTrial::group() {
FinalizeGroupChoice();
if (!group_reported_) {
- FieldTrialList::NotifyFieldTrialGroupSelection(name_, group_name_);
+ if (enable_field_trial_)
Ilya Sherman 2012/11/09 22:45:59 optional nit: Maybe combine this with the if-stmt
Alexei Svitkine (slow) 2012/11/09 23:42:39 I thought of that, but then |group_reported_| woul
+ FieldTrialList::NotifyFieldTrialGroupSelection(name_, group_name_);
group_reported_ = true;
}
return group_;
@@ -209,7 +210,7 @@
}
bool FieldTrial::GetActiveGroup(ActiveGroup* active_group) const {
- if (!group_reported_)
+ if (!group_reported_ || !enable_field_trial_)
return false;
DCHECK_NE(group_, kNotFinalized);
active_group->trial = name_;

Powered by Google App Engine
This is Rietveld 408576698