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

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

Issue 13903018: Add the LoggedIn Predictor, to detect which websites a user is likely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 193677)
+++ chrome/browser/prerender/prerender_field_trial.cc (working copy)
@@ -29,6 +29,10 @@
const char kLocalPredictorTrialName[] = "PrerenderLocalPredictor";
const char kLocalPredictorEnabledGroup[] = "Enabled";
+const char kLoggedInPredictorTrialName[] = "PrerenderLoggedInPredictor";
+const char kLoggedInPredictorEnabledGroup[] = "Enabled";
+const char kLoggedInPredictorDisabledGroup[] = "Disabled";
+
void SetupPrefetchFieldTrial() {
chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
@@ -141,6 +145,7 @@
} // end namespace
void ConfigureOmniboxPrerender();
+void ConfigureLoggedInPredictor();
void ConfigurePrefetchAndPrerender(const CommandLine& command_line) {
enum PrerenderOption {
@@ -197,6 +202,7 @@
}
ConfigureOmniboxPrerender();
+ ConfigureLoggedInPredictor();
}
void ConfigureOmniboxPrerender() {
@@ -217,6 +223,19 @@
kDisabledProbability);
}
+void ConfigureLoggedInPredictor() {
+ chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
+ if (channel == chrome::VersionInfo::CHANNEL_STABLE ||
+ channel == chrome::VersionInfo::CHANNEL_BETA) {
+ return;
+ }
+ scoped_refptr<FieldTrial> logged_in_predictor_trial(
+ FieldTrialList::FactoryGetFieldTrial(
+ kLoggedInPredictorTrialName, 100,
+ kLoggedInPredictorDisabledGroup, 2013, 12, 31, NULL));
+ logged_in_predictor_trial->AppendGroup(kLoggedInPredictorEnabledGroup, 100);
Shishir 2013/04/16 21:22:04 Not using finch?
tburkard 2013/04/16 21:47:19 Not for canary/dev at this point.
+}
+
bool IsOmniboxEnabled(Profile* profile) {
if (!profile)
return false;
@@ -250,4 +269,9 @@
kLocalPredictorEnabledGroup;
}
+bool IsLoggedInPredictorEnabled() {
+ return base::FieldTrialList::FindFullName(kLoggedInPredictorTrialName) ==
Shishir 2013/04/16 21:22:04 You should also respect the "predict network actio
tburkard 2013/04/16 21:47:19 Since we are not taking any actual action (but jus
tburkard 2013/04/16 21:47:19 Since we are not taking any actual action (but jus
Shishir 2013/04/16 22:25:14 Add a todo to ensure that you dont forget this.
tburkard 2013/04/16 22:45:33 The predictor itself is never taking any action -
+ kLoggedInPredictorEnabledGroup;
+}
+
} // namespace prerender

Powered by Google App Engine
This is Rietveld 408576698