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

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

Issue 2728673003: Add a utility function to calculate the next slice to download (Closed)
Patch Set: addressing comments Created 3 years, 10 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
« no previous file with comments | « content/browser/download/download_item_impl.cc ('k') | content/browser/download/parallel_download_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..62d732ef92e05ac17b421658a6c3355e8329266c
--- /dev/null
+++ b/content/browser/download/parallel_download_utils.h
@@ -0,0 +1,23 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_UTILS_H_
+#define CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_UTILS_H_
+
+#include <vector>
+
+#include "content/common/content_export.h"
+#include "content/public/browser/download_item.h"
+
+namespace content {
+
+// Find the first gap in an array of received slices and return it as the next
+// slice to download. If not found, return a slice that is to the end of all
+// slices. |received_slices| must be ordered by offsets.
+CONTENT_EXPORT DownloadItem::ReceivedSlice FindNextSliceToDownload(
+ const std::vector<DownloadItem::ReceivedSlice>& received_slices);
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_UTILS_H_
« no previous file with comments | « content/browser/download/download_item_impl.cc ('k') | content/browser/download/parallel_download_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698