| Index: chrome/browser/prerender/prerender_field_trial.cc
|
| ===================================================================
|
| --- chrome/browser/prerender/prerender_field_trial.cc (revision 198752)
|
| +++ chrome/browser/prerender/prerender_field_trial.cc (working copy)
|
| @@ -28,6 +28,7 @@
|
|
|
| const char kLocalPredictorTrialName[] = "PrerenderLocalPredictor";
|
| const char kLocalPredictorEnabledGroup[] = "Enabled";
|
| +const char kLocalPredictorDisabledGroup[] = "Disabled";
|
|
|
| const char kLoggedInPredictorTrialName[] = "PrerenderLoggedInPredictor";
|
| const char kLoggedInPredictorEnabledGroup[] = "Enabled";
|
| @@ -149,6 +150,7 @@
|
| } // end namespace
|
|
|
| void ConfigureOmniboxPrerender();
|
| +void ConfigureLocalPredictor();
|
| void ConfigureLoggedInPredictor();
|
| void ConfigureSideEffectFreeWhitelist();
|
|
|
| @@ -207,6 +209,7 @@
|
| }
|
|
|
| ConfigureOmniboxPrerender();
|
| + ConfigureLocalPredictor();
|
| ConfigureLoggedInPredictor();
|
| ConfigureSideEffectFreeWhitelist();
|
| }
|
| @@ -229,6 +232,19 @@
|
| kDisabledProbability);
|
| }
|
|
|
| +void ConfigureLocalPredictor() {
|
| + chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
|
| + if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
|
| + channel == chrome::VersionInfo::CHANNEL_BETA) {
|
| + return;
|
| + }
|
| + scoped_refptr<FieldTrial> local_predictor_trial(
|
| + FieldTrialList::FactoryGetFieldTrial(
|
| + kLocalPredictorTrialName, 100,
|
| + kLocalPredictorDisabledGroup, 2013, 12, 31, NULL));
|
| + local_predictor_trial->AppendGroup(kLocalPredictorEnabledGroup, 100);
|
| +}
|
| +
|
| void ConfigureLoggedInPredictor() {
|
| chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
|
| if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
|
| @@ -253,7 +269,7 @@
|
| return;
|
| }
|
| side_effect_free_whitelist_trial->AppendGroup(
|
| - kSideEffectFreeWhitelistEnabledGroup, 100);
|
| + kSideEffectFreeWhitelistEnabledGroup, 0);
|
| }
|
|
|
| bool IsOmniboxEnabled(Profile* profile) {
|
| @@ -285,6 +301,13 @@
|
| }
|
|
|
| bool IsLocalPredictorEnabled() {
|
| +#if defined(OS_ANDROID) || defined(OS_IOS)
|
| + return false;
|
| +#endif
|
| + if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kDisablePrerenderLocalPredictor)) {
|
| + return false;
|
| + }
|
| return base::FieldTrialList::FindFullName(kLocalPredictorTrialName) ==
|
| kLocalPredictorEnabledGroup;
|
| }
|
|
|