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 #ifndef NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
6 #define NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 6 #define NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 const scoped_refptr<TransportSocketParams>& params, | 162 const scoped_refptr<TransportSocketParams>& params, |
163 base::TimeDelta timeout_duration, | 163 base::TimeDelta timeout_duration, |
164 ClientSocketFactory* client_socket_factory, | 164 ClientSocketFactory* client_socket_factory, |
165 HostResolver* host_resolver, | 165 HostResolver* host_resolver, |
166 Delegate* delegate, | 166 Delegate* delegate, |
167 NetLog* net_log); | 167 NetLog* net_log); |
168 ~TransportConnectJob() override; | 168 ~TransportConnectJob() override; |
169 | 169 |
170 // ConnectJob methods. | 170 // ConnectJob methods. |
171 LoadState GetLoadState() const override; | 171 LoadState GetLoadState() const override; |
| 172 void GetAdditionalErrorState(ClientSocketHandle* handle) override; |
172 | 173 |
173 // Rolls |addrlist| forward until the first IPv4 address, if any. | 174 // Rolls |addrlist| forward until the first IPv4 address, if any. |
174 // WARNING: this method should only be used to implement the prefer-IPv4 hack. | 175 // WARNING: this method should only be used to implement the prefer-IPv4 hack. |
175 static void MakeAddressListStartWithIPv4(AddressList* addrlist); | 176 static void MakeAddressListStartWithIPv4(AddressList* addrlist); |
176 | 177 |
177 private: | 178 private: |
178 enum ConnectInterval { | 179 enum ConnectInterval { |
179 CONNECT_INTERVAL_LE_10MS, | 180 CONNECT_INTERVAL_LE_10MS, |
180 CONNECT_INTERVAL_LE_20MS, | 181 CONNECT_INTERVAL_LE_20MS, |
181 CONNECT_INTERVAL_GT_20MS, | 182 CONNECT_INTERVAL_GT_20MS, |
(...skipping 20 matching lines...) Expand all Loading... |
202 scoped_ptr<StreamSocket> transport_socket_; | 203 scoped_ptr<StreamSocket> transport_socket_; |
203 | 204 |
204 scoped_ptr<StreamSocket> fallback_transport_socket_; | 205 scoped_ptr<StreamSocket> fallback_transport_socket_; |
205 scoped_ptr<AddressList> fallback_addresses_; | 206 scoped_ptr<AddressList> fallback_addresses_; |
206 base::TimeTicks fallback_connect_start_time_; | 207 base::TimeTicks fallback_connect_start_time_; |
207 base::OneShotTimer<TransportConnectJob> fallback_timer_; | 208 base::OneShotTimer<TransportConnectJob> fallback_timer_; |
208 | 209 |
209 // Track the interval between this connect and previous connect. | 210 // Track the interval between this connect and previous connect. |
210 ConnectInterval interval_between_connects_; | 211 ConnectInterval interval_between_connects_; |
211 | 212 |
| 213 int connect_result_; |
| 214 |
212 DISALLOW_COPY_AND_ASSIGN(TransportConnectJob); | 215 DISALLOW_COPY_AND_ASSIGN(TransportConnectJob); |
213 }; | 216 }; |
214 | 217 |
215 class NET_EXPORT_PRIVATE TransportClientSocketPool : public ClientSocketPool { | 218 class NET_EXPORT_PRIVATE TransportClientSocketPool : public ClientSocketPool { |
216 public: | 219 public: |
217 typedef TransportSocketParams SocketParams; | 220 typedef TransportSocketParams SocketParams; |
218 | 221 |
219 TransportClientSocketPool( | 222 TransportClientSocketPool( |
220 int max_sockets, | 223 int max_sockets, |
221 int max_sockets_per_group, | 224 int max_sockets_per_group, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 break; | 368 break; |
366 } | 369 } |
367 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); | 370 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); |
368 | 371 |
369 return rv; | 372 return rv; |
370 } | 373 } |
371 | 374 |
372 } // namespace net | 375 } // namespace net |
373 | 376 |
374 #endif // NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ | 377 #endif // NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ |
OLD | NEW |