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

Unified Diff: content/browser/download/parallel_download_job.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_job.h
diff --git a/content/browser/download/parallel_download_job.h b/content/browser/download/parallel_download_job.h
index 955242caa11c7905438fdaa1884b54ba848b6db6..e889d97c484df700c8d61d9b3274ba99823e2448 100644
--- a/content/browser/download/parallel_download_job.h
+++ b/content/browser/download/parallel_download_job.h
@@ -39,6 +39,7 @@ class CONTENT_EXPORT ParallelDownloadJob : public DownloadJobImpl,
protected:
// Virtual for testing.
virtual int GetParallelRequestCount() const;
+ virtual int64_t GetMinSliceSize() const;
using WorkerMap =
std::unordered_map<int64_t, std::unique_ptr<DownloadWorker>>;
@@ -74,9 +75,12 @@ class CONTENT_EXPORT ParallelDownloadJob : public DownloadJobImpl,
// Information about the initial request when download is started.
int64_t initial_request_offset_;
+ int64_t initial_request_length_;
- // The length of the response body of the original request. May be less than
- // the size of the target file if the request starts from non-zero offset.
+ // The length of the response body of the original request.
+ // Used to estimate the remaining size of the content when the initial
+ // request is half open, i.e, |initial_request_length_| is
+ // DownloadSaveInfo::kLengthFullContent.
int64_t content_length_;
// Used to send parallel requests after a delay based on Finch config.

Powered by Google App Engine
This is Rietveld 408576698