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

Issue 2770303002: Add a helper method to truncate SourceStream's length (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/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a helper method to truncate SourceStream's length To support half open requests, we need to truncate all SourceStreams when they came. This CL adds a helper method to truncate the SourceStream when they are active. And it fixes an issue that the usage of 0 can be very unclear. Also this CL makes the initial request half open so we can get the correct content-length. BUG=644352 Review-Url: https://codereview.chromium.org/2770303002 Cr-Commit-Position: refs/heads/master@{#459603} Committed: https://chromium.googlesource.com/chromium/src/+/aa5d2f477221a57cc51cdef53279c3b1453f63d3

Patch Set 1 #

Total comments: 9

Patch Set 2 : addressing comments #

Patch Set 3 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -8 lines) Patch
M content/browser/download/download_file_impl.h View 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/download/download_file_impl.cc View 1 2 7 chunks +40 lines, -7 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 16 (8 generated)
qinmin
PTAL
3 years, 9 months ago (2017-03-24 18:31:48 UTC) #2
xingliu
Some discussion. https://codereview.chromium.org/2770303002/diff/1/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2770303002/diff/1/content/browser/download/download_file_impl.cc#newcode74 content/browser/download/download_file_impl.cc:74: if (offset < offset_) { nit%: Should ...
3 years, 9 months ago (2017-03-24 19:13:47 UTC) #3
qinmin
https://codereview.chromium.org/2770303002/diff/1/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2770303002/diff/1/content/browser/download/download_file_impl.cc#newcode74 content/browser/download/download_file_impl.cc:74: if (offset < offset_) { On 2017/03/24 19:13:47, xingliu ...
3 years, 9 months ago (2017-03-24 20:39:01 UTC) #4
xingliu
https://codereview.chromium.org/2770303002/diff/1/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2770303002/diff/1/content/browser/download/download_file_impl.cc#newcode75 content/browser/download/download_file_impl.cc:75: if (offset + bytes_written > offset_) On 2017/03/24 20:39:01, ...
3 years, 9 months ago (2017-03-24 21:14:08 UTC) #5
qinmin
https://codereview.chromium.org/2770303002/diff/1/content/browser/download/download_file_impl.cc File content/browser/download/download_file_impl.cc (right): https://codereview.chromium.org/2770303002/diff/1/content/browser/download/download_file_impl.cc#newcode82 content/browser/download/download_file_impl.cc:82: length_ = offset - offset; On 2017/03/24 21:14:08, xingliu ...
3 years, 9 months ago (2017-03-24 21:38:31 UTC) #6
xingliu
lgtm, From now on, we need to check kNoBytesToWrite when SourceStream::length() is used.
3 years, 9 months ago (2017-03-24 22:17:42 UTC) #7
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/2770303002/40001
3 years, 9 months ago (2017-03-24 23:49:45 UTC) #13
commit-bot: I haz the power
3 years, 9 months ago (2017-03-24 23:55:55 UTC) #16
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/aa5d2f477221a57cc51cdef53279...

Powered by Google App Engine
This is Rietveld 408576698