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

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

Issue 2737033002: Update the received slices vector when stream is written to disk (Closed)
Patch Set: nit 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 85a5d0b8af8921cafd5ad7506d3e5dab75952866..c788ac2ff02e0f6a85181f9da046d23a0d5ef721 100644
--- a/content/browser/download/parallel_download_utils.h
+++ b/content/browser/download/parallel_download_utils.h
@@ -17,6 +17,14 @@ namespace content {
CONTENT_EXPORT std::vector<DownloadItem::ReceivedSlice> FindSlicesToDownload(
const std::vector<DownloadItem::ReceivedSlice>& received_slices);
+// Adds or merges a new received slice into a vector of sorted slices. If the
+// slice can be merged with the slice preceding it, merge the 2 slices.
+// Otherwise, insert the slice and keep the vector sorted. Returns the index
+// of the newly updated slice.
+CONTENT_EXPORT size_t AddOrMergeReceivedSliceIntoSortedArray(
+ const DownloadItem::ReceivedSlice& new_slice,
+ std::vector<DownloadItem::ReceivedSlice>& received_slices);
+
// Finch configuration utilities.
//
// Get the minimum slice size to use parallel download from finch configuration.
« no previous file with comments | « content/browser/download/download_file_unittest.cc ('k') | content/browser/download/parallel_download_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698