OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_SERVER_HTTP_SERVER_H_ | 5 #ifndef NET_SERVER_HTTP_SERVER_H_ |
6 #define NET_SERVER_HTTP_SERVER_H_ | 6 #define NET_SERVER_HTTP_SERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "net/base/listen_socket.h" | 14 #include "net/base/listen_socket.h" |
15 | 15 |
| 16 namespace net { |
| 17 |
16 class HttpServerRequestInfo; | 18 class HttpServerRequestInfo; |
17 | 19 |
18 class HttpServer : public ListenSocket::ListenSocketDelegate, | 20 class HttpServer : public ListenSocket::ListenSocketDelegate, |
19 public base::RefCountedThreadSafe<HttpServer> { | 21 public base::RefCountedThreadSafe<HttpServer> { |
20 public: | 22 public: |
21 class Delegate { | 23 class Delegate { |
22 public: | 24 public: |
23 virtual void OnHttpRequest(int connection_id, | 25 virtual void OnHttpRequest(int connection_id, |
24 const HttpServerRequestInfo& info) = 0; | 26 const HttpServerRequestInfo& info) = 0; |
25 | 27 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 HttpServer::Delegate* delegate_; | 94 HttpServer::Delegate* delegate_; |
93 scoped_refptr<ListenSocket> server_; | 95 scoped_refptr<ListenSocket> server_; |
94 typedef std::map<int, Connection*> IdToConnectionMap; | 96 typedef std::map<int, Connection*> IdToConnectionMap; |
95 IdToConnectionMap id_to_connection_; | 97 IdToConnectionMap id_to_connection_; |
96 typedef std::map<ListenSocket*, Connection*> SocketToConnectionMap; | 98 typedef std::map<ListenSocket*, Connection*> SocketToConnectionMap; |
97 SocketToConnectionMap socket_to_connection_; | 99 SocketToConnectionMap socket_to_connection_; |
98 | 100 |
99 DISALLOW_COPY_AND_ASSIGN(HttpServer); | 101 DISALLOW_COPY_AND_ASSIGN(HttpServer); |
100 }; | 102 }; |
101 | 103 |
| 104 } // namespace net |
| 105 |
102 #endif // NET_SERVER_HTTP_SERVER_H_ | 106 #endif // NET_SERVER_HTTP_SERVER_H_ |
OLD | NEW |