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

Unified Diff: chrome/browser/android/download/download_manager_service.h

Issue 1809203006: Switch to use download GUID to indentify download items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge error Created 4 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
Index: chrome/browser/android/download/download_manager_service.h
diff --git a/chrome/browser/android/download/download_manager_service.h b/chrome/browser/android/download/download_manager_service.h
index f1a5f9e2a2b944a52d75eddaa25470e888cbc951..aa65a320b113dbf2fcf67c7f5afd192a107fb47d 100644
--- a/chrome/browser/android/download/download_manager_service.h
+++ b/chrome/browser/android/download/download_manager_service.h
@@ -13,6 +13,8 @@
#include "base/macros.h"
#include "content/public/browser/download_manager.h"
+using base::android::JavaParamRef;
+
namespace content {
class DownloadItem;
}
@@ -29,20 +31,26 @@ class DownloadManagerService : public content::DownloadManager::Observer {
content::DownloadManager* manager);
~DownloadManagerService() override;
- // Called to resume downloading the item that has ID equal to |download_id|.
- // If the DownloadItem is not yet created, retry after a while.
+ // Called to resume downloading the item that has GUID equal to
+ // |jdownload_guid|. If the DownloadItem is not yet created, retry after
+ // a while.
void ResumeDownload(JNIEnv* env,
jobject obj,
uint32_t download_id,
+ const JavaParamRef<jstring>& jdownload_guid,
jstring fileName);
- // Called to cancel a download item that has ID equal to |download_id|.
+ // Called to cancel a download item that has GUID equal to |jdownload_guid|.
// If the DownloadItem is not yet created, retry after a while.
- void CancelDownload(JNIEnv* env, jobject obj, uint32_t download_id);
+ void CancelDownload(JNIEnv* env,
+ jobject obj,
+ const JavaParamRef<jstring>& jdownload_guid);
- // Called to pause a download item that has ID equal to |download_id|.
+ // Called to pause a download item that has GUID equal to |jdownload_guid|.
// If the DownloadItem is not yet created, do nothing as it is already paused.
- void PauseDownload(JNIEnv* env, jobject obj, uint32_t download_id);
+ void PauseDownload(JNIEnv* env,
+ jobject obj,
+ const JavaParamRef<jstring>& jdownload_guid);
// content::DownloadManager::Observer methods.
void ManagerGoingDown(content::DownloadManager* manager) override;
@@ -58,12 +66,13 @@ class DownloadManagerService : public content::DownloadManager::Observer {
// Helper function to start the download resumption. If |retry| is true,
// chrome will retry the resumption if the download item is not loaded.
void ResumeDownloadInternal(uint32_t download_id,
+ const std::string& download_guid,
const std::string& fileName,
bool retry);
// Helper function to cancel a download. If |retry| is true,
// chrome will retry the cancellation if the download item is not loaded.
- void CancelDownloadInternal(uint32_t download_id, bool retry);
+ void CancelDownloadInternal(const std::string& download_guid, bool retry);
// Called to notify the java side that download resumption failed.
void OnResumptionFailed(uint32_t download_id, const std::string& fileName);

Powered by Google App Engine
This is Rietveld 408576698