| Index: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java
|
| index d58497ae21dda1e04bc7d7375192170bf70c2b4e..8c7a0e1a30e61278d30a044bbe176bf63a9ad68e 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java
|
| @@ -53,9 +53,16 @@ public class OfflinePageEvaluationBridge {
|
| public void savePageRequestChanged(SavePageRequest request) {}
|
| }
|
|
|
| - public static OfflinePageEvaluationBridge getForProfile(Profile profile) {
|
| + /**
|
| + * Get the instance of the evaluation bridge.
|
| + * @param profile The profile used to get bridge.
|
| + * @param useEvaluationScheduler True if using the evaluation scheduler instead of the
|
| + * GCMNetworkManager one.
|
| + */
|
| + public static OfflinePageEvaluationBridge getForProfile(
|
| + Profile profile, boolean useEvaluationScheduler) {
|
| ThreadUtils.assertOnUiThread();
|
| - return nativeGetBridgeForProfile(profile);
|
| + return nativeGetBridgeForProfile(profile, useEvaluationScheduler);
|
| }
|
|
|
| private long mNativeOfflinePageEvaluationBridge;
|
| @@ -117,9 +124,11 @@ public class OfflinePageEvaluationBridge {
|
| /**
|
| * Force request coordinator to process the requests in the queue.
|
| * @param callback The callback would be invoked after the operation completes.
|
| + * @return True if processing starts successfully and callback is expected to be called, false
|
| + * otherwise.
|
| */
|
| - public void pushRequestProcessing(final Callback<Boolean> callback) {
|
| - nativePushRequestProcessing(mNativeOfflinePageEvaluationBridge, callback);
|
| + public boolean pushRequestProcessing(final Callback<Boolean> callback) {
|
| + return nativePushRequestProcessing(mNativeOfflinePageEvaluationBridge, callback);
|
| }
|
|
|
| /**
|
| @@ -184,12 +193,13 @@ public class OfflinePageEvaluationBridge {
|
| creationTime, accessCount, lastAccessTimeMs);
|
| }
|
|
|
| - private static native OfflinePageEvaluationBridge nativeGetBridgeForProfile(Profile profile);
|
| + private static native OfflinePageEvaluationBridge nativeGetBridgeForProfile(
|
| + Profile profile, boolean useEvaluationScheduler);
|
|
|
| private native void nativeGetAllPages(long nativeOfflinePageEvaluationBridge,
|
| List<OfflinePageItem> offlinePages, final Callback<List<OfflinePageItem>> callback);
|
| private native void nativeSavePageLater(long nativeOfflinePageEvaluationBridge, String url,
|
| String clientNamespace, String clientId, boolean userRequested);
|
| - private native void nativePushRequestProcessing(
|
| + private native boolean nativePushRequestProcessing(
|
| long nativeOfflinePageEvaluationBridge, Callback<Boolean> callback);
|
| }
|
|
|