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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java

Issue 2432593002: [Offline Pages] Add basic evaluation tests and related changes. (Closed)
Patch Set: Fix build failure. Created 4 years, 2 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_sources.gni » ('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/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);
}
« no previous file with comments | « no previous file | chrome/android/java_sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698