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

Issue 2712713007: Make DownloadFileImpl handle multiple byte streams. (Closed)

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

Description

Make DownloadFileImpl handle multiple byte streams. DownloadFileImpl now hold multiple byte streams, add a wrapper class for each stream reader. Didn't hook to slice info or parallel job. BUG=644352 Review-Url: https://codereview.chromium.org/2712713007 Cr-Commit-Position: refs/heads/master@{#454709} Committed: https://chromium.googlesource.com/chromium/src/+/992dacf666e6750a1911caebe43b29c93ea4d65f

Patch Set 1 #

Patch Set 2 : Export the new class for linking on windows. #

Total comments: 14

Patch Set 3 : Work on feedback. #

Total comments: 4

Patch Set 4 : Work on feedback, add length limitation for stream. #

Patch Set 5 : Minor polish to avoid an extra empty read. #

Total comments: 10

Patch Set 6 : Work on feedback. #

Total comments: 28

Patch Set 7 : Work on feedbacks. #

Patch Set 8 : Rebase. #

Total comments: 2

Patch Set 9 : Work on feedback. #

Patch Set 10 : Remove the AppendDataToFile call, fix the browsertest. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+497 lines, -111 lines) Patch
M content/browser/download/download_browsertest.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/download/download_file.h View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -0 lines 0 comments Download
M content/browser/download/download_file_factory.cc View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M content/browser/download/download_file_impl.h View 1 2 3 4 5 6 7 8 9 7 chunks +90 lines, -11 lines 0 comments Download
M content/browser/download/download_file_impl.cc View 1 2 3 4 5 6 7 8 9 11 chunks +137 lines, -64 lines 0 comments Download
M content/browser/download/download_file_unittest.cc View 1 2 3 4 5 6 7 15 chunks +232 lines, -27 lines 0 comments Download
M content/browser/download/download_stats.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/download/mock_download_file.h View 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/download/mock_download_file.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M content/public/test/test_file_error_injector.cc View 1 2 3 4 5 6 7 8 9 3 chunks +10 lines, -5 lines 0 comments Download

Messages

Total messages: 62 (44 generated)
xingliu
Hi, please help to take a look, thanks. Tweak the DownloadFileImpl, so it can glue ...
3 years, 10 months ago (2017-02-24 03:29:47 UTC) #5
qinmin
https://codereview.chromium.org/2712713007/diff/20001/content/browser/download/download_file.h File content/browser/download/download_file.h (right): https://codereview.chromium.org/2712713007/diff/20001/content/browser/download/download_file.h#newcode10 content/browser/download/download_file.h:10: #include <memory> remove these newly added includes https://codereview.chromium.org/2712713007/diff/20001/content/browser/download/download_file_impl.cc File ...
3 years, 9 months ago (2017-02-27 18:55:29 UTC) #13
xingliu
Thanks for the review, please take another look. https://codereview.chromium.org/2712713007/diff/20001/content/browser/download/download_file.h File content/browser/download/download_file.h (right): https://codereview.chromium.org/2712713007/diff/20001/content/browser/download/download_file.h#newcode10 content/browser/download/download_file.h:10: #include ...
3 years, 9 months ago (2017-02-28 00:57:06 UTC) #18
qinmin
https://codereview.chromium.org/2712713007/diff/40001/content/browser/download/download_file_impl.h File content/browser/download/download_file_impl.h (right): https://codereview.chromium.org/2712713007/diff/40001/content/browser/download/download_file_impl.h#newcode102 content/browser/download/download_file_impl.h:102: SourceStream(int64_t offset, int64_t bytes_written); why does this take bytes_written? ...
3 years, 9 months ago (2017-02-28 06:56:12 UTC) #19
xingliu
https://codereview.chromium.org/2712713007/diff/40001/content/browser/download/download_file_impl.h File content/browser/download/download_file_impl.h (right): https://codereview.chromium.org/2712713007/diff/40001/content/browser/download/download_file_impl.h#newcode102 content/browser/download/download_file_impl.h:102: SourceStream(int64_t offset, int64_t bytes_written); On 2017/02/28 06:56:12, qinmin wrote: ...
3 years, 9 months ago (2017-02-28 23:24:21 UTC) #20
qinmin
https://codereview.chromium.org/2712713007/diff/40001/content/browser/download/download_file_impl.h File content/browser/download/download_file_impl.h (right): https://codereview.chromium.org/2712713007/diff/40001/content/browser/download/download_file_impl.h#newcode102 content/browser/download/download_file_impl.h:102: SourceStream(int64_t offset, int64_t bytes_written); On 2017/02/28 23:24:21, xingliu wrote: ...
3 years, 9 months ago (2017-03-01 00:01:12 UTC) #21
xingliu
Thanks for the suggestion, PHTAL. https://codereview.chromium.org/2712713007/diff/40001/content/browser/download/download_file_impl.h File content/browser/download/download_file_impl.h (right): https://codereview.chromium.org/2712713007/diff/40001/content/browser/download/download_file_impl.h#newcode102 content/browser/download/download_file_impl.h:102: SourceStream(int64_t offset, int64_t bytes_written); ...
3 years, 9 months ago (2017-03-01 19:25:07 UTC) #22
qinmin
https://codereview.chromium.org/2712713007/diff/80001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2712713007/diff/80001/content/browser/download/download_file_impl.cc#newcode367 content/browser/download/download_file_impl.cc:367: if (state == ByteStreamReader::STREAM_COMPLETE) { do we need to ...
3 years, 9 months ago (2017-03-02 00:12:23 UTC) #27
xingliu
PHTAL, thanks. https://codereview.chromium.org/2712713007/diff/80001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2712713007/diff/80001/content/browser/download/download_file_impl.cc#newcode367 content/browser/download/download_file_impl.cc:367: if (state == ByteStreamReader::STREAM_COMPLETE) { On 2017/03/02 ...
3 years, 9 months ago (2017-03-02 01:18:36 UTC) #30
qinmin
lgtm % nits https://codereview.chromium.org/2712713007/diff/80001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2712713007/diff/80001/content/browser/download/download_file_impl.cc#newcode76 content/browser/download/download_file_impl.cc:76: base::MakeUnique<SourceStream>(save_info_->offset, 0); nit: s/0/DownloadSaveInfo::kLengthFullContent/ https://codereview.chromium.org/2712713007/diff/80001/content/browser/download/download_file_impl.cc#newcode311 content/browser/download/download_file_impl.cc:311: ...
3 years, 9 months ago (2017-03-02 17:21:34 UTC) #33
David Trainor- moved to gerrit
lgtm % nits https://codereview.chromium.org/2712713007/diff/100001/content/browser/download/download_file_factory.cc File content/browser/download/download_file_factory.cc (right): https://codereview.chromium.org/2712713007/diff/100001/content/browser/download/download_file_factory.cc#newcode22 content/browser/download/download_file_factory.cc:22: std::move(byte_stream), net_log, false, observer); Maybe add ...
3 years, 9 months ago (2017-03-02 18:24:50 UTC) #34
xingliu
PTAL, thanks. alexmos@chromium.org: Please review changes in content/public/test/test_file_error_injector.cc https://codereview.chromium.org/2712713007/diff/80001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2712713007/diff/80001/content/browser/download/download_file_impl.cc#newcode76 content/browser/download/download_file_impl.cc:76: base::MakeUnique<SourceStream>(save_info_->offset, ...
3 years, 9 months ago (2017-03-02 19:21:21 UTC) #38
asanka
https://codereview.chromium.org/2712713007/diff/100001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2712713007/diff/100001/content/browser/download/download_file_impl.cc#newcode45 content/browser/download/download_file_impl.cc:45: : offset_(offset), length_(length), bytes_written_(0), finished_(false) {} Is this 'git ...
3 years, 9 months ago (2017-03-02 19:37:44 UTC) #41
alexmos
content/public/test/test_file_error_injector.cc LGTM once asanka@'s comments are addressed. https://codereview.chromium.org/2712713007/diff/140001/content/public/test/test_file_error_injector.cc File content/public/test/test_file_error_injector.cc (right): https://codereview.chromium.org/2712713007/diff/140001/content/public/test/test_file_error_injector.cc#newcode114 content/public/test/test_file_error_injector.cc:114: false, nit: ...
3 years, 9 months ago (2017-03-02 21:45:14 UTC) #42
xingliu
Hi, thanks for the feedback, please take another look. https://codereview.chromium.org/2712713007/diff/100001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2712713007/diff/100001/content/browser/download/download_file_impl.cc#newcode45 content/browser/download/download_file_impl.cc:45: ...
3 years, 9 months ago (2017-03-02 23:06:15 UTC) #45
asanka
LGTM thanks!
3 years, 9 months ago (2017-03-03 15:23:12 UTC) #52
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/2712713007/170001
3 years, 9 months ago (2017-03-03 23:23:05 UTC) #59
commit-bot: I haz the power
3 years, 9 months ago (2017-03-03 23:29:52 UTC) #62
Message was sent while issue was closed.
Committed patchset #10 (id:170001) as
https://chromium.googlesource.com/chromium/src/+/992dacf666e6750a1911caebe43b...

Powered by Google App Engine
This is Rietveld 408576698