diff options
Diffstat (limited to 'chromium/content/browser/download/download_file.h')
-rw-r--r-- | chromium/content/browser/download/download_file.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/chromium/content/browser/download/download_file.h b/chromium/content/browser/download/download_file.h index 4b1aac72b45..8f6ae967563 100644 --- a/chromium/content/browser/download/download_file.h +++ b/chromium/content/browser/download/download_file.h @@ -15,6 +15,7 @@ #include "content/common/content_export.h" #include "content/public/browser/download_interrupt_reasons.h" #include "content/public/browser/download_item.h" +#include "mojo/public/cpp/system/data_pipe.h" class GURL; @@ -22,9 +23,9 @@ namespace content { class ByteStreamReader; -// These objects live exclusively on the file thread and handle the writing -// operations for one download. These objects live only for the duration that -// the download is 'in progress': once the download has been completed or +// These objects live exclusively on the download sequence and handle the +// writing operations for one download. These objects live only for the duration +// that the download is 'in progress': once the download has been completed or // cancelled, the DownloadFile is destroyed. class CONTENT_EXPORT DownloadFile { public: @@ -43,7 +44,7 @@ class CONTENT_EXPORT DownloadFile { RenameCompletionCallback; // Used to drop the request, when the byte stream reader should be closed on - // FILE thread. + // download sequence. typedef base::Callback<void(int64_t offset)> CancelRequestCallback; virtual ~DownloadFile() {} @@ -62,6 +63,16 @@ class CONTENT_EXPORT DownloadFile { int64_t offset, int64_t length) = 0; + // Add the consumer handle of a DataPipe to write into a slice of the file. + virtual void AddDataPipeConsumerHandle( + mojo::ScopedDataPipeConsumerHandle handle, + int64_t offset, + int64_t length) = 0; + + // Called when the response for the stream starting at |offset| is completed, + virtual void OnResponseCompleted(int64_t offset, + DownloadInterruptReason status) = 0; + // Rename the download file to |full_path|. If that file exists // |full_path| will be uniquified by suffixing " (<number>)" to the // file name before the extension. |