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

Side by Side Diff: net/server/http_server.cc

Issue 183853011: Move TrimWhitespace to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/proxy/proxy_config_service_linux.cc ('k') | net/test/python_utils_unittest.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/server/http_server.h" 5 #include "net/server/http_server.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 case ST_PROTO: 274 case ST_PROTO:
275 // TODO(mbelshe): Deal better with parsing protocol. 275 // TODO(mbelshe): Deal better with parsing protocol.
276 DCHECK(buffer == "HTTP/1.1"); 276 DCHECK(buffer == "HTTP/1.1");
277 buffer.clear(); 277 buffer.clear();
278 break; 278 break;
279 case ST_NAME: 279 case ST_NAME:
280 header_name = StringToLowerASCII(buffer); 280 header_name = StringToLowerASCII(buffer);
281 buffer.clear(); 281 buffer.clear();
282 break; 282 break;
283 case ST_VALUE: 283 case ST_VALUE:
284 TrimWhitespaceASCII(buffer, TRIM_LEADING, &header_value); 284 base::TrimWhitespaceASCII(buffer, base::TRIM_LEADING, &header_value);
285 // TODO(mbelshe): Deal better with duplicate headers 285 // TODO(mbelshe): Deal better with duplicate headers
286 DCHECK(info->headers.find(header_name) == info->headers.end()); 286 DCHECK(info->headers.find(header_name) == info->headers.end());
287 info->headers[header_name] = header_value; 287 info->headers[header_name] = header_value;
288 buffer.clear(); 288 buffer.clear();
289 break; 289 break;
290 case ST_SEPARATOR: 290 case ST_SEPARATOR:
291 break; 291 break;
292 } 292 }
293 state = next_state; 293 state = next_state;
294 } else { 294 } else {
(...skipping 26 matching lines...) Expand all
321 } 321 }
322 322
323 HttpConnection* HttpServer::FindConnection(StreamListenSocket* socket) { 323 HttpConnection* HttpServer::FindConnection(StreamListenSocket* socket) {
324 SocketToConnectionMap::iterator it = socket_to_connection_.find(socket); 324 SocketToConnectionMap::iterator it = socket_to_connection_.find(socket);
325 if (it == socket_to_connection_.end()) 325 if (it == socket_to_connection_.end())
326 return NULL; 326 return NULL;
327 return it->second; 327 return it->second;
328 } 328 }
329 329
330 } // namespace net 330 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_config_service_linux.cc ('k') | net/test/python_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698