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

Unified Diff: content/public/browser/download_save_info.h

Issue 2660783002: Range request support for parallel download in DownloadRequestCore. (Closed)
Patch Set: Work on feedbacks. 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/public/browser/download_save_info.h
diff --git a/content/public/browser/download_save_info.h b/content/public/browser/download_save_info.h
index 69893f4bbd601f76f738644d3c8546d6e57ab8a5..c1c97bf50f29c7eaefe06c9af53b0f0c2b916618 100644
--- a/content/public/browser/download_save_info.h
+++ b/content/public/browser/download_save_info.h
@@ -22,6 +22,10 @@ namespace content {
// name, |offset| is set to the point where we left off, and |hash_state| will
// hold the state of the hash algorithm where we left off.
struct CONTENT_EXPORT DownloadSaveInfo {
+ // The default value for |length|. Used when request the rest of the file
+ // starts from |offset|.
+ static const int64_t kLengthFullContent;
+
DownloadSaveInfo();
~DownloadSaveInfo();
DownloadSaveInfo(DownloadSaveInfo&& that);
@@ -41,6 +45,13 @@ struct CONTENT_EXPORT DownloadSaveInfo {
// The file offset at which to start the download. May be 0.
int64_t offset;
+ // The number of the bytes to download from |offset|. Set to
+ // |kLengthFullContent| by default.
+ // Ask to retrieve segment of the download file when length is greater than 0.
+ // Request the rest of the file starting from |offset|, when length is
+ // |kLengthFullContent|.
+ int64_t length;
+
// The state of the hash. If specified, this hash state must indicate the
// state of the partial file for the first |offset| bytes.
std::unique_ptr<crypto::SecureHash> hash_state;
« no previous file with comments | « content/browser/download/download_request_core_unittest.cc ('k') | content/public/browser/download_save_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698