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

Unified Diff: net/test/embedded_test_server/http_request.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/test/embedded_test_server/http_request.cc
diff --git a/net/test/embedded_test_server/http_request.cc b/net/test/embedded_test_server/http_request.cc
index f1bf302a3fd7fe0485cacc4001b4d2ad801b390e..cf78bd2dd435c4854cc5508dba261918a8247d0b 100644
--- a/net/test/embedded_test_server/http_request.cc
+++ b/net/test/embedded_test_server/http_request.cc
@@ -27,8 +27,7 @@ std::string Trim(const std::string& value) {
} // namespace
-HttpRequest::HttpRequest() : method(METHOD_UNKNOWN),
- has_content(false) {
+HttpRequest::HttpRequest() : method(METHOD_UNKNOWN), has_content(false) {
}
HttpRequest::~HttpRequest() {
@@ -46,8 +45,8 @@ HttpRequestParser::~HttpRequestParser() {
void HttpRequestParser::ProcessChunk(const base::StringPiece& data) {
data.AppendToString(&buffer_);
- DCHECK_LE(buffer_.size() + data.size(), kRequestSizeLimit) <<
- "The HTTP request is too large.";
+ DCHECK_LE(buffer_.size() + data.size(), kRequestSizeLimit)
+ << "The HTTP request is too large.";
}
std::string HttpRequestParser::ShiftLine() {
@@ -89,16 +88,16 @@ HttpRequestParser::ParseResult HttpRequestParser::ParseHeaders() {
base::SplitString(header_line, ' ', &header_line_tokens);
DCHECK_EQ(3u, header_line_tokens.size());
// Method.
- http_request_->method = GetMethodType(StringToLowerASCII(
- header_line_tokens[0]));
+ http_request_->method =
+ GetMethodType(StringToLowerASCII(header_line_tokens[0]));
// Address.
// Don't build an absolute URL as the parser does not know (should not
// know) anything about the server address.
http_request_->relative_url = header_line_tokens[1];
// Protocol.
const std::string protocol = StringToLowerASCII(header_line_tokens[2]);
- CHECK(protocol == "http/1.0" || protocol == "http/1.1") <<
- "Protocol not supported: " << protocol;
+ CHECK(protocol == "http/1.0" || protocol == "http/1.1")
+ << "Protocol not supported: " << protocol;
}
// Parse further headers.
@@ -120,8 +119,7 @@ HttpRequestParser::ParseResult HttpRequestParser::ParseHeaders() {
DCHECK_NE(std::string::npos, delimiter_pos) << "Syntax error.";
header_name = Trim(header_line.substr(0, delimiter_pos));
std::string header_value = Trim(header_line.substr(
- delimiter_pos + 1,
- header_line.size() - delimiter_pos - 1));
+ delimiter_pos + 1, header_line.size() - delimiter_pos - 1));
http_request_->headers[header_name] = header_value;
}
}
@@ -132,8 +130,7 @@ HttpRequestParser::ParseResult HttpRequestParser::ParseHeaders() {
if (http_request_->headers.count("Content-Length") > 0) {
http_request_->has_content = true;
const bool success = base::StringToSizeT(
- http_request_->headers["Content-Length"],
- &declared_content_length_);
+ http_request_->headers["Content-Length"], &declared_content_length_);
DCHECK(success) << "Malformed Content-Length header's value.";
}
if (declared_content_length_ == 0) {
@@ -150,11 +147,10 @@ HttpRequestParser::ParseResult HttpRequestParser::ParseHeaders() {
HttpRequestParser::ParseResult HttpRequestParser::ParseContent() {
const size_t available_bytes = buffer_.size() - buffer_position_;
- const size_t fetch_bytes = std::min(
- available_bytes,
- declared_content_length_ - http_request_->content.size());
- http_request_->content.append(buffer_.data() + buffer_position_,
- fetch_bytes);
+ const size_t fetch_bytes =
+ std::min(available_bytes,
+ declared_content_length_ - http_request_->content.size());
+ http_request_->content.append(buffer_.data() + buffer_position_, fetch_bytes);
buffer_position_ += fetch_bytes;
if (declared_content_length_ == http_request_->content.size()) {

Powered by Google App Engine
This is Rietveld 408576698