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

Issue 2689373003: Introduce ParallelDownloadJob. (Closed)

Created:
3 years, 10 months ago by xingliu
Modified:
3 years, 9 months ago
CC:
asanka, chromium-reviews, darin-cc_chromium.org, jam
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce ParallelDownloadJob. 1. Add ParallelDownloadJob and DownloadUrlJob, both inherits DownloadJob owned by DownloadItemImpl, currently we only do necessary refactoring for parallel download feature, and failure handling or wiring to file IO logic is not implemented yet. 2. Modify DownloadJob, remove any function we don't need. Since we need to access many things in DownloadItemImpl, now it cache a raw pointer, and is a friend class of DownloadItemImpl. 3. ParallelDownloadJob holds a list of DownloadUrlTask, which uses UrlDownloader to send requests. 4. Tweak for UrlDownloader, previously UrlDownloader is coupled with DownloadManagerImpl and everything has to go through DownloadManagerImpl, now it uses a weak pointer delegate to communicate to its owner, i.e. DownloadManagerImpl or DownloadUrlTask. 5. Pull out MockDownloadItemImpl to a seperate source file. BUG=644352 Review-Url: https://codereview.chromium.org/2689373003 Cr-Commit-Position: refs/heads/master@{#453478} Committed: https://chromium.googlesource.com/chromium/src/+/468824d8e6ce6def7e144e9a72ae706f4b0b1b2b

Patch Set 1 #

Patch Set 2 : Make windows compiler happy. #

Total comments: 31

Patch Set 3 : Work on feedback. #

Patch Set 4 : Polish some details. #

Total comments: 6

Patch Set 5 : Work on feedbacks. #

Patch Set 6 : Make compilers happy. #

Total comments: 23

Patch Set 7 : Work on feedback. #

Patch Set 8 : New Resume call break browsertest, probably corrupt the file hash. #

Patch Set 9 : Merge with master. #

Patch Set 10 : Work on feedback. #

Total comments: 6

Patch Set 11 : nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+962 lines, -326 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/download/download_create_info.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/download/download_create_info.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 4 5 6 7 8 6 chunks +8 lines, -7 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 4 5 6 7 8 9 16 chunks +37 lines, -29 lines 0 comments Download
M content/browser/download/download_job.h View 1 2 3 4 5 6 7 8 9 2 chunks +15 lines, -81 lines 0 comments Download
M content/browser/download/download_job.cc View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -25 lines 0 comments Download
A content/browser/download/download_job_factory.h View 1 2 3 4 5 6 1 chunk +33 lines, -0 lines 0 comments Download
A content/browser/download/download_job_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +59 lines, -0 lines 0 comments Download
A content/browser/download/download_job_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +40 lines, -0 lines 0 comments Download
A content/browser/download/download_job_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +46 lines, -0 lines 0 comments Download
M content/browser/download/download_job_unittest.cc View 1 2 2 chunks +14 lines, -23 lines 0 comments Download
M content/browser/download/download_manager_impl.h View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -2 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +18 lines, -10 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +1 line, -120 lines 0 comments Download
M content/browser/download/download_request_core.cc View 1 chunk +3 lines, -0 lines 0 comments Download
A content/browser/download/download_worker.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +63 lines, -0 lines 0 comments Download
A content/browser/download/download_worker.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +93 lines, -0 lines 0 comments Download
A content/browser/download/mock_download_item_impl.h View 1 1 chunk +117 lines, -0 lines 0 comments Download
A content/browser/download/mock_download_item_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +38 lines, -0 lines 0 comments Download
M content/browser/download/mock_download_job.h View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -2 lines 0 comments Download
M content/browser/download/mock_download_job.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
A content/browser/download/parallel_download_job.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +59 lines, -0 lines 0 comments Download
A content/browser/download/parallel_download_job.cc View 1 2 3 4 5 6 7 8 9 1 chunk +103 lines, -0 lines 0 comments Download
A content/browser/download/parallel_download_job_unittest.cc View 1 2 3 4 1 chunk +138 lines, -0 lines 0 comments Download
M content/browser/download/url_downloader.h View 2 chunks +19 lines, -4 lines 0 comments Download
M content/browser/download/url_downloader.cc View 7 chunks +15 lines, -21 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 70 (53 generated)
xingliu
Hi, PHTAL, thanks.
3 years, 10 months ago (2017-02-14 19:54:40 UTC) #4
asanka
You can disregard the lower level comments. I think we'll need to figure out the ...
3 years, 10 months ago (2017-02-16 16:27:40 UTC) #12
xingliu
@asanka thank you for the review. Sorry I should write a doc for discussion first. ...
3 years, 10 months ago (2017-02-16 19:12:33 UTC) #13
xingliu
Hi, thanks for the review. please help take another look. https://codereview.chromium.org/2689373003/diff/20001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/2689373003/diff/20001/content/browser/download/download_item_impl.cc#newcode375 ...
3 years, 10 months ago (2017-02-20 18:59:11 UTC) #18
qinmin
https://codereview.chromium.org/2689373003/diff/60001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/2689373003/diff/60001/content/browser/download/download_item_impl.cc#newcode399 content/browser/download/download_item_impl.cc:399: job_->Resume(); job_ can be null here, right? https://codereview.chromium.org/2689373003/diff/60001/content/browser/download/mock_download_job.h File ...
3 years, 10 months ago (2017-02-22 19:51:23 UTC) #23
xingliu
Thanks for the feedback, PTAL. https://codereview.chromium.org/2689373003/diff/60001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/2689373003/diff/60001/content/browser/download/download_item_impl.cc#newcode399 content/browser/download/download_item_impl.cc:399: job_->Resume(); On 2017/02/22 19:51:23, ...
3 years, 10 months ago (2017-02-22 21:22:41 UTC) #26
qinmin
overall looks good, more comments https://codereview.chromium.org/2689373003/diff/100001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/2689373003/diff/100001/content/browser/download/download_item_impl.cc#newcode1237 content/browser/download/download_item_impl.cc:1237: DCHECK(job_.get()); nit: DCHECK(job_); https://codereview.chromium.org/2689373003/diff/100001/content/browser/download/download_item_impl.cc#newcode1644 ...
3 years, 10 months ago (2017-02-23 07:26:57 UTC) #33
xingliu
Thanks for the feedback, PTAL. https://codereview.chromium.org/2689373003/diff/100001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/2689373003/diff/100001/content/browser/download/download_item_impl.cc#newcode1237 content/browser/download/download_item_impl.cc:1237: DCHECK(job_.get()); On 2017/02/23 07:26:56, ...
3 years, 9 months ago (2017-02-24 23:43:13 UTC) #36
xingliu
More discussion on is_pause. https://codereview.chromium.org/2689373003/diff/100001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/2689373003/diff/100001/content/browser/download/download_item_impl.cc#newcode1959 content/browser/download/download_item_impl.cc:1959: job_->set_is_paused(false); On 2017/02/24 23:43:13, xingliu ...
3 years, 9 months ago (2017-02-25 00:12:13 UTC) #37
qinmin
https://codereview.chromium.org/2689373003/diff/100001/content/browser/download/download_item_impl.cc File content/browser/download/download_item_impl.cc (right): https://codereview.chromium.org/2689373003/diff/100001/content/browser/download/download_item_impl.cc#newcode1959 content/browser/download/download_item_impl.cc:1959: job_->set_is_paused(false); On 2017/02/25 00:12:13, xingliu wrote: > On 2017/02/24 ...
3 years, 9 months ago (2017-02-27 17:15:46 UTC) #48
xingliu
PHTAL, please diff with patch 9, which is a clean rebase on master without code ...
3 years, 9 months ago (2017-02-27 20:44:52 UTC) #55
qinmin
lgtm % nits https://codereview.chromium.org/2689373003/diff/180001/content/browser/download/download_job_factory.cc File content/browser/download/download_job_factory.cc (right): https://codereview.chromium.org/2689373003/diff/180001/content/browser/download/download_job_factory.cc#newcode21 content/browser/download/download_job_factory.cc:21: const int64_t kMinFileSizeParallelDownload = 2097152; nit: ...
3 years, 9 months ago (2017-02-27 21:54:46 UTC) #56
xingliu
Hi, Alex, PTAL BUILD.gn, thanks. alexmos@chromium.org: Please review changes in content/browser/BUILD.gn.
3 years, 9 months ago (2017-02-27 22:46:00 UTC) #58
alexmos
content/browser/BUILD.gn LGTM
3 years, 9 months ago (2017-02-27 23:12:15 UTC) #59
xingliu
Thanks for the review, some minor polish, and start to put it to CQ. https://codereview.chromium.org/2689373003/diff/180001/content/browser/download/download_job_factory.cc ...
3 years, 9 months ago (2017-02-27 23:53:26 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2689373003/200001
3 years, 9 months ago (2017-02-28 02:51:38 UTC) #67
commit-bot: I haz the power
3 years, 9 months ago (2017-02-28 03:00:09 UTC) #70
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/468824d8e6ce6def7e144e9a72ae...

Powered by Google App Engine
This is Rietveld 408576698