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

Issue 10910268: net: Make UploadDataStream::Read() asynchronous (Closed)

Created:
8 years, 3 months ago by hashimoto
Modified:
8 years, 2 months ago
CC:
chromium-reviews, grt+watch_chromium.org, amit, robertshield, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

net: Make UploadDataStream::Read() asynchronous Rename existing Read() to ReadSync() Change type of |buf| from char* to scoped_refptr<IOBuffer> so that async operation is always performed safely Add an asynchronous implementation, Read() The newly added Read() is not used yet, all users still use the old version ReadSync() BUG=72001 TEST=net_unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=162343

Patch Set 1 : _ #

Total comments: 10

Patch Set 2 : Run callback if and only if there were async operation performed #

Patch Set 3 : rebase #

Total comments: 14

Patch Set 4 : rebase #

Patch Set 5 : Revised comments #

Total comments: 10

Patch Set 6 : Add comments about chunk upload behavior #

Total comments: 32

Patch Set 7 : Add comments, fix a bug where IsEOF() does not get true when the buf size equals to data size #

Total comments: 22

Patch Set 8 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+525 lines, -190 lines) Patch
M chrome_frame/urlmon_upload_data_stream.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/base/upload_bytes_element_reader.h View 1 chunk +4 lines, -1 line 0 comments Download
M net/base/upload_bytes_element_reader.cc View 1 2 3 4 5 6 3 chunks +14 lines, -6 lines 0 comments Download
M net/base/upload_bytes_element_reader_unittest.cc View 3 chunks +8 lines, -4 lines 0 comments Download
M net/base/upload_data.h View 1 2 3 4 5 6 2 chunks +8 lines, -1 line 0 comments Download
M net/base/upload_data_stream.h View 1 2 3 4 5 6 7 6 chunks +30 lines, -11 lines 0 comments Download
M net/base/upload_data_stream.cc View 1 2 3 4 5 6 5 chunks +71 lines, -4 lines 0 comments Download
M net/base/upload_data_stream_unittest.cc View 1 2 3 4 5 6 7 14 chunks +185 lines, -91 lines 0 comments Download
M net/base/upload_element_reader.h View 1 2 3 4 2 chunks +13 lines, -5 lines 0 comments Download
M net/base/upload_element_reader.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M net/base/upload_file_element_reader.h View 1 2 3 4 5 6 7 1 chunk +11 lines, -3 lines 0 comments Download
M net/base/upload_file_element_reader.cc View 1 2 3 4 5 6 7 7 chunks +93 lines, -49 lines 0 comments Download
M net/base/upload_file_element_reader_unittest.cc View 1 2 3 4 5 6 7 4 chunks +73 lines, -8 lines 0 comments Download
M net/http/http_stream_parser.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M net/http/http_stream_parser.cc View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
M net/spdy/spdy_http_stream.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
hashimoto
Could you review this?
8 years, 3 months ago (2012-09-24 12:49:12 UTC) #1
willchan no longer on Chromium
http://codereview.chromium.org/10910268/diff/16001/net/base/upload_data_stream.cc File net/base/upload_data_stream.cc (right): http://codereview.chromium.org/10910268/diff/16001/net/base/upload_data_stream.cc#newcode72 net/base/upload_data_stream.cc:72: // with ReadSync() since it requires special logic. Are ...
8 years, 2 months ago (2012-09-24 23:37:08 UTC) #2
hashimoto
http://codereview.chromium.org/10910268/diff/16001/net/base/upload_data_stream.cc File net/base/upload_data_stream.cc (right): http://codereview.chromium.org/10910268/diff/16001/net/base/upload_data_stream.cc#newcode72 net/base/upload_data_stream.cc:72: // with ReadSync() since it requires special logic. On ...
8 years, 2 months ago (2012-09-25 10:47:56 UTC) #3
hashimoto
willchan, Could you revisit this change? I think you are no longer super-busy now :)
8 years, 2 months ago (2012-10-08 16:38:34 UTC) #4
willchan no longer on Chromium
Matt, not sure if you're overloaded, but I am :) I'm probably going to start ...
8 years, 2 months ago (2012-10-08 23:16:23 UTC) #5
mmenke
On 2012/10/08 23:16:23, willchan wrote: > Matt, not sure if you're overloaded, but I am ...
8 years, 2 months ago (2012-10-08 23:18:21 UTC) #6
mmenke
On 2012/10/08 23:18:21, Matt Menke wrote: > On 2012/10/08 23:16:23, willchan wrote: > > Matt, ...
8 years, 2 months ago (2012-10-09 16:42:04 UTC) #7
mmenke
http://codereview.chromium.org/10910268/diff/46001/net/base/upload_data_stream.cc File net/base/upload_data_stream.cc (right): http://codereview.chromium.org/10910268/diff/46001/net/base/upload_data_stream.cc#newcode90 net/base/upload_data_stream.cc:90: DCHECK_EQ(UploadElement::TYPE_BYTES, element.type()); Wait...so we allow TYPE_BYTES to be added ...
8 years, 2 months ago (2012-10-11 18:05:40 UTC) #8
hashimoto
http://codereview.chromium.org/10910268/diff/46001/net/base/upload_data_stream.cc File net/base/upload_data_stream.cc (right): http://codereview.chromium.org/10910268/diff/46001/net/base/upload_data_stream.cc#newcode90 net/base/upload_data_stream.cc:90: DCHECK_EQ(UploadElement::TYPE_BYTES, element.type()); On 2012/10/11 18:05:40, Matt Menke wrote: > ...
8 years, 2 months ago (2012-10-12 07:36:56 UTC) #9
mmenke
Some more comments - didn't have time for a full round of comments today, so ...
8 years, 2 months ago (2012-10-12 21:30:29 UTC) #10
hashimoto
http://codereview.chromium.org/10910268/diff/46001/net/base/upload_data_stream.cc File net/base/upload_data_stream.cc (right): http://codereview.chromium.org/10910268/diff/46001/net/base/upload_data_stream.cc#newcode90 net/base/upload_data_stream.cc:90: DCHECK_EQ(UploadElement::TYPE_BYTES, element.type()); On 2012/10/12 21:30:29, Matt Menke wrote: > ...
8 years, 2 months ago (2012-10-15 11:21:37 UTC) #11
mmenke
Thanks for bearing with me as I learn this code. Sorry I've been a little ...
8 years, 2 months ago (2012-10-15 19:54:45 UTC) #12
mmenke
https://chromiumcodereview.appspot.com/10910268/diff/74002/net/base/upload_file_element_reader.cc File net/base/upload_file_element_reader.cc (right): https://chromiumcodereview.appspot.com/10910268/diff/74002/net/base/upload_file_element_reader.cc#newcode125 net/base/upload_file_element_reader.cc:125: file_stream_.release()), Are we leaking stuff here? It looks like ...
8 years, 2 months ago (2012-10-15 21:34:01 UTC) #13
hashimoto
http://codereview.chromium.org/10910268/diff/74002/net/base/upload_bytes_element_reader.cc File net/base/upload_bytes_element_reader.cc (right): http://codereview.chromium.org/10910268/diff/74002/net/base/upload_bytes_element_reader.cc#newcode45 net/base/upload_bytes_element_reader.cc:45: const CompletionCallback& callback) { On 2012/10/15 19:54:45, Matt Menke ...
8 years, 2 months ago (2012-10-16 11:52:19 UTC) #14
mmenke
LGTM, just minor comments. http://codereview.chromium.org/10910268/diff/74002/net/base/upload_data_stream.cc File net/base/upload_data_stream.cc (right): http://codereview.chromium.org/10910268/diff/74002/net/base/upload_data_stream.cc#newcode204 net/base/upload_data_stream.cc:204: int bytes_copied, On 2012/10/16 11:52:20, ...
8 years, 2 months ago (2012-10-16 19:13:41 UTC) #15
hashimoto
http://codereview.chromium.org/10910268/diff/74002/net/base/upload_data_stream.cc File net/base/upload_data_stream.cc (right): http://codereview.chromium.org/10910268/diff/74002/net/base/upload_data_stream.cc#newcode204 net/base/upload_data_stream.cc:204: int bytes_copied, On 2012/10/16 19:13:41, Matt Menke wrote: > ...
8 years, 2 months ago (2012-10-17 08:04:30 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hashimoto@chromium.org/10910268/101001
8 years, 2 months ago (2012-10-17 08:07:02 UTC) #17
commit-bot: I haz the power
8 years, 2 months ago (2012-10-17 10:15:23 UTC) #18
Change committed as 162343

Powered by Google App Engine
This is Rietveld 408576698