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

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

Issue 591313005: Provide a way to specify in Finch trials to disable prerender local (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 6 years, 3 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 | « chrome/browser/prerender/prerender_field_trial.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_local_predictor.cc
diff --git a/chrome/browser/prerender/prerender_local_predictor.cc b/chrome/browser/prerender/prerender_local_predictor.cc
index 09af20f14dd06ba917e5bd8b5e2179acc352003d..cd87edc541f165590e1763b5fe1b0ef0b3bb75ca 100644
--- a/chrome/browser/prerender/prerender_local_predictor.cc
+++ b/chrome/browser/prerender/prerender_local_predictor.cc
@@ -616,6 +616,11 @@ void PrerenderLocalPredictor::OnAddVisit(const history::BriefVisitInfo& info) {
}
if (ShouldExcludeTransitionForPrediction(info.transition))
return;
+ Profile* profile = prerender_manager_->profile();
+ if (!profile ||
+ ShouldDisableLocalPredictorDueToPreferencesAndNetwork(profile)) {
+ return;
+ }
RecordEvent(EVENT_ADD_VISIT_RELEVANT_TRANSITION);
base::TimeDelta max_age =
base::TimeDelta::FromMilliseconds(GetMaxLocalPredictionTimeMs());
@@ -1126,7 +1131,8 @@ void PrerenderLocalPredictor::Init() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
RecordEvent(EVENT_INIT_STARTED);
Profile* profile = prerender_manager_->profile();
- if (!profile || DisableLocalPredictorBasedOnSyncAndConfiguration(profile)) {
+ if (!profile ||
+ ShouldDisableLocalPredictorBasedOnSyncAndConfiguration(profile)) {
RecordEvent(EVENT_INIT_FAILED_UNENCRYPTED_SYNC_NOT_ENABLED);
return;
}
« no previous file with comments | « chrome/browser/prerender/prerender_field_trial.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698