Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: content/browser/download/parallel_download_utils.h

Issue 2783473002: Fix issues and feature polishing for parallel download. (Closed)
Patch Set: Rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/download/parallel_download_utils.h
diff --git a/content/browser/download/parallel_download_utils.h b/content/browser/download/parallel_download_utils.h
index 7e312575cf1ac2d0309eadfac58b9e9dfc353bfa..cdda0de4ffa671db0aa4e24ed9e232fa36ce0208 100644
--- a/content/browser/download/parallel_download_utils.h
+++ b/content/browser/download/parallel_download_utils.h
@@ -17,12 +17,16 @@ namespace content {
CONTENT_EXPORT bool ShouldUseParallelDownload(
const DownloadCreateInfo& create_info);
-// Return the slices to download for the remaining content.
-// This function chunks the content into slices.
+// Chunks the content that starts from |current_offset|, into at most
+// std::max(|request_count|, 1) smaller slices.
+// Each slice contains at least |min_slice_size| bytes unless |total_length|
+// is less than |min_slice_size|.
+// The last slice is half opened.
CONTENT_EXPORT std::vector<DownloadItem::ReceivedSlice>
-FindSlicesForRemainingContent(int64_t bytes_received,
- int64_t content_length,
- int request_count);
+FindSlicesForRemainingContent(int64_t current_offset,
+ int64_t total_length,
+ int request_count,
+ int64_t min_slice_size);
// Given an array of slices that are received, returns an array of slices to
// download. |received_slices| must be ordered by offsets.

Powered by Google App Engine
This is Rietveld 408576698