Commit d0fa7a78 authored by tburkard's avatar tburkard Committed by Commit bot

Fix PrerenderFromOmnibox field trial by removing the hard-coded percentages,

and having it rely entirely on Finch.
BUG=417851
R=rkaplow, cbentzel

Review URL: https://codereview.chromium.org/606003003

Cr-Commit-Position: refs/heads/master@{#297157}
parent bcdf9a3b
...@@ -33,9 +33,6 @@ namespace prerender { ...@@ -33,9 +33,6 @@ namespace prerender {
namespace { namespace {
const char kOmniboxTrialName[] = "PrerenderFromOmnibox";
int g_omnibox_trial_default_group_number = kint32min;
const char kDisabledGroup[] = "Disabled"; const char kDisabledGroup[] = "Disabled";
const char kEnabledGroup[] = "Enabled"; const char kEnabledGroup[] = "Enabled";
...@@ -201,8 +198,6 @@ void SetupPrerenderFieldTrial() { ...@@ -201,8 +198,6 @@ void SetupPrerenderFieldTrial() {
} // end namespace } // end namespace
void ConfigureOmniboxPrerender();
void ConfigurePrerender(const CommandLine& command_line) { void ConfigurePrerender(const CommandLine& command_line) {
enum PrerenderOption { enum PrerenderOption {
PRERENDER_OPTION_AUTO, PRERENDER_OPTION_AUTO,
...@@ -245,27 +240,6 @@ void ConfigurePrerender(const CommandLine& command_line) { ...@@ -245,27 +240,6 @@ void ConfigurePrerender(const CommandLine& command_line) {
default: default:
NOTREACHED(); 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) { bool IsOmniboxEnabled(Profile* profile) {
...@@ -291,9 +265,8 @@ bool IsOmniboxEnabled(Profile* profile) { ...@@ -291,9 +265,8 @@ bool IsOmniboxEnabled(Profile* profile) {
DCHECK_EQ(switches::kPrerenderFromOmniboxSwitchValueAuto, switch_value); DCHECK_EQ(switches::kPrerenderFromOmniboxSwitchValueAuto, switch_value);
} }
const int group = FieldTrialList::FindValue(kOmniboxTrialName); return (FieldTrialList::FindFullName("PrerenderFromOmnibox") !=
return group == FieldTrial::kNotFinalized || "OmniboxPrerenderDisabled");
group == g_omnibox_trial_default_group_number;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment