| 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 <memory> | 10 #include <memory> |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 // Called from |fallback_timer_|. | 97 // Called from |fallback_timer_|. |
| 98 void StartIPv4JobAsync(); | 98 void StartIPv4JobAsync(); |
| 99 | 99 |
| 100 // Begins the host resolution and the TCP connect. Returns OK on success | 100 // Begins the host resolution and the TCP connect. Returns OK on success |
| 101 // and ERR_IO_PENDING if it cannot immediately service the request. | 101 // and ERR_IO_PENDING if it cannot immediately service the request. |
| 102 // Otherwise, it returns a net error code. | 102 // Otherwise, it returns a net error code. |
| 103 int ConnectInternal() override; | 103 int ConnectInternal() override; |
| 104 | 104 |
| 105 scoped_refptr<TransportSocketParams> params_; | 105 scoped_refptr<TransportSocketParams> params_; |
| 106 SingleRequestHostResolver resolver_; | 106 HostResolver* resolver_; |
| 107 std::unique_ptr<HostResolver::Request> request_; |
| 107 ClientSocketFactory* const client_socket_factory_; | 108 ClientSocketFactory* const client_socket_factory_; |
| 108 | 109 |
| 109 State next_state_; | 110 State next_state_; |
| 110 | 111 |
| 111 AddressList addresses_; | 112 AddressList addresses_; |
| 112 // The addresses are divided into IPv4 and IPv6, which are performed partially | 113 // The addresses are divided into IPv4 and IPv6, which are performed partially |
| 113 // in parallel. If the list of IPv6 addresses is non-empty, then the IPv6 jobs | 114 // in parallel. If the list of IPv6 addresses is non-empty, then the IPv6 jobs |
| 114 // go first, followed after |kIPv6FallbackTimerInMs| by the IPv4 | 115 // go first, followed after |kIPv6FallbackTimerInMs| by the IPv4 |
| 115 // addresses. First sub-job to establish a connection wins. | 116 // addresses. First sub-job to establish a connection wins. |
| 116 std::unique_ptr<WebSocketTransportConnectSubJob> ipv4_job_; | 117 std::unique_ptr<WebSocketTransportConnectSubJob> ipv4_job_; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 bool flushing_; | 252 bool flushing_; |
| 252 | 253 |
| 253 base::WeakPtrFactory<WebSocketTransportClientSocketPool> weak_factory_; | 254 base::WeakPtrFactory<WebSocketTransportClientSocketPool> weak_factory_; |
| 254 | 255 |
| 255 DISALLOW_COPY_AND_ASSIGN(WebSocketTransportClientSocketPool); | 256 DISALLOW_COPY_AND_ASSIGN(WebSocketTransportClientSocketPool); |
| 256 }; | 257 }; |
| 257 | 258 |
| 258 } // namespace net | 259 } // namespace net |
| 259 | 260 |
| 260 #endif // NET_SOCKET_WEBSOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 261 #endif // NET_SOCKET_WEBSOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |