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

Issue 2737033002: Update the received slices vector when stream is written to disk (Closed)

Created:
3 years, 9 months ago by qinmin
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

Update the received slices vector when stream is written to disk Whenever new data is written to disk, we should update the received slices vector. This could impact existing SourceStream objects as their length could get truncated. This CL introduces the logic to update both the received slices vector and update existing SourceStream objects. Because the update is very frequent, SourceStream now holds an index to the vector. So that they can update the vector efficiently. BUG=644352 Review-Url: https://codereview.chromium.org/2737033002 Cr-Commit-Position: refs/heads/master@{#456796} Committed: https://chromium.googlesource.com/chromium/src/+/cde3c3a4b12244b382390ee59b5484074e364b6e

Patch Set 1 #

Total comments: 9

Patch Set 2 : nits #

Patch Set 3 : merge a new slice with existing ones #

Total comments: 3

Patch Set 4 : fix unit test #

Total comments: 17

Patch Set 5 : addressing comments #

Patch Set 6 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -10 lines) Patch
M content/browser/download/download_file_impl.h View 1 2 3 4 4 chunks +14 lines, -1 line 0 comments Download
M content/browser/download/download_file_impl.cc View 1 2 3 4 5 4 chunks +45 lines, -2 lines 0 comments Download
M content/browser/download/download_file_unittest.cc View 1 2 3 5 chunks +16 lines, -7 lines 0 comments Download
M content/browser/download/parallel_download_utils.h View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/download/parallel_download_utils.cc View 1 2 3 4 2 chunks +25 lines, -0 lines 0 comments Download
M content/browser/download/parallel_download_utils_unittest.cc View 1 2 3 4 5 1 chunk +36 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (22 generated)
qinmin
PTAL
3 years, 9 months ago (2017-03-07 20:01:01 UTC) #2
xingliu
https://codereview.chromium.org/2737033002/diff/20001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2737033002/diff/20001/content/browser/download/download_file_impl.cc#newcode451 content/browser/download/download_file_impl.cc:451: void DownloadFileImpl::AddNewSlice(int64_t offset, int64_t length) { This in general ...
3 years, 9 months ago (2017-03-07 22:18:13 UTC) #4
qinmin
https://codereview.chromium.org/2737033002/diff/20001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2737033002/diff/20001/content/browser/download/download_file_impl.cc#newcode451 content/browser/download/download_file_impl.cc:451: void DownloadFileImpl::AddNewSlice(int64_t offset, int64_t length) { On 2017/03/07 22:18:13, ...
3 years, 9 months ago (2017-03-08 18:46:33 UTC) #5
xingliu
lgtm with nits. https://codereview.chromium.org/2737033002/diff/20001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2737033002/diff/20001/content/browser/download/download_file_impl.cc#newcode451 content/browser/download/download_file_impl.cc:451: void DownloadFileImpl::AddNewSlice(int64_t offset, int64_t length) { ...
3 years, 9 months ago (2017-03-08 19:45:18 UTC) #6
xingliu
no lgtm, since crashing in download in linux build.
3 years, 9 months ago (2017-03-08 19:51:44 UTC) #7
qinmin
On 2017/03/08 19:51:44, xingliu wrote: > no lgtm, since crashing in download in linux build. ...
3 years, 9 months ago (2017-03-08 21:59:00 UTC) #9
qinmin
https://codereview.chromium.org/2737033002/diff/20001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2737033002/diff/20001/content/browser/download/download_file_impl.cc#newcode454 content/browser/download/download_file_impl.cc:454: int index = AddReceivedSliceToSortedArray( On 2017/03/08 19:45:18, xingliu wrote: ...
3 years, 9 months ago (2017-03-08 21:59:05 UTC) #10
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/2737033002/80001
3 years, 9 months ago (2017-03-08 22:00:47 UTC) #13
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
3 years, 9 months ago (2017-03-08 22:00:48 UTC) #15
xingliu
https://codereview.chromium.org/2737033002/diff/80001/content/browser/download/parallel_download_utils.cc File content/browser/download/parallel_download_utils.cc (right): https://codereview.chromium.org/2737033002/diff/80001/content/browser/download/parallel_download_utils.cc#newcode77 content/browser/download/parallel_download_utils.cc:77: if (prev->offset + prev->received_bytes == new_slice.offset) { Do we ...
3 years, 9 months ago (2017-03-09 01:33:53 UTC) #20
qinmin
https://codereview.chromium.org/2737033002/diff/80001/content/browser/download/parallel_download_utils.cc File content/browser/download/parallel_download_utils.cc (right): https://codereview.chromium.org/2737033002/diff/80001/content/browser/download/parallel_download_utils.cc#newcode77 content/browser/download/parallel_download_utils.cc:77: if (prev->offset + prev->received_bytes == new_slice.offset) { On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 05:43:54 UTC) #21
xingliu
https://codereview.chromium.org/2737033002/diff/80001/content/browser/download/parallel_download_utils.cc File content/browser/download/parallel_download_utils.cc (right): https://codereview.chromium.org/2737033002/diff/80001/content/browser/download/parallel_download_utils.cc#newcode77 content/browser/download/parallel_download_utils.cc:77: if (prev->offset + prev->received_bytes == new_slice.offset) { On 2017/03/09 ...
3 years, 9 months ago (2017-03-09 05:46:07 UTC) #22
qinmin
Unit tests are now fixed, PTAL again.
3 years, 9 months ago (2017-03-09 14:36:59 UTC) #27
David Trainor- moved to gerrit
https://codereview.chromium.org/2737033002/diff/100001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2737033002/diff/100001/content/browser/download/download_file_impl.cc#newcode323 content/browser/download/download_file_impl.cc:323: // If the write operation creates a new slice, ...
3 years, 9 months ago (2017-03-09 17:44:03 UTC) #28
qinmin
https://codereview.chromium.org/2737033002/diff/100001/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2737033002/diff/100001/content/browser/download/download_file_impl.cc#newcode323 content/browser/download/download_file_impl.cc:323: // If the write operation creates a new slice, ...
3 years, 9 months ago (2017-03-09 21:44:58 UTC) #29
qinmin
ping, dtrainor@, would you please take another look?
3 years, 9 months ago (2017-03-10 18:57:10 UTC) #32
David Trainor- moved to gerrit
lgtm % nit. https://codereview.chromium.org/2737033002/diff/100001/content/browser/download/parallel_download_utils_unittest.cc File content/browser/download/parallel_download_utils_unittest.cc (right): https://codereview.chromium.org/2737033002/diff/100001/content/browser/download/parallel_download_utils_unittest.cc#newcode69 content/browser/download/parallel_download_utils_unittest.cc:69: EXPECT_EQ(500, slices[0].offset); On 2017/03/09 21:44:58, qinmin ...
3 years, 9 months ago (2017-03-14 15:07:31 UTC) #35
qinmin
https://codereview.chromium.org/2737033002/diff/100001/content/browser/download/parallel_download_utils_unittest.cc File content/browser/download/parallel_download_utils_unittest.cc (right): https://codereview.chromium.org/2737033002/diff/100001/content/browser/download/parallel_download_utils_unittest.cc#newcode83 content/browser/download/parallel_download_utils_unittest.cc:83: // A new slice can only merge with a ...
3 years, 9 months ago (2017-03-14 18:32:40 UTC) #36
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/2737033002/140001
3 years, 9 months ago (2017-03-14 18:33:33 UTC) #39
commit-bot: I haz the power
3 years, 9 months ago (2017-03-14 19:53:24 UTC) #42
Message was sent while issue was closed.
Committed patchset #6 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/cde3c3a4b12244b382390ee59b54...

Powered by Google App Engine
This is Rietveld 408576698