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

Side by Side Diff: net/test/embedded_test_server/http_request.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_http_utils.cc ('k') | net/tools/quic/spdy_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/test/embedded_test_server/http_request.h" 5 #include "net/test/embedded_test_server/http_request.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return WAITING; 82 return WAITING;
83 83
84 // Parse request's the first header line. 84 // Parse request's the first header line.
85 // Request main main header, eg. GET /foobar.html HTTP/1.1 85 // Request main main header, eg. GET /foobar.html HTTP/1.1
86 { 86 {
87 const std::string header_line = ShiftLine(); 87 const std::string header_line = ShiftLine();
88 std::vector<std::string> header_line_tokens; 88 std::vector<std::string> header_line_tokens;
89 base::SplitString(header_line, ' ', &header_line_tokens); 89 base::SplitString(header_line, ' ', &header_line_tokens);
90 DCHECK_EQ(3u, header_line_tokens.size()); 90 DCHECK_EQ(3u, header_line_tokens.size());
91 // Method. 91 // Method.
92 http_request_->method = GetMethodType(StringToLowerASCII( 92 http_request_->method = GetMethodType(base::StringToLowerASCII(
93 header_line_tokens[0])); 93 header_line_tokens[0]));
94 // Address. 94 // Address.
95 // Don't build an absolute URL as the parser does not know (should not 95 // Don't build an absolute URL as the parser does not know (should not
96 // know) anything about the server address. 96 // know) anything about the server address.
97 http_request_->relative_url = header_line_tokens[1]; 97 http_request_->relative_url = header_line_tokens[1];
98 // Protocol. 98 // Protocol.
99 const std::string protocol = StringToLowerASCII(header_line_tokens[2]); 99 const std::string protocol =
100 base::StringToLowerASCII(header_line_tokens[2]);
100 CHECK(protocol == "http/1.0" || protocol == "http/1.1") << 101 CHECK(protocol == "http/1.0" || protocol == "http/1.1") <<
101 "Protocol not supported: " << protocol; 102 "Protocol not supported: " << protocol;
102 } 103 }
103 104
104 // Parse further headers. 105 // Parse further headers.
105 { 106 {
106 std::string header_name; 107 std::string header_name;
107 while (true) { 108 while (true) {
108 std::string header_line = ShiftLine(); 109 std::string header_line = ShiftLine();
109 if (header_line.empty()) 110 if (header_line.empty())
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return METHOD_DELETE; 194 return METHOD_DELETE;
194 } else if (token == "patch") { 195 } else if (token == "patch") {
195 return METHOD_PATCH; 196 return METHOD_PATCH;
196 } 197 }
197 NOTREACHED() << "Method not implemented: " << token; 198 NOTREACHED() << "Method not implemented: " << token;
198 return METHOD_UNKNOWN; 199 return METHOD_UNKNOWN;
199 } 200 }
200 201
201 } // namespace test_server 202 } // namespace test_server
202 } // namespace net 203 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_http_utils.cc ('k') | net/tools/quic/spdy_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698