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

Unified Diff: chrome/browser/prerender/prerender_field_trial.cc

Issue 606003003: Fix PrerenderFromOmnibox field trial by removing the hard-coded percentages, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_field_trial.cc
diff --git a/chrome/browser/prerender/prerender_field_trial.cc b/chrome/browser/prerender/prerender_field_trial.cc
index e47c767c4b2df22536a56aa629d90093b1c6ae24..fa839ab216f8015b2d34e8f0724dc973d0ce2546 100644
--- a/chrome/browser/prerender/prerender_field_trial.cc
+++ b/chrome/browser/prerender/prerender_field_trial.cc
@@ -33,9 +33,6 @@ namespace prerender {
namespace {
-const char kOmniboxTrialName[] = "PrerenderFromOmnibox";
-int g_omnibox_trial_default_group_number = kint32min;
-
const char kDisabledGroup[] = "Disabled";
const char kEnabledGroup[] = "Enabled";
@@ -201,8 +198,6 @@ void SetupPrerenderFieldTrial() {
} // end namespace
-void ConfigureOmniboxPrerender();
-
void ConfigurePrerender(const CommandLine& command_line) {
enum PrerenderOption {
PRERENDER_OPTION_AUTO,
@@ -245,27 +240,6 @@ void ConfigurePrerender(const CommandLine& command_line) {
default:
NOTREACHED();
}
-
- ConfigureOmniboxPrerender();
-}
-
-void ConfigureOmniboxPrerender() {
- // Field trial to see if we're enabled.
- const FieldTrial::Probability kDivisor = 100;
-
- FieldTrial::Probability kDisabledProbability = 10;
- chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
- if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
- channel == chrome::VersionInfo::CHANNEL_BETA) {
- kDisabledProbability = 1;
- }
- scoped_refptr<FieldTrial> omnibox_prerender_trial(
- FieldTrialList::FactoryGetFieldTrial(
- kOmniboxTrialName, kDivisor, "OmniboxPrerenderEnabled",
- 2014, 12, 31, FieldTrial::SESSION_RANDOMIZED,
- &g_omnibox_trial_default_group_number));
- omnibox_prerender_trial->AppendGroup("OmniboxPrerenderDisabled",
- kDisabledProbability);
}
bool IsOmniboxEnabled(Profile* profile) {
@@ -291,9 +265,8 @@ bool IsOmniboxEnabled(Profile* profile) {
DCHECK_EQ(switches::kPrerenderFromOmniboxSwitchValueAuto, switch_value);
}
- const int group = FieldTrialList::FindValue(kOmniboxTrialName);
- return group == FieldTrial::kNotFinalized ||
- group == g_omnibox_trial_default_group_number;
+ return (FieldTrialList::FindFullName("PrerenderFromOmnibox") !=
cbentzel 2014/09/29 11:19:17 Do you anticipate ever having multiple Disabled gr
tburkard 2014/09/29 11:22:11 I think we don't have a need for this at this poin
+ "OmniboxPrerenderDisabled");
}
/*
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698