Chromium Code Reviews| Index: content/browser/download/download_item_impl.h |
| diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h |
| index c899f25016b113ef24356a9f5cb565b2d8be20e4..5242565384465ffa2e843084a7cc66942cd8bebd 100644 |
| --- a/content/browser/download/download_item_impl.h |
| +++ b/content/browser/download/download_item_impl.h |
| @@ -28,6 +28,7 @@ |
| namespace content { |
| class DownloadFile; |
| class DownloadItemImplDelegate; |
| +class DownloadJob; |
| // See download_item.h for usage. |
| class CONTENT_EXPORT DownloadItemImpl |
| @@ -228,6 +229,8 @@ class CONTENT_EXPORT DownloadItemImpl |
| std::unique_ptr<crypto::SecureHash> hash_state) override; |
| private: |
| + friend class DownloadJob; |
| + |
| // Fine grained states of a download. |
| // |
| // New downloads can be created in the following states: |
| @@ -391,6 +394,9 @@ class CONTENT_EXPORT DownloadItemImpl |
| // this is. |
| void Init(bool active, DownloadType download_type); |
| + // Start a series of events that result in the file being downloaded. |
| + void StartDownloadProgress(); |
|
qinmin
2017/02/23 07:26:57
nit: StartDownloadProgress() doesn't sounds like a
xingliu
2017/02/24 23:43:13
Done, changed to StartDownload.
|
| + |
| // Callback from file thread when we initialize the DownloadFile. |
| void OnDownloadFileInitialized(DownloadInterruptReason result); |
| @@ -501,10 +507,6 @@ class CONTENT_EXPORT DownloadItemImpl |
| // TODO(rdsmith): Replace with a generalized enum for "download source". |
| const bool is_save_package_download_ = false; |
| - // The handle to the request information. Used for operations outside the |
| - // download system. |
| - std::unique_ptr<DownloadRequestHandleInterface> request_handle_; |
| - |
| std::string guid_; |
| uint32_t download_id_ = kInvalidId; |
| @@ -594,9 +596,6 @@ class CONTENT_EXPORT DownloadItemImpl |
| // Our delegate. |
| DownloadItemImplDelegate* delegate_ = nullptr; |
| - // In progress downloads may be paused by the user, we note it here. |
| - bool is_paused_ = false; |
| - |
| // A flag for indicating if the download should be opened at completion. |
| bool open_when_complete_ = false; |
| @@ -677,6 +676,8 @@ class CONTENT_EXPORT DownloadItemImpl |
| // Net log to use for this download. |
| const net::NetLogWithSource net_log_; |
| + std::unique_ptr<DownloadJob> job_; |
| + |
| base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |