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

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

Issue 2727143005: Change FindNextSliceToDownload() into FindSlicesToDownload() (Closed)
Patch Set: adding TODO and 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
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 e3914ed0cbb7fd000326aefc7d1140419eaab557..22a6ce00d2e371bf7a6e3df9480d3728fbea42b2 100644
--- a/content/browser/download/parallel_download_job.h
+++ b/content/browser/download/parallel_download_job.h
@@ -22,10 +22,12 @@ class CONTENT_EXPORT ParallelDownloadJob : public DownloadJobImpl {
public:
ParallelDownloadJob(
DownloadItemImpl* download_item,
- std::unique_ptr<DownloadRequestHandleInterface> request_handle);
+ std::unique_ptr<DownloadRequestHandleInterface> request_handle,
+ const DownloadCreateInfo& create_info);
~ParallelDownloadJob() override;
// DownloadUrlJob implementation.
+ void Start() override;
void Cancel(bool user_cancel) override;
void Pause() override;
void Resume(bool resume_request) override;
@@ -41,6 +43,11 @@ class CONTENT_EXPORT ParallelDownloadJob : public DownloadJobImpl {
// the last connection may take additional bytes.
void ForkRequestsForNewDownload(int64_t bytes_received, int64_t total_bytes);
+ // Build parallel requests to download the remaining slices.
+ // TODO(qinmin): remove ForkRequestsForNewDownload() and move the logic into
+ // this function.
+ void BuildParallelRequests();
+
// Create one range request, virtual for testing.
virtual void CreateRequest(int64_t offset, int64_t length);
@@ -48,6 +55,10 @@ class CONTENT_EXPORT ParallelDownloadJob : public DownloadJobImpl {
// request.
int request_num_;
+ // Information about the initial request when download is started.
+ int64_t initial_request_offset_;
+ int64_t initial_request_length_;
+
// Subsequent tasks to send range requests.
WorkerList workers_;

Powered by Google App Engine
This is Rietveld 408576698