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(); |
} |