| 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> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 void Send500(int connection_id, const std::string& message); | 51 void Send500(int connection_id, const std::string& message); |
| 52 void Close(int connection_id); | 52 void Close(int connection_id); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 friend class base::RefCountedThreadSafe<HttpServer>; | 55 friend class base::RefCountedThreadSafe<HttpServer>; |
| 56 class Connection { | 56 class Connection { |
| 57 private: | 57 private: |
| 58 static int lastId_; | 58 static int lastId_; |
| 59 friend class HttpServer; | 59 friend class HttpServer; |
| 60 | 60 |
| 61 explicit Connection(HttpServer* server, ListenSocket* sock); | 61 Connection(HttpServer* server, ListenSocket* sock); |
| 62 ~Connection(); | 62 ~Connection(); |
| 63 | 63 |
| 64 void DetachSocket(); | 64 void DetachSocket(); |
| 65 | 65 |
| 66 void Shift(int num_bytes); | 66 void Shift(int num_bytes); |
| 67 | 67 |
| 68 HttpServer* server_; | 68 HttpServer* server_; |
| 69 scoped_refptr<ListenSocket> socket_; | 69 scoped_refptr<ListenSocket> socket_; |
| 70 bool is_web_socket_; | 70 bool is_web_socket_; |
| 71 std::string recv_data_; | 71 std::string recv_data_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 97 IdToConnectionMap id_to_connection_; | 97 IdToConnectionMap id_to_connection_; |
| 98 typedef std::map<ListenSocket*, Connection*> SocketToConnectionMap; | 98 typedef std::map<ListenSocket*, Connection*> SocketToConnectionMap; |
| 99 SocketToConnectionMap socket_to_connection_; | 99 SocketToConnectionMap socket_to_connection_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(HttpServer); | 101 DISALLOW_COPY_AND_ASSIGN(HttpServer); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace net | 104 } // namespace net |
| 105 | 105 |
| 106 #endif // NET_SERVER_HTTP_SERVER_H_ | 106 #endif // NET_SERVER_HTTP_SERVER_H_ |
| OLD | NEW |