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_PARALLEL_DOWNLOAD_JOB_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_JOB_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_JOB_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_JOB_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 16 matching lines...) Expand all Loading... |
27 DownloadItemImpl* download_item, | 27 DownloadItemImpl* download_item, |
28 std::unique_ptr<DownloadRequestHandleInterface> request_handle, | 28 std::unique_ptr<DownloadRequestHandleInterface> request_handle, |
29 const DownloadCreateInfo& create_info); | 29 const DownloadCreateInfo& create_info); |
30 ~ParallelDownloadJob() override; | 30 ~ParallelDownloadJob() override; |
31 | 31 |
32 // DownloadJobImpl implementation. | 32 // DownloadJobImpl implementation. |
33 void Start() override; | 33 void Start() override; |
34 void Cancel(bool user_cancel) override; | 34 void Cancel(bool user_cancel) override; |
35 void Pause() override; | 35 void Pause() override; |
36 void Resume(bool resume_request) override; | 36 void Resume(bool resume_request) override; |
37 bool UsesParallelRequests() const override; | |
38 void CancelRequestWithOffset(int64_t offset) override; | 37 void CancelRequestWithOffset(int64_t offset) override; |
39 | 38 |
40 protected: | 39 protected: |
41 // Virtual for testing. | 40 // Virtual for testing. |
42 virtual int GetParallelRequestCount() const; | 41 virtual int GetParallelRequestCount() const; |
43 virtual int64_t GetMinSliceSize() const; | 42 virtual int64_t GetMinSliceSize() const; |
44 virtual int GetMinRemainingTimeInSeconds() const; | 43 virtual int GetMinRemainingTimeInSeconds() const; |
45 | 44 |
46 using WorkerMap = | 45 using WorkerMap = |
47 std::unordered_map<int64_t, std::unique_ptr<DownloadWorker>>; | 46 std::unordered_map<int64_t, std::unique_ptr<DownloadWorker>>; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 91 |
93 // If the download progress is canceled. | 92 // If the download progress is canceled. |
94 bool is_canceled_; | 93 bool is_canceled_; |
95 | 94 |
96 DISALLOW_COPY_AND_ASSIGN(ParallelDownloadJob); | 95 DISALLOW_COPY_AND_ASSIGN(ParallelDownloadJob); |
97 }; | 96 }; |
98 | 97 |
99 } // namespace content | 98 } // namespace content |
100 | 99 |
101 #endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_JOB_H_ | 100 #endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_JOB_H_ |
OLD | NEW |