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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/precache/PrecacheService.java

Issue 1272443002: Only set precache.last_time when precache ran. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@filter_stats
Patch Set: Don't retry often unless backend pending. Created 5 years, 4 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/android/java/src/org/chromium/chrome/browser/precache/PrecacheService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/precache/PrecacheService.java b/chrome/android/java/src/org/chromium/chrome/browser/precache/PrecacheService.java
index 3f3c37dbfdb419be05bc7e0e0bcbfa9a901a5957..9a0598829ef926799d59b8d526f44b0441b34110 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/precache/PrecacheService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/precache/PrecacheService.java
@@ -72,15 +72,15 @@ public class PrecacheService extends Service {
}
@VisibleForTesting
- void handlePrecacheCompleted() {
- if (mIsPrecaching) finishPrecaching();
+ void handlePrecacheCompleted(boolean tryAgainSoon) {
+ if (mIsPrecaching) finishPrecaching(tryAgainSoon);
}
/** PrecacheLauncher used to run precaching. */
private PrecacheLauncher mPrecacheLauncher = new PrecacheLauncher() {
@Override
- protected void onPrecacheCompleted() {
- handlePrecacheCompleted();
+ protected void onPrecacheCompleted(boolean tryAgainSoon) {
+ handlePrecacheCompleted(tryAgainSoon);
}
};
@@ -161,9 +161,9 @@ public class PrecacheService extends Service {
}
/** End a precache cycle. */
- private void finishPrecaching() {
+ private void finishPrecaching(boolean tryAgainSoon) {
Log.v(TAG, "Finish precaching");
- shutdownPrecaching();
+ shutdownPrecaching(tryAgainSoon);
}
/** Cancel a precache cycle. */
@@ -172,15 +172,16 @@ public class PrecacheService extends Service {
prepareNativeLibraries();
mPrecacheLauncher.cancel();
- shutdownPrecaching();
+ shutdownPrecaching(true);
}
/**
* Update state to indicate that precaching is no longer in progress, and stop the service.
*/
- private void shutdownPrecaching() {
+ private void shutdownPrecaching(boolean tryAgainSoon) {
mIsPrecaching = false;
releasePrecachingWakeLock();
+ PrecacheServiceLauncher.precachingFinished(getApplicationContext(), tryAgainSoon);
stopSelf();
}

Powered by Google App Engine
This is Rietveld 408576698