| 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; |
| 37 | 38 |
| 38 protected: | 39 protected: |
| 39 // Virtual for testing. | 40 // Virtual for testing. |
| 40 virtual int GetParallelRequestCount() const; | 41 virtual int GetParallelRequestCount() const; |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 friend class ParallelDownloadJobTest; | 44 friend class ParallelDownloadJobTest; |
| 44 | 45 |
| 45 using WorkerMap = | 46 using WorkerMap = |
| 46 std::unordered_map<int64_t, std::unique_ptr<DownloadWorker>>; | 47 std::unordered_map<int64_t, std::unique_ptr<DownloadWorker>>; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 84 |
| 84 // If we have sent parallel requests. | 85 // If we have sent parallel requests. |
| 85 bool requests_sent_; | 86 bool requests_sent_; |
| 86 | 87 |
| 87 DISALLOW_COPY_AND_ASSIGN(ParallelDownloadJob); | 88 DISALLOW_COPY_AND_ASSIGN(ParallelDownloadJob); |
| 88 }; | 89 }; |
| 89 | 90 |
| 90 } // namespace content | 91 } // namespace content |
| 91 | 92 |
| 92 #endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_JOB_H_ | 93 #endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_JOB_H_ |
| OLD | NEW |