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

Side by Side Diff: net/spdy/spdy_http_utils.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/hpack_huffman_aggregator.cc ('k') | net/test/embedded_test_server/http_request.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/spdy/spdy_http_utils.h" 5 #include "net/spdy/spdy_http_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 99
100 void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, 100 void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
101 const HttpRequestHeaders& request_headers, 101 const HttpRequestHeaders& request_headers,
102 SpdyMajorVersion protocol_version, 102 SpdyMajorVersion protocol_version,
103 bool direct, 103 bool direct,
104 SpdyHeaderBlock* headers) { 104 SpdyHeaderBlock* headers) {
105 105
106 HttpRequestHeaders::Iterator it(request_headers); 106 HttpRequestHeaders::Iterator it(request_headers);
107 while (it.GetNext()) { 107 while (it.GetNext()) {
108 std::string name = StringToLowerASCII(it.name()); 108 std::string name = base::StringToLowerASCII(it.name());
109 if (name == "connection" || name == "proxy-connection" || 109 if (name == "connection" || name == "proxy-connection" ||
110 name == "transfer-encoding" || name == "host") { 110 name == "transfer-encoding" || name == "host") {
111 continue; 111 continue;
112 } 112 }
113 AddSpdyHeader(name, it.value(), headers); 113 AddSpdyHeader(name, it.value(), headers);
114 } 114 }
115 static const char kHttpProtocolVersion[] = "HTTP/1.1"; 115 static const char kHttpProtocolVersion[] = "HTTP/1.1";
116 116
117 if (protocol_version < SPDY3) { 117 if (protocol_version < SPDY3) {
118 (*headers)["version"] = kHttpProtocolVersion; 118 (*headers)["version"] = kHttpProtocolVersion;
(...skipping 29 matching lines...) Expand all
148 std::string::const_iterator after_version = 148 std::string::const_iterator after_version =
149 std::find(status_line.begin(), status_line.end(), ' '); 149 std::find(status_line.begin(), status_line.end(), ' ');
150 if (protocol_version < SPDY4) { 150 if (protocol_version < SPDY4) {
151 (*headers)[version_key] = std::string(status_line.begin(), after_version); 151 (*headers)[version_key] = std::string(status_line.begin(), after_version);
152 } 152 }
153 (*headers)[status_key] = std::string(after_version + 1, status_line.end()); 153 (*headers)[status_key] = std::string(after_version + 1, status_line.end());
154 154
155 void* iter = NULL; 155 void* iter = NULL;
156 std::string raw_name, value; 156 std::string raw_name, value;
157 while (response_headers.EnumerateHeaderLines(&iter, &raw_name, &value)) { 157 while (response_headers.EnumerateHeaderLines(&iter, &raw_name, &value)) {
158 std::string name = StringToLowerASCII(raw_name); 158 std::string name = base::StringToLowerASCII(raw_name);
159 AddSpdyHeader(name, value, headers); 159 AddSpdyHeader(name, value, headers);
160 } 160 }
161 } 161 }
162 162
163 163
164 COMPILE_ASSERT(HIGHEST - LOWEST < 4 && 164 COMPILE_ASSERT(HIGHEST - LOWEST < 4 &&
165 HIGHEST - MINIMUM_PRIORITY < 5, 165 HIGHEST - MINIMUM_PRIORITY < 5,
166 request_priority_incompatible_with_spdy); 166 request_priority_incompatible_with_spdy);
167 167
168 SpdyPriority ConvertRequestPriorityToSpdyPriority( 168 SpdyPriority ConvertRequestPriorityToSpdyPriority(
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (it != headers.end()) 225 if (it != headers.end())
226 path = it->second; 226 path = it->second;
227 227
228 std::string url = (scheme.empty() || host_port.empty() || path.empty()) 228 std::string url = (scheme.empty() || host_port.empty() || path.empty())
229 ? std::string() 229 ? std::string()
230 : scheme + "://" + host_port + path; 230 : scheme + "://" + host_port + path;
231 return GURL(url); 231 return GURL(url);
232 } 232 }
233 233
234 } // namespace net 234 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack_huffman_aggregator.cc ('k') | net/test/embedded_test_server/http_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698