summaryrefslogtreecommitdiffstats
path: root/net/http/http_stream_parser.cc
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-24 23:41:50 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-24 23:41:50 +0000
commit75577eca2e0090635fb1aaafe46dd3a6bb0af692 (patch)
treea3e963dbb16a137ed112d0a5be5286f6b15c60c8 /net/http/http_stream_parser.cc
parent7a747b5992ad9de44e2653a85a6fd78254cfe535 (diff)
downloadchromium_src-75577eca2e0090635fb1aaafe46dd3a6bb0af692.zip
chromium_src-75577eca2e0090635fb1aaafe46dd3a6bb0af692.tar.gz
chromium_src-75577eca2e0090635fb1aaafe46dd3a6bb0af692.tar.bz2
net: Give more descriptive names for code around the request merging logic.
This is a follow-up patch based on wtc's comments on the earlier patch: http://codereview.chromium.org/9270030/ BUG=72001 TEST=no logic change Review URL: http://codereview.chromium.org/9284033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_stream_parser.cc')
-rw-r--r--net/http/http_stream_parser.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 7966889..be1c828 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -139,7 +139,7 @@ int HttpStreamParser::SendRequest(const std::string& request_line,
// If we have a small request body, then we'll merge with the headers into a
// single write.
bool did_merge = false;
- if (ShouldMerge(request, request_body_.get())) {
+ if (ShouldMergeRequestHeadersAndBody(request, request_body_.get())) {
size_t merged_size = request.size() + request_body->size();
scoped_refptr<IOBuffer> merged_request_headers_and_body(
new IOBuffer(merged_size));
@@ -811,13 +811,14 @@ int HttpStreamParser::EncodeChunk(const base::StringPiece& payload,
}
// static
-bool HttpStreamParser::ShouldMerge(const std::string& request,
- const UploadDataStream* request_body) {
+bool HttpStreamParser::ShouldMergeRequestHeadersAndBody(
+ const std::string& request_headers,
+ const UploadDataStream* request_body) {
if (request_body != NULL &&
// IsInMemory() ensures that the request body is not chunked.
request_body->IsInMemory() &&
request_body->size() > 0) {
- size_t merged_size = request.size() + request_body->size();
+ size_t merged_size = request_headers.size() + request_body->size();
if (merged_size <= kMaxMergedHeaderAndBodySize)
return true;
}