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

Issue 9270030: net: Don't merge HTTP headers and body if the body is not in memory. (Closed)

Created:
8 years, 11 months ago by satorux1
Modified:
8 years, 11 months ago
Reviewers:
wtc, agl
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

net: Don't merge HTTP headers and body if the body is not in memory. UploadDataStream::MarkConsumedAndFillBuffer() may touch the file system if the body data comes from a file. BUG=72001, 107966 TEST=added tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=118769

Patch Set 1 #

Patch Set 2 : fix win build #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -27 lines) Patch
M net/base/upload_data.h View 1 chunk +4 lines, -0 lines 0 comments Download
M net/base/upload_data.cc View 1 chunk +12 lines, -0 lines 4 comments Download
M net/base/upload_data_stream.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M net/base/upload_data_stream.cc View 1 chunk +4 lines, -0 lines 0 comments Download
A net/base/upload_data_unittest.cc View 1 1 chunk +61 lines, -0 lines 0 comments Download
M net/http/http_stream_parser.h View 1 1 chunk +5 lines, -0 lines 3 comments Download
M net/http/http_stream_parser.cc View 1 2 chunks +37 lines, -27 lines 1 comment Download
M net/http/http_stream_parser_unittest.cc View 2 chunks +70 lines, -0 lines 0 comments Download
M net/net.gyp View 1 chunk +1 line, -0 lines 1 comment Download

Messages

Total messages: 7 (0 generated)
satorux1
8 years, 11 months ago (2012-01-21 00:17:42 UTC) #1
agl
LGTM. The previous change was merged to M17 as a compat fix. Do we need ...
8 years, 11 months ago (2012-01-23 15:01:31 UTC) #2
satorux1
We don't need to merge this patch. Practically, UploadDataStream has contents of a small file ...
8 years, 11 months ago (2012-01-23 17:25:15 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/satorux@chromium.org/9270030/9001
8 years, 11 months ago (2012-01-23 22:45:41 UTC) #4
commit-bot: I haz the power
Change committed as 118769
8 years, 11 months ago (2012-01-24 01:07:53 UTC) #5
wtc
Patch Set 2 LGTM. I have a question and some suggested changes below. http://codereview.chromium.org/9270030/diff/9001/net/base/upload_data.cc File ...
8 years, 11 months ago (2012-01-24 19:08:03 UTC) #6
satorux1
8 years, 11 months ago (2012-01-24 19:25:42 UTC) #7
wtc, thank you for the comments. created a follow-up patch based on your
comments:

https://chromiumcodereview.appspot.com/9284033

http://codereview.chromium.org/9270030/diff/9001/net/base/upload_data.cc
File net/base/upload_data.cc (right):

http://codereview.chromium.org/9270030/diff/9001/net/base/upload_data.cc#newc...
net/base/upload_data.cc:181: // Chunks are provided as a stream, hence it's not
in memory.
On 2012/01/24 19:08:04, wtc wrote:
> 
> Nit: this comment is not 100% accurate.  Chunks are in memory,
> but UploadData does not have all the chunks at once.

Done.

http://codereview.chromium.org/9270030/diff/9001/net/base/upload_data.cc#newc...
net/base/upload_data.cc:182: if (is_chunked_)
On 2012/01/24 19:08:04, wtc wrote:
> 
> Question: Is this test necessary?  If is_chunked_ is true,
> then the elements have the type TYPE_CHUNK.  (See
> UploadData::Element::SetToChunk().)  So it seems that it is
> sufficient to just check for TYPE_BYTES below.

I originally thought about it, but there is a case when is_chunk_ is set to
true, but the first chunk is not yet delivered, so checking this here is needed.
Added a comment about it.

http://codereview.chromium.org/9270030/diff/9001/net/http/http_stream_parser.h
File net/http/http_stream_parser.h (right):

http://codereview.chromium.org/9270030/diff/9001/net/http/http_stream_parser....
net/http/http_stream_parser.h:96: static bool ShouldMerge(const std::string&
request,
On 2012/01/24 19:08:04, wtc wrote:
> 
> The 'request' parameter should be renamed 'request_headers'.
> 
> Nit: this method name should say what should be merged.
> For example, ShouldMergeRequestBody or the more verbose
> ShouldMergeRequestHeadersAndBody.

I like the idea and chose the latter.

Powered by Google App Engine
This is Rietveld 408576698