| 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_UTILS_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_UTILS_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_UTILS_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_UTILS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/download_item.h" | 11 #include "content/public/browser/download_item.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 // Given an array of slices that are received, returns an array of slices to | 15 // Given an array of slices that are received, returns an array of slices to |
| 16 // download. |received_slices| must be ordered by offsets. | 16 // download. |received_slices| must be ordered by offsets. |
| 17 CONTENT_EXPORT std::vector<DownloadItem::ReceivedSlice> FindSlicesToDownload( | 17 CONTENT_EXPORT std::vector<DownloadItem::ReceivedSlice> FindSlicesToDownload( |
| 18 const std::vector<DownloadItem::ReceivedSlice>& received_slices); | 18 const std::vector<DownloadItem::ReceivedSlice>& received_slices); |
| 19 | 19 |
| 20 // Finch configuration utilities. |
| 21 // |
| 22 // Get the minimum slice size to use parallel download from finch configuration. |
| 23 // A slice won't be further chunked into smaller slices if the size is less |
| 24 // than the minimum size. |
| 25 CONTENT_EXPORT int64_t GetMinSliceSizeConfig(); |
| 26 |
| 27 // Get the request count for parallel download from finch configuration. |
| 28 CONTENT_EXPORT int GetParallelRequestCountConfig(); |
| 29 |
| 20 } // namespace content | 30 } // namespace content |
| 21 | 31 |
| 22 #endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_UTILS_H_ | 32 #endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_UTILS_H_ |
| OLD | NEW |