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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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/quic/quic_packet_generator_test.cc ('k') | net/server/http_server_request_info.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/string_util.h" 10 #include "base/string_util.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 connection->Send(status_code, data, content_type); 55 connection->Send(status_code, data, content_type);
56 } 56 }
57 57
58 void HttpServer::Send200(int connection_id, 58 void HttpServer::Send200(int connection_id,
59 const std::string& data, 59 const std::string& data,
60 const std::string& content_type) { 60 const std::string& content_type) {
61 Send(connection_id, HTTP_OK, data, content_type); 61 Send(connection_id, HTTP_OK, data, content_type);
62 } 62 }
63 63
64 void HttpServer::Send404(int connection_id) { 64 void HttpServer::Send404(int connection_id) {
65 Send(connection_id, HTTP_NOT_FOUND, "", "text/html"); 65 Send(connection_id, HTTP_NOT_FOUND, std::string(), "text/html");
66 } 66 }
67 67
68 void HttpServer::Send500(int connection_id, const std::string& message) { 68 void HttpServer::Send500(int connection_id, const std::string& message) {
69 Send(connection_id, HTTP_INTERNAL_SERVER_ERROR, message, "text/html"); 69 Send(connection_id, HTTP_INTERNAL_SERVER_ERROR, message, "text/html");
70 } 70 }
71 71
72 void HttpServer::Close(int connection_id) { 72 void HttpServer::Close(int connection_id) {
73 HttpConnection* connection = FindConnection(connection_id); 73 HttpConnection* connection = FindConnection(connection_id);
74 if (connection == NULL) 74 if (connection == NULL)
75 return; 75 return;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 292
293 HttpConnection* HttpServer::FindConnection(StreamListenSocket* socket) { 293 HttpConnection* HttpServer::FindConnection(StreamListenSocket* socket) {
294 SocketToConnectionMap::iterator it = socket_to_connection_.find(socket); 294 SocketToConnectionMap::iterator it = socket_to_connection_.find(socket);
295 if (it == socket_to_connection_.end()) 295 if (it == socket_to_connection_.end())
296 return NULL; 296 return NULL;
297 return it->second; 297 return it->second;
298 } 298 }
299 299
300 } // namespace net 300 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_packet_generator_test.cc ('k') | net/server/http_server_request_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698