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

Unified Diff: chrome/browser/download/download_manager.h

Issue 6905049: Detect removed files and reflect the state in chrome://downloads and the download shelf (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Correct typo Created 9 years, 7 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/download/download_manager.h
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
index 84b83990bdc9d8b103e2cf6de26f95b2a6239305..639f09963761abd7ceedb59028960794c8c8575b 100644
--- a/chrome/browser/download/download_manager.h
+++ b/chrome/browser/download/download_manager.h
@@ -233,6 +233,11 @@ class DownloadManager
// Called when the user has validated the download of a dangerous file.
void DangerousDownloadValidated(DownloadItem* download);
+ // Checks whether downloaded files still exist. Updates state of downloads
+ // that refer to removed files. The check runs in the background and may
+ // finish asynchronously after this method returns.
+ void CheckForFilesRemoval();
+
// Callback function after url is checked with safebrowsing service.
void CheckDownloadUrlDone(DownloadCreateInfo* info, bool is_dangerous_url);
@@ -272,6 +277,15 @@ class DownloadManager
~DownloadManager();
+ // Called on the FILE thread to check the existence of downloaded files.
+ void CheckForFilesRemovalOnFileThread(int64 db_handle, const FilePath& path);
+
+ // Called on the UI thread when the FILE thread finishes to check the
+ // existence of downloaded files. The UI thread updates the state of the
+ // downloaded but non-existent files, and then notifies the fact to the
+ // observers of those files.
+ void OnFilesRemovalDetected(int64 db_handle, bool file_exists);
+
// Called on the download thread to check whether the suggested file path
// exists. We don't check if the file exists on the UI thread to avoid UI
// stalls from interacting with the file system.

Powered by Google App Engine
This is Rietveld 408576698