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

Unified Diff: net/http/http_stream_parser.cc

Issue 9284033: net: Give more descriptive names for code around the request merging logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/http/http_stream_parser.cc
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 7966889e1f38c24c3da9e89877a0bb4b4f8df360..be1c828bfb3eef6123b19555c3fe7aabb0b642fc 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;
}

Powered by Google App Engine
This is Rietveld 408576698