OLD | NEW |
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" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "base/sys_byteorder.h" | 12 #include "base/sys_byteorder.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "net/base/tcp_listen_socket.h" | |
15 #include "net/server/http_connection.h" | 14 #include "net/server/http_connection.h" |
16 #include "net/server/http_server_request_info.h" | 15 #include "net/server/http_server_request_info.h" |
17 #include "net/server/web_socket.h" | 16 #include "net/server/web_socket.h" |
| 17 #include "net/socket/tcp_listen_socket.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 HttpServer::HttpServer(const StreamListenSocketFactory& factory, | 21 HttpServer::HttpServer(const StreamListenSocketFactory& factory, |
22 HttpServer::Delegate* delegate) | 22 HttpServer::Delegate* delegate) |
23 : delegate_(delegate), | 23 : delegate_(delegate), |
24 ALLOW_THIS_IN_INITIALIZER_LIST(server_(factory.CreateAndListen(this))) { | 24 ALLOW_THIS_IN_INITIALIZER_LIST(server_(factory.CreateAndListen(this))) { |
25 DCHECK(server_); | 25 DCHECK(server_); |
26 } | 26 } |
27 | 27 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |