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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java

Issue 2879103003: android: move ResourcePrefetchPredictor usage to LoadingPredictor. (Closed)
Patch Set: . Created 3 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/android/java/src/org/chromium/chrome/browser/customtabs/LoadingPredictor.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
index 0e71b3ea77e622d1756d6bca214cac7c0d676f32..e956f15e993554de848da6485ceea32ff6d9ec4e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
@@ -279,7 +279,7 @@ public class CustomTabsConnection {
// 1. Initializing the browser needs to be done once, and first.
// 2. Creating a spare renderer takes time, in other threads and processes, so
// start it sooner rather than later. Can be done several times.
- // 3. Initializing the ResourcePrefetchPredictor is done once, and triggers
+ // 3. Initializing the LoadingPredictor is done once, and triggers
// work on other threads, start it early.
// 4. RequestThrottler first access has to be done only once.
@@ -295,7 +295,7 @@ public class CustomTabsConnection {
if (!initialized) {
// (3)
Profile profile = Profile.getLastUsedProfile();
- new ResourcePrefetchPredictor(profile).startInitialization();
+ new LoadingPredictor(profile).startInitialization();
// (4)
// The throttling database uses shared preferences, that can cause a
@@ -981,7 +981,7 @@ public class CustomTabsConnection {
break;
case SpeculationParams.PREFETCH:
Profile profile = Profile.getLastUsedProfile();
- new ResourcePrefetchPredictor(profile).stopPrefetching(mSpeculation.url);
+ new LoadingPredictor(profile).cancelPageLoadHint(mSpeculation.url);
break;
default:
return;
@@ -1005,7 +1005,7 @@ public class CustomTabsConnection {
}
switch (speculationMode) {
case SpeculationParams.PREFETCH:
- boolean didPrefetch = new ResourcePrefetchPredictor(profile).startPrefetching(url);
+ boolean didPrefetch = new LoadingPredictor(profile).prepareForPageLoad(url);
if (didPrefetch) mSpeculation = SpeculationParams.forPrefetch(session, url);
preconnect = !didPrefetch;
break;
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/customtabs/LoadingPredictor.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698