OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SOCKET_WEBSOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_SOCKET_WEBSOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
6 #define NET_SOCKET_WEBSOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 6 #define NET_SOCKET_WEBSOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 int max_sockets_per_group, | 120 int max_sockets_per_group, |
121 ClientSocketPoolHistograms* histograms, | 121 ClientSocketPoolHistograms* histograms, |
122 HostResolver* host_resolver, | 122 HostResolver* host_resolver, |
123 ClientSocketFactory* client_socket_factory, | 123 ClientSocketFactory* client_socket_factory, |
124 NetLog* net_log); | 124 NetLog* net_log); |
125 | 125 |
126 virtual ~WebSocketTransportClientSocketPool(); | 126 virtual ~WebSocketTransportClientSocketPool(); |
127 | 127 |
128 // Allow another connection to be started to the IPEndPoint that this |handle| | 128 // Allow another connection to be started to the IPEndPoint that this |handle| |
129 // is connected to. Used when the WebSocket handshake completes successfully. | 129 // is connected to. Used when the WebSocket handshake completes successfully. |
| 130 // This only works if the socket is connected, however the caller does not |
| 131 // need to explicitly check for this. Instead, ensure that dead sockets are |
| 132 // returned to ReleaseSocket() in a timely fashion. |
130 static void UnlockEndpoint(ClientSocketHandle* handle); | 133 static void UnlockEndpoint(ClientSocketHandle* handle); |
131 | 134 |
132 // ClientSocketPool implementation. | 135 // ClientSocketPool implementation. |
133 virtual int RequestSocket(const std::string& group_name, | 136 virtual int RequestSocket(const std::string& group_name, |
134 const void* resolve_info, | 137 const void* resolve_info, |
135 RequestPriority priority, | 138 RequestPriority priority, |
136 ClientSocketHandle* handle, | 139 ClientSocketHandle* handle, |
137 const CompletionCallback& callback, | 140 const CompletionCallback& callback, |
138 const BoundNetLog& net_log) OVERRIDE; | 141 const BoundNetLog& net_log) OVERRIDE; |
139 virtual void RequestSockets(const std::string& group_name, | 142 virtual void RequestSockets(const std::string& group_name, |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 bool flushing_; | 239 bool flushing_; |
237 | 240 |
238 base::WeakPtrFactory<WebSocketTransportClientSocketPool> weak_factory_; | 241 base::WeakPtrFactory<WebSocketTransportClientSocketPool> weak_factory_; |
239 | 242 |
240 DISALLOW_COPY_AND_ASSIGN(WebSocketTransportClientSocketPool); | 243 DISALLOW_COPY_AND_ASSIGN(WebSocketTransportClientSocketPool); |
241 }; | 244 }; |
242 | 245 |
243 } // namespace net | 246 } // namespace net |
244 | 247 |
245 #endif // NET_SOCKET_WEBSOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 248 #endif // NET_SOCKET_WEBSOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
OLD | NEW |