 Chromium Code Reviews
 Chromium Code Reviews Issue 15021007:
  Do conservative prerendering based on the LocalPredictor in Dev/Canary.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src/
    
  
    Issue 15021007:
  Do conservative prerendering based on the LocalPredictor in Dev/Canary.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src/| 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 || | 
| @@ -285,8 +301,16 @@ | 
| } | 
| bool IsLocalPredictorEnabled() { | 
| +#if defined(OS_ANDROID) || defined(OS_IOS) | 
| + return false; | 
| +#else | 
| 
Shishir
2013/05/08 20:19:20
remove the else.
 
tburkard
2013/05/08 20:35:47
Done.
 | 
| + if (CommandLine::ForCurrentProcess()->HasSwitch( | 
| + switches::kDisablePrerenderLocalPredictor)) { | 
| + return false; | 
| + } | 
| return base::FieldTrialList::FindFullName(kLocalPredictorTrialName) == | 
| kLocalPredictorEnabledGroup; | 
| +#endif | 
| } | 
| bool IsLoggedInPredictorEnabled() { |