| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/browser/download/download_item_impl.h" | 9 #include "content/browser/download/download_item_impl.h" |
| 10 #include "content/browser/download/download_job.h" | 10 #include "content/browser/download/download_job.h" |
| 11 #include "content/browser/download/download_request_handle.h" | 11 #include "content/browser/download/download_request_handle.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 class CONTENT_EXPORT DownloadJobImpl : public DownloadJob { | 16 class CONTENT_EXPORT DownloadJobImpl : public DownloadJob { |
| 17 public: | 17 public: |
| 18 DownloadJobImpl( | 18 DownloadJobImpl( |
| 19 DownloadItemImpl* download_item, | 19 DownloadItemImpl* download_item, |
| 20 std::unique_ptr<DownloadRequestHandleInterface> request_handle); | 20 std::unique_ptr<DownloadRequestHandleInterface> request_handle, |
| 21 bool is_parallizable); |
| 21 ~DownloadJobImpl() override; | 22 ~DownloadJobImpl() override; |
| 22 | 23 |
| 23 // DownloadJob implementation. | 24 // DownloadJob implementation. |
| 24 void Start() override; | 25 void Start() override; |
| 25 void Cancel(bool user_cancel) override; | 26 void Cancel(bool user_cancel) override; |
| 26 void Pause() override; | 27 void Pause() override; |
| 27 void Resume(bool resume_request) override; | 28 void Resume(bool resume_request) override; |
| 28 WebContents* GetWebContents() const override; | 29 WebContents* GetWebContents() const override; |
| 30 bool IsParallelizable() const override; |
| 29 | 31 |
| 30 private: | 32 private: |
| 31 // Used to perform operations on network request. | 33 // Used to perform operations on network request. |
| 32 // Can be null on interrupted download. | 34 // Can be null on interrupted download. |
| 33 std::unique_ptr<DownloadRequestHandleInterface> request_handle_; | 35 std::unique_ptr<DownloadRequestHandleInterface> request_handle_; |
| 34 | 36 |
| 37 // Whether the download can be parallized. |
| 38 bool is_parallizable_; |
| 39 |
| 35 DISALLOW_COPY_AND_ASSIGN(DownloadJobImpl); | 40 DISALLOW_COPY_AND_ASSIGN(DownloadJobImpl); |
| 36 }; | 41 }; |
| 37 | 42 |
| 38 } // namespace content | 43 } // namespace content |
| 39 | 44 |
| 40 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_ | 45 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_JOB_IMPL_H_ |
| OLD | NEW |