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

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
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_histograms.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_histograms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698