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

Issue 2645133003: Introduce DownloadJob for DownloadItem refactoring. (Closed)

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

Description

Introduce DownloadJob for DownloadItem refactoring. 1. DownloadJob is to delegate actual download logic from DownloadItemImpl. Also it can be used for parallel download feature, which is a DownloadJob manages list of smaller tasks(pieces of parallel download segments). 2. DownloadJob base class provides an content internal interface. The public interface of DownloadItem is intact. 3. Add unit test and mock structure for DownloadJob. This CL only checks in the interface. Pulling out DownloadItemImpl logic and subclass of DownloadJob will come in later CL. BUG=682350 Review-Url: https://codereview.chromium.org/2645133003 Cr-Commit-Position: refs/heads/master@{#446806} Committed: https://chromium.googlesource.com/chromium/src/+/f61d39f8a151e11949079994228823ca9720cba1

Patch Set 1 #

Patch Set 2 : Small tweak to inline getter. #

Total comments: 4

Patch Set 3 : Renamed function name. #

Patch Set 4 : Renamed to OnSavingStarted aligned with other function names. #

Patch Set 5 : Comments change. #

Total comments: 4

Patch Set 6 : Remove type field and change comments. #

Total comments: 4

Patch Set 7 : Minor changes. #

Total comments: 1

Patch Set 8 : Conditionally call to delegate. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+275 lines, -0 lines) Patch
M content/browser/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
A content/browser/download/download_job.h View 1 2 3 4 5 6 7 1 chunk +122 lines, -0 lines 0 comments Download
A content/browser/download/download_job.cc View 1 2 3 4 5 6 7 1 chunk +43 lines, -0 lines 0 comments Download
A content/browser/download/download_job_unittest.cc View 1 2 3 1 chunk +52 lines, -0 lines 0 comments Download
A content/browser/download/mock_download_job.h View 1 2 3 4 5 6 1 chunk +40 lines, -0 lines 0 comments Download
A content/browser/download/mock_download_job.cc View 1 2 3 4 5 6 1 chunk +13 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 35 (20 generated)
xingliu
The DownloadJob interface, please help take a look.
3 years, 11 months ago (2017-01-20 18:52:45 UTC) #2
xingliu
Cc to khushal, DownloadJob probably have 4 subclasses evetually, DownloadJobImpl, SavePageJob, ParallelDownloadJob, PwaDownloadJob.
3 years, 11 months ago (2017-01-23 18:37:52 UTC) #8
qinmin
https://codereview.chromium.org/2645133003/diff/20001/content/browser/download/download_job.h File content/browser/download/download_job.h (right): https://codereview.chromium.org/2645133003/diff/20001/content/browser/download/download_job.h#newcode45 content/browser/download/download_job.h:45: virtual void StartSaving(DownloadJob* download_job) = 0; Shouldn't the manager ...
3 years, 11 months ago (2017-01-23 21:46:35 UTC) #9
xingliu
https://codereview.chromium.org/2645133003/diff/20001/content/browser/download/download_job.h File content/browser/download/download_job.h (right): https://codereview.chromium.org/2645133003/diff/20001/content/browser/download/download_job.h#newcode45 content/browser/download/download_job.h:45: virtual void StartSaving(DownloadJob* download_job) = 0; On 2017/01/23 21:46:35, ...
3 years, 11 months ago (2017-01-23 22:59:09 UTC) #10
qinmin
https://codereview.chromium.org/2645133003/diff/20001/content/browser/download/download_job.h File content/browser/download/download_job.h (right): https://codereview.chromium.org/2645133003/diff/20001/content/browser/download/download_job.h#newcode45 content/browser/download/download_job.h:45: virtual void StartSaving(DownloadJob* download_job) = 0; On 2017/01/23 22:59:09, ...
3 years, 11 months ago (2017-01-23 23:03:15 UTC) #11
xingliu
https://codereview.chromium.org/2645133003/diff/20001/content/browser/download/download_job.h File content/browser/download/download_job.h (right): https://codereview.chromium.org/2645133003/diff/20001/content/browser/download/download_job.h#newcode45 content/browser/download/download_job.h:45: virtual void StartSaving(DownloadJob* download_job) = 0; On 2017/01/23 23:03:15, ...
3 years, 11 months ago (2017-01-23 23:26:08 UTC) #12
xingliu
Ping~
3 years, 11 months ago (2017-01-24 22:09:00 UTC) #13
qinmin
lgtm % comments https://codereview.chromium.org/2645133003/diff/80001/content/browser/download/download_job.h File content/browser/download/download_job.h (right): https://codereview.chromium.org/2645133003/diff/80001/content/browser/download/download_job.h#newcode31 content/browser/download/download_job.h:31: URL_DOWNLOAD = 0, // Normal download. ...
3 years, 11 months ago (2017-01-24 23:57:49 UTC) #19
xingliu
https://codereview.chromium.org/2645133003/diff/80001/content/browser/download/download_job.h File content/browser/download/download_job.h (right): https://codereview.chromium.org/2645133003/diff/80001/content/browser/download/download_job.h#newcode31 content/browser/download/download_job.h:31: URL_DOWNLOAD = 0, // Normal download. On 2017/01/24 23:57:49, ...
3 years, 11 months ago (2017-01-25 01:18:07 UTC) #20
David Trainor- moved to gerrit
lgtm % nits https://codereview.chromium.org/2645133003/diff/100001/content/browser/download/download_job.h File content/browser/download/download_job.h (right): https://codereview.chromium.org/2645133003/diff/100001/content/browser/download/download_job.h#newcode63 content/browser/download/download_job.h:63: // See |DownloadItem:: CanOpenDownload|. remove space ...
3 years, 11 months ago (2017-01-25 03:46:09 UTC) #21
asanka
lgtm % nits. We'll need to move this out to //content/public at some point, but ...
3 years, 11 months ago (2017-01-27 01:45:49 UTC) #22
xingliu
@alexmos, Hi, PHTAL for content/browser/BUILD.gn. https://codereview.chromium.org/2645133003/diff/100001/content/browser/download/mock_download_job.cc File content/browser/download/mock_download_job.cc (right): https://codereview.chromium.org/2645133003/diff/100001/content/browser/download/mock_download_job.cc#newcode9 content/browser/download/mock_download_job.cc:9: MockDownloadJob::MockDownloadJob() {} On 2017/01/25 ...
3 years, 10 months ago (2017-01-27 18:33:48 UTC) #24
alexmos
content/browser/BUILD.gn LGTM
3 years, 10 months ago (2017-01-27 18:38:16 UTC) #25
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/2645133003/140001
3 years, 10 months ago (2017-01-27 21:56:57 UTC) #32
commit-bot: I haz the power
3 years, 10 months ago (2017-01-27 22:47:32 UTC) #35
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/f61d39f8a151e119490799942288...

Powered by Google App Engine
This is Rietveld 408576698