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

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

Issue 15021007: Do conservative prerendering based on the LocalPredictor in Dev/Canary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 7 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/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() {

Powered by Google App Engine
This is Rietveld 408576698