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

Issue 2055083002: [Cronet] Fix CronetFixedModeOutputStream to not write more bytes than specified (Closed)

Created:
4 years, 6 months ago by xunjieli
Modified:
4 years, 6 months ago
Reviewers:
pauljensen
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Cronet] Fix CronetFixedModeOutputStream to not write more bytes than specified This CL fixes CronetFixedModeOutputStream to not send more data than what has been written by consumer. Before this patch, the code was trying to write the whole mBuffer even if it is partially filled. This results in more data being written to the CronetUploadDataStream. This CL adds a test which will fail without this patch with an error message that complains writing more bytes than content-length. BUG=618872 Committed: https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f Cr-Commit-Position: refs/heads/master@{#399706}

Patch Set 1 #

Patch Set 2 : #

Total comments: 13

Patch Set 3 : Paul's comments #

Total comments: 16

Patch Set 4 : Address Paul's comments #

Total comments: 33

Patch Set 5 : Address comments #

Total comments: 6

Patch Set 6 : address comments #

Patch Set 7 : add @VisibleForTesting #

Total comments: 6

Patch Set 8 : address comments #

Messages

Total messages: 40 (17 generated)
xunjieli
4 years, 6 months ago (2016-06-09 23:58:42 UTC) #10
xunjieli
https://codereview.chromium.org/2055083002/diff/50001/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java File components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java (left): https://codereview.chromium.org/2055083002/diff/50001/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java#oldcode63 components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java:63: while (mBuffer.position() == mBuffer.limit()) { I can't remember why ...
4 years, 6 months ago (2016-06-10 00:10:48 UTC) #11
pauljensen
I'm pretty confused by the prior code and the new code. Neither has a comment ...
4 years, 6 months ago (2016-06-10 13:27:39 UTC) #12
xunjieli
> I'm pretty confused by the prior code and the new code. Neither has a ...
4 years, 6 months ago (2016-06-10 14:05:00 UTC) #13
pauljensen
On 2016/06/10 14:05:00, xunjieli wrote: > > I'm pretty confused by the prior code and ...
4 years, 6 months ago (2016-06-10 15:05:25 UTC) #15
xunjieli
Thanks for the review! I added a comment in the code to document the two ...
4 years, 6 months ago (2016-06-10 16:09:18 UTC) #17
pauljensen
https://codereview.chromium.org/2055083002/diff/70001/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java File components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java (right): https://codereview.chromium.org/2055083002/diff/70001/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java#newcode163 components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java:163: mBuffer.limit(oldLimit); On 2016/06/10 16:09:18, xunjieli wrote: > On 2016/06/10 ...
4 years, 6 months ago (2016-06-10 17:45:45 UTC) #18
xunjieli
Thanks for the review! PTAL. https://codereview.chromium.org/2055083002/diff/70001/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java File components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java (right): https://codereview.chromium.org/2055083002/diff/70001/components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java#newcode163 components/cronet/android/java/src/org/chromium/net/urlconnection/CronetFixedModeOutputStream.java:163: mBuffer.limit(oldLimit); On 2016/06/10 17:45:44, ...
4 years, 6 months ago (2016-06-10 18:48:13 UTC) #19
pauljensen
https://codereview.chromium.org/2055083002/diff/130001/components/cronet/android/test/javatests/src/org/chromium/net/QuicUploadTest.java File components/cronet/android/test/javatests/src/org/chromium/net/QuicUploadTest.java (right): https://codereview.chromium.org/2055083002/diff/130001/components/cronet/android/test/javatests/src/org/chromium/net/QuicUploadTest.java#newcode5 components/cronet/android/test/javatests/src/org/chromium/net/QuicUploadTest.java:5: package org.chromium.net; I think this should be moved to ...
4 years, 6 months ago (2016-06-13 12:22:13 UTC) #20
xunjieli
Thanks for the review! I wasn't able to add @VisibleForTesting to CronetEngine.java. Looks like it ...
4 years, 6 months ago (2016-06-13 14:23:24 UTC) #22
pauljensen
On 2016/06/13 14:23:24, xunjieli wrote: > Thanks for the review! I wasn't able to add ...
4 years, 6 months ago (2016-06-13 15:42:06 UTC) #23
xunjieli
On 2016/06/13 15:42:06, pauljensen wrote: > On 2016/06/13 14:23:24, xunjieli wrote: > > Thanks for ...
4 years, 6 months ago (2016-06-13 15:51:42 UTC) #24
xunjieli
Paul: a friendly ping.. If possible, I am hoping to get this in this week's ...
4 years, 6 months ago (2016-06-14 12:42:30 UTC) #25
pauljensen
https://codereview.chromium.org/2055083002/diff/190001/components/cronet/android/api/src/org/chromium/net/CronetEngine.java File components/cronet/android/api/src/org/chromium/net/CronetEngine.java (right): https://codereview.chromium.org/2055083002/diff/190001/components/cronet/android/api/src/org/chromium/net/CronetEngine.java#newcode593 components/cronet/android/api/src/org/chromium/net/CronetEngine.java:593: * @return the builder to facilitate chaining. needs @hide ...
4 years, 6 months ago (2016-06-14 12:50:32 UTC) #26
xunjieli
Thanks for the review! PTAL https://codereview.chromium.org/2055083002/diff/190001/components/cronet/android/api/src/org/chromium/net/CronetEngine.java File components/cronet/android/api/src/org/chromium/net/CronetEngine.java (right): https://codereview.chromium.org/2055083002/diff/190001/components/cronet/android/api/src/org/chromium/net/CronetEngine.java#newcode593 components/cronet/android/api/src/org/chromium/net/CronetEngine.java:593: * @return the builder ...
4 years, 6 months ago (2016-06-14 13:12:48 UTC) #27
pauljensen
lgtm
4 years, 6 months ago (2016-06-14 13:25:18 UTC) #28
xunjieli
thanks a lot for the review!
4 years, 6 months ago (2016-06-14 13:26:32 UTC) #29
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2055083002/210001
4 years, 6 months ago (2016-06-14 13:27:03 UTC) #31
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-14 14:51:27 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2055083002/210001
4 years, 6 months ago (2016-06-14 14:58:01 UTC) #35
commit-bot: I haz the power
Committed patchset #8 (id:210001)
4 years, 6 months ago (2016-06-14 15:03:02 UTC) #37
commit-bot: I haz the power
CQ bit was unchecked
4 years, 6 months ago (2016-06-14 15:03:10 UTC) #38
commit-bot: I haz the power
4 years, 6 months ago (2016-06-14 15:04:39 UTC) #40
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/a5c5c291f250fc26e4eb6322edb776800c974e7f
Cr-Commit-Position: refs/heads/master@{#399706}

Powered by Google App Engine
This is Rietveld 408576698