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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java

Issue 2760123002: [Offline Pages] Resume pending requests when chrome starts. (Closed)
Patch Set: Created 3 years, 9 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/browser/android/offline_pages/downloads/offline_page_download_bridge.h » ('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/downloads/OfflinePageDownloadBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java
index dfbfcaa5765bc690abb7fd03e50d3fc125246737..46f5d090c24ccccb511383f339521b1e4d4b79d8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java
@@ -137,8 +137,16 @@ public class OfflinePageDownloadBridge implements DownloadServiceDelegate, Offli
@Override
public void resumeDownload(DownloadItem item, boolean hasUserGesture) {
+ // If the resumption was an user action then we have to resume the specific download item.
+ // Otherwise it can only be called when Chrome starts and we would like to resume all
+ // pending requests.
+ // TODO(romax): it's based on the assumption that if this method is called with
+ // |hasUserGesture| == false then we're trying to resume all pending requests. This
+ // assumption may change.
if (hasUserGesture) {
resumeDownload(item.getId());
+ } else {
+ nativeResumePendingRequestImmediately(mNativeOfflinePageDownloadBridge);
}
}
@@ -296,4 +304,5 @@ public class OfflinePageDownloadBridge implements DownloadServiceDelegate, Offli
native void nativeDeleteItemByGuid(long nativeOfflinePageDownloadBridge, String guid);
native long nativeGetOfflineIdByGuid(long nativeOfflinePageDownloadBridge, String guid);
native void nativeStartDownload(long nativeOfflinePageDownloadBridge, Tab tab);
+ native void nativeResumePendingRequestImmediately(long nativeOfflinePageDownloadBridge);
}
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698