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

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: Merge with the latest revision Created 9 years, 6 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 | « chrome/browser/download/download_item_model.cc ('k') | chrome/browser/download/download_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.h
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
index 58d13cf566e0818e597721f22682e110de359de0..38a5ec6a995a88f85e707133fa122866a34d4dd6 100644
--- a/chrome/browser/download/download_manager.h
+++ b/chrome/browser/download/download_manager.h
@@ -235,6 +235,16 @@ 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 CheckForHistoryFilesRemoval();
+
+ // Checks whether a downloaded file still exists and updates the file's state
+ // if the file is already removed. The check runs in the background and may
+ // finish asynchronously after this method returns.
+ void CheckForFileRemoval(DownloadItem* download_item);
+
// Callback function after url is checked with safebrowsing service.
void CheckDownloadUrlDone(int32 download_id, bool is_dangerous_url);
@@ -283,6 +293,14 @@ class DownloadManager
virtual ~DownloadManager();
+ // Called on the FILE thread to check the existence of a downloaded file.
+ void CheckForFileRemovalOnFileThread(int64 db_handle, const FilePath& path);
+
+ // Called on the UI thread if the FILE thread detects the removal of
+ // the downloaded file. The UI thread updates the state of the file
+ // and then notifies this update to the file's observer.
+ void OnFileRemovalDetected(int64 db_handle);
+
// 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.
« no previous file with comments | « chrome/browser/download/download_item_model.cc ('k') | chrome/browser/download/download_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698