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

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

Issue 2453633006: [downloads] Move platform specific code out of DownloadTargetDeterminer. (Closed)
Patch Set: . Created 4 years, 2 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_manager_delegate.h
diff --git a/content/public/browser/download_manager_delegate.h b/content/public/browser/download_manager_delegate.h
index 2c91638b118fddf902bb49f7eb12853cfc9f8481..f0dd795e870a814ea246d538e936b3415ac8607b 100644
--- a/content/public/browser/download_manager_delegate.h
+++ b/content/public/browser/download_manager_delegate.h
@@ -34,17 +34,32 @@ typedef base::Callback<void(const base::FilePath&,
const SavePackageDownloadCreatedCallback&)>
SavePackagePathPickedCallback;
-// Called with the results of DetermineDownloadTarget(). If the delegate decides
-// to cancel the download, then |target_path| should be set to an empty path. If
-// |target_path| is non-empty, then |intermediate_path| is required to be
-// non-empty and specify the path to the intermediate file (which could be the
-// same as |target_path|). Both |target_path| and |intermediate_path| are
-// expected to in the same directory.
-typedef base::Callback<void(
- const base::FilePath& target_path,
- DownloadItem::TargetDisposition disposition,
- DownloadDangerType danger_type,
- const base::FilePath& intermediate_path)> DownloadTargetCallback;
+// Called with the results of DetermineDownloadTarget().
+//
+// |interrupt_reason| should be set to DOWNLOAD_INTERRUPT_REASON_NONE in
+// order to proceed with the download. DOWNLOAD_INTERRUPT_REASON_USER_CANCEL
+// results in the download being marked cancelled. Any other value results
+// in the download being marked as interrupted. The other fields are only
+// considered valid if |interrupt_reason| is NONE.
+//
+// |target_path| should be set to a non-empty path which is taken to be the
+// final target path for the download. Any file already at this path will be
+// overwritten.
+//
+// |intermediate_path| specifies the path to the intermediate file. The download
+// will be written to this path until all the bytes have been written. Upon
+// completion, the file will be renamed to |target_path|.
+// |intermediate_path| could be the same as |target_path|. Both paths must
+// be in the same directory.
+//
+// |disposition| and |danger_type| are attributes associated with the download
+// item and can be accessed via the DownloadItem accessors.
+typedef base::Callback<void(const base::FilePath& target_path,
+ DownloadItem::TargetDisposition disposition,
+ DownloadDangerType danger_type,
+ const base::FilePath& intermediate_path,
+ DownloadInterruptReason interrupt_reason)>
+ DownloadTargetCallback;
// Called when a download delayed by the delegate has completed.
typedef base::Callback<void(bool)> DownloadOpenDelayedCallback;

Powered by Google App Engine
This is Rietveld 408576698