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

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: 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
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..c76af1f8cd99cb4f09152d820c16f1143054c402
--- /dev/null
+++ b/content/browser/download/parallel_download_utils.h
@@ -0,0 +1,22 @@
+// 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/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.
+DownloadItem::ReceivedSlice FindNextSliceToDownload(
+ const std::vector<DownloadItem::ReceivedSlice>& received_slices);
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_DOWNLOAD_PARALLEL_DOWNLOAD_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698