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

Issue 2451833004: Fix net::BrotliSourceStream to ignore trailing data. (Closed)

Created:
4 years, 1 month ago by xunjieli
Modified:
4 years, 1 month ago
Reviewers:
eustas, mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, mmenke, Randy Smith (Not in Mondays)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix net::BrotliSourceStream to ignore trailing data. When net::BrotliSourceStream is given a valid input but with trailing data, BrotliSourceStream will consume valid input but not the trailing data. This triggers a DCHECK in FilterSourceStream which asserts that either all bytes are consumed or bytes written is not 0. This CL matches the original implementation (net::BrotliFilter) more closely. If there is any trailing data, the data will be ignored. This CL adds a regression test which without the patch will trigger the DCHECK. BUG=659311 Committed: https://crrev.com/c4780eac0d48c8b57244a9cbcf8bfe7271b532f4 Cr-Commit-Position: refs/heads/master@{#427770}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Added tests #

Patch Set 3 : Added two extra tests #

Total comments: 3

Patch Set 4 : remove cast #

Total comments: 14

Patch Set 5 : Address comment and add EOF read #

Total comments: 2

Patch Set 6 : add const #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -1 line) Patch
M net/filter/brotli_source_stream.cc View 2 chunks +11 lines, -0 lines 0 comments Download
M net/filter/brotli_source_stream_unittest.cc View 1 2 3 4 5 2 chunks +74 lines, -1 line 0 comments Download

Messages

Total messages: 36 (22 generated)
xunjieli
eustas@: PTAL. Thanks! mmenke, rdsmith: FYI. https://codereview.chromium.org/2451833004/diff/1/net/filter/brotli_source_stream.cc File net/filter/brotli_source_stream.cc (right): https://codereview.chromium.org/2451833004/diff/1/net/filter/brotli_source_stream.cc#newcode102 net/filter/brotli_source_stream.cc:102: return ERR_CONTENT_DECODING_FAILED; The ...
4 years, 1 month ago (2016-10-26 13:59:07 UTC) #4
mmenke
https://codereview.chromium.org/2451833004/diff/1/net/filter/brotli_source_stream.cc File net/filter/brotli_source_stream.cc (right): https://codereview.chromium.org/2451833004/diff/1/net/filter/brotli_source_stream.cc#newcode98 net/filter/brotli_source_stream.cc:98: return OK; I think the test only covers one ...
4 years, 1 month ago (2016-10-26 14:11:04 UTC) #8
mmenke
4 years, 1 month ago (2016-10-26 14:11:05 UTC) #9
xunjieli
SGTM! I will work on the tests.
4 years, 1 month ago (2016-10-26 14:12:44 UTC) #10
eustas
lgtm Looks good (since it does not allow developers append extra data after main stream).
4 years, 1 month ago (2016-10-26 14:56:55 UTC) #13
xunjieli
Thanks for the review! PTAL. I added two more test cases. For the "decoding_status_ != ...
4 years, 1 month ago (2016-10-26 15:14:38 UTC) #14
xunjieli
https://codereview.chromium.org/2451833004/diff/40001/net/filter/brotli_source_stream_unittest.cc File net/filter/brotli_source_stream_unittest.cc (right): https://codereview.chromium.org/2451833004/diff/40001/net/filter/brotli_source_stream_unittest.cc#newcode302 net/filter/brotli_source_stream_unittest.cc:302: EXPECT_EQ(ERR_CONTENT_DECODING_FAILED, error); On 2016/10/26 15:14:38, xunjieli wrote: > Note ...
4 years, 1 month ago (2016-10-26 15:23:21 UTC) #17
mmenke
https://codereview.chromium.org/2451833004/diff/60001/net/filter/brotli_source_stream_unittest.cc File net/filter/brotli_source_stream_unittest.cc (right): https://codereview.chromium.org/2451833004/diff/60001/net/filter/brotli_source_stream_unittest.cc#newcode102 net/filter/brotli_source_stream_unittest.cc:102: // available bytes and return 0. Comment isn't very ...
4 years, 1 month ago (2016-10-26 16:39:57 UTC) #22
xunjieli
PTAL. thanks! https://codereview.chromium.org/2451833004/diff/60001/net/filter/brotli_source_stream_unittest.cc File net/filter/brotli_source_stream_unittest.cc (right): https://codereview.chromium.org/2451833004/diff/60001/net/filter/brotli_source_stream_unittest.cc#newcode102 net/filter/brotli_source_stream_unittest.cc:102: // available bytes and return 0. On ...
4 years, 1 month ago (2016-10-26 17:26:19 UTC) #27
mmenke
LGTM https://codereview.chromium.org/2451833004/diff/80001/net/filter/brotli_source_stream_unittest.cc File net/filter/brotli_source_stream_unittest.cc (right): https://codereview.chromium.org/2451833004/diff/80001/net/filter/brotli_source_stream_unittest.cc#newcode105 net/filter/brotli_source_stream_unittest.cc:105: unsigned char kResponse[] = {0x1A, 0xDF, 0x6E, 0x74, ...
4 years, 1 month ago (2016-10-26 17:28:20 UTC) #28
xunjieli
Thanks! https://codereview.chromium.org/2451833004/diff/80001/net/filter/brotli_source_stream_unittest.cc File net/filter/brotli_source_stream_unittest.cc (right): https://codereview.chromium.org/2451833004/diff/80001/net/filter/brotli_source_stream_unittest.cc#newcode105 net/filter/brotli_source_stream_unittest.cc:105: unsigned char kResponse[] = {0x1A, 0xDF, 0x6E, 0x74, ...
4 years, 1 month ago (2016-10-26 17:49:50 UTC) #29
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/2451833004/100001
4 years, 1 month ago (2016-10-26 17:50:21 UTC) #32
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 1 month ago (2016-10-26 19:06:07 UTC) #34
commit-bot: I haz the power
4 years, 1 month ago (2016-10-26 19:22:24 UTC) #36
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/c4780eac0d48c8b57244a9cbcf8bfe7271b532f4
Cr-Commit-Position: refs/heads/master@{#427770}

Powered by Google App Engine
This is Rietveld 408576698