| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 private: | 42 private: |
| 43 friend class ParallelDownloadJobTest; | 43 friend class ParallelDownloadJobTest; |
| 44 | 44 |
| 45 using WorkerMap = | 45 using WorkerMap = |
| 46 std::unordered_map<int64_t, std::unique_ptr<DownloadWorker>>; | 46 std::unordered_map<int64_t, std::unique_ptr<DownloadWorker>>; |
| 47 | 47 |
| 48 // DownloadWorker::Delegate implementation. | 48 // DownloadWorker::Delegate implementation. |
| 49 void OnByteStreamReady( | 49 void OnByteStreamReady( |
| 50 DownloadWorker* worker, | 50 DownloadWorker* worker, |
| 51 std::unique_ptr<ByteStreamReader> stream_reader) override; | 51 std::unique_ptr<ByteStreamReader> stream_reader) override; |
| 52 void OnServerResponseError(DownloadWorker* worker, |
| 53 DownloadInterruptReason reason) override; |
| 52 | 54 |
| 53 // Build parallel requests after a delay, to effectively measure the single | 55 // Build parallel requests after a delay, to effectively measure the single |
| 54 // stream bandwidth. | 56 // stream bandwidth. |
| 55 void BuildParallelRequestAfterDelay(); | 57 void BuildParallelRequestAfterDelay(); |
| 56 | 58 |
| 57 // Build parallel requests to download. This function is the entry point for | 59 // Build parallel requests to download. This function is the entry point for |
| 58 // all parallel downloads. | 60 // all parallel downloads. |
| 59 void BuildParallelRequests(); | 61 void BuildParallelRequests(); |
| 60 | 62 |
| 61 // Build one http request for each slice from the second slice. | 63 // Build one http request for each slice from the second slice. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 81 | 83 |
| 82 // If we have sent parallel requests. | 84 // If we have sent parallel requests. |
| 83 bool requests_sent_; | 85 bool requests_sent_; |
| 84 | 86 |
| 85 DISALLOW_COPY_AND_ASSIGN(ParallelDownloadJob); | 87 DISALLOW_COPY_AND_ASSIGN(ParallelDownloadJob); |
| 86 }; | 88 }; |
| 87 | 89 |
| 88 } // namespace content | 90 } // namespace content |
| 89 | 91 |
| 90 #endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_JOB_H_ | 92 #endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_JOB_H_ |
| OLD | NEW |