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

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

Issue 2344483003: Ask download manager to remove a download if it is overwritten by another (Closed)
Patch Set: delete completed download with same path Created 4 years, 3 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 d585dd3ca15833b1288a79a197671f6069deadcf..e3ac41a632a6c9cdc03b57d8a0e95a841d4c5e11 100644
--- a/chrome/browser/android/download/download_manager_service.h
+++ b/chrome/browser/android/download/download_manager_service.h
@@ -11,7 +11,9 @@
#include "base/android/scoped_java_ref.h"
#include "base/callback.h"
+#include "base/files/file_path.h"
#include "base/macros.h"
+#include "base/memory/singleton.h"
#include "chrome/browser/android/download/download_controller.h"
#include "chrome/browser/download/all_download_item_notifier.h"
#include "chrome/browser/download/download_history.h"
@@ -35,10 +37,14 @@ class DownloadManagerService : public AllDownloadItemNotifier::Observer,
content::DownloadItem* download,
DownloadController::DownloadCancelReason reason);
- DownloadManagerService(JNIEnv* env,
- jobject jobj);
+ static DownloadManagerService* GetInstance();
+
+ DownloadManagerService();
~DownloadManagerService() override;
+ // Called to Initialize this object.
+ void Init(JNIEnv* env, jobject obj);
+
// Called to resume downloading the item that has GUID equal to
// |jdownload_guid|..
void ResumeDownload(JNIEnv* env,
@@ -78,6 +84,8 @@ class DownloadManagerService : public AllDownloadItemNotifier::Observer,
void CheckForExternallyRemovedDownloads(JNIEnv* env,
const JavaParamRef<jobject>& obj,
bool is_off_the_record);
+ // Remove externally removed downloads from history.
+ void RemoveExternallyRemovedDownloads(const base::FilePath& path);
Theresa 2016/09/21 17:40:43 Can this be something like RemoveDownloadsForPath(
qinmin 2016/09/21 21:20:29 Done.
// DownloadHistory::Observer methods.
void OnHistoryQueryComplete() override;
@@ -95,6 +103,7 @@ class DownloadManagerService : public AllDownloadItemNotifier::Observer,
private:
// For testing.
friend class DownloadManagerServiceTest;
+ friend struct base::DefaultSingletonTraits<DownloadManagerService>;
// Helper function to start the download resumption.
void ResumeDownloadInternal(const std::string& download_guid,

Powered by Google App Engine
This is Rietveld 408576698