Chromium Code Reviews| Index: content/browser/download/download_job.h |
| diff --git a/content/browser/download/download_job.h b/content/browser/download/download_job.h |
| index 14f8354881ab8aa59ff51240eb9cc0a24bbc3aba..dbf4102dfd3f3c828a32126568fe685498eb42fb 100644 |
| --- a/content/browser/download/download_job.h |
| +++ b/content/browser/download/download_job.h |
| @@ -27,11 +27,12 @@ class CONTENT_EXPORT DownloadJob { |
| // Download operations. |
| virtual void Start() = 0; |
| - virtual void Cancel(bool user_cancel) = 0; |
| + virtual void Cancel(bool user_cancel); |
| virtual void Pause(); |
| virtual void Resume(bool resume_request); |
| bool is_paused() const { return is_paused_; } |
| + bool is_canceled() const { return is_canceled_; } |
|
qinmin
2017/03/26 05:01:00
nit: these functions and the private member variab
xingliu
2017/03/27 17:29:33
We actually added an is_canceled check in BuildPar
|
| // Return the WebContents associated with the download. Usually used to |
| // associate a browser window for any UI that needs to be displayed to the |
| @@ -47,8 +48,9 @@ class CONTENT_EXPORT DownloadJob { |
| void StartDownload() const; |
| void Interrupt(DownloadInterruptReason reason); |
| - // Add a byte stream to the download sink. |
| - void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader, |
| + // Add a byte stream to the download sink. Return false if we start to |
| + // destroy download file. |
| + bool AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader, |
| int64_t offset, |
| int64_t length); |
| @@ -58,6 +60,9 @@ class CONTENT_EXPORT DownloadJob { |
| // If the download progress is paused by the user. |
| bool is_paused_; |
| + // If the download progress is canceled. |
| + bool is_canceled_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(DownloadJob); |
| }; |