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

Unified Diff: chrome/browser/instant/instant_field_trial.cc

Issue 9705074: Supporting command line argument to force field trials (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed some ooopss... Created 8 years, 8 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
Index: chrome/browser/instant/instant_field_trial.cc
diff --git a/chrome/browser/instant/instant_field_trial.cc b/chrome/browser/instant/instant_field_trial.cc
index ea696dd83a96fed90359323d89139daca3df5ac2..5cb5f1e0d4e44c583af6797faa80e3ccadfadc34 100644
--- a/chrome/browser/instant/instant_field_trial.cc
+++ b/chrome/browser/instant/instant_field_trial.cc
@@ -17,6 +17,7 @@ namespace {
// Field trial IDs of the control and experiment groups. Though they are not
// literally "const", they are set only once, in Activate() below. See the .h
// file for what these groups represent.
+int g_inactive = -1;
int g_instant = 0;
int g_suggest = 0;
int g_hidden = 0;
@@ -28,7 +29,8 @@ int g_control = 0;
// static
void InstantFieldTrial::Activate() {
scoped_refptr<base::FieldTrial> trial(
- new base::FieldTrial("Instant", 1000, "Inactive", 2013, 7, 1));
+ base::FieldTrialList::FactoryGetFieldTrial(
+ "Instant", 1000, "Inactive", 2013, 7, 1, &g_inactive));
// Try to give the user a consistent experience, if possible.
if (base::FieldTrialList::IsOneTimeRandomizationEnabled())
@@ -76,8 +78,7 @@ InstantFieldTrial::Group InstantFieldTrial::GetGroup(Profile* profile) {
}
const int group = base::FieldTrialList::FindValue("Instant");
- if (group == base::FieldTrial::kNotFinalized ||
- group == base::FieldTrial::kDefaultGroupNumber) {
+ if (group == base::FieldTrial::kNotFinalized || group == g_inactive) {
UMA_HISTOGRAM_ENUMERATION("Instant.FieldTrial.Reason", 2, 10);
return INACTIVE;
}

Powered by Google App Engine
This is Rietveld 408576698