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

Unified Diff: content/public/browser/download_item.h

Issue 134373003: Return error to chrome.downloads.removeFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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: content/public/browser/download_item.h
diff --git a/content/public/browser/download_item.h b/content/public/browser/download_item.h
index 5ef9597a05fd8c5c443141f1ede056f7828b7c88..13d2d670544506108294fdcc1c92b29a403ed417 100644
--- a/content/public/browser/download_item.h
+++ b/content/public/browser/download_item.h
@@ -236,10 +236,16 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData {
virtual bool GetFileExternallyRemoved() const = 0;
// If the file is successfully deleted, then GetFileExternallyRemoved() will
- // become true and DownloadItem::OnDownloadUpdated() will be called. Does
- // nothing if GetState() == COMPLETE or GetFileExternallyRemoved() is already
- // true.
- virtual void DeleteFile() = 0;
+ // become true, GetFullPath() will become empty, and
+ // DownloadItem::OnDownloadUpdated() will be called. Does nothing if
+ // GetState() == COMPLETE or GetFileExternallyRemoved() is already true or
+ // GetFullPath() is already empty. The callback is always run, and it is
+ // always run asynchronously. It will be passed true if the file is
+ // successfully deleted or if GetFilePath() was already empty or if
+ // GetFileExternallyRemoved() was already true. The callback will be passed
+ // false if the DownloadItem was not yet complete or if the file could not be
+ // deleted for any reason.
+ virtual void DeleteFile(const base::Callback<void(bool)>& callback) = 0;
// True if the file that will be written by the download is dangerous
// and we will require a call to ValidateDangerousDownload() to complete.
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | content/public/test/mock_download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698