| 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 #include "net/socket/socks_client_socket_pool.h" | 5 #include "net/socket/socks_client_socket_pool.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
| 14 #include "net/log/net_log_source_type.h" |
| 14 #include "net/socket/client_socket_factory.h" | 15 #include "net/socket/client_socket_factory.h" |
| 15 #include "net/socket/client_socket_handle.h" | 16 #include "net/socket/client_socket_handle.h" |
| 16 #include "net/socket/client_socket_pool_base.h" | 17 #include "net/socket/client_socket_pool_base.h" |
| 17 #include "net/socket/socks5_client_socket.h" | 18 #include "net/socket/socks5_client_socket.h" |
| 18 #include "net/socket/socks_client_socket.h" | 19 #include "net/socket/socks_client_socket.h" |
| 19 #include "net/socket/transport_client_socket_pool.h" | 20 #include "net/socket/transport_client_socket_pool.h" |
| 20 | 21 |
| 21 namespace net { | 22 namespace net { |
| 22 | 23 |
| 23 SOCKSSocketParams::SOCKSSocketParams( | 24 SOCKSSocketParams::SOCKSSocketParams( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 43 const base::TimeDelta& timeout_duration, | 44 const base::TimeDelta& timeout_duration, |
| 44 TransportClientSocketPool* transport_pool, | 45 TransportClientSocketPool* transport_pool, |
| 45 HostResolver* host_resolver, | 46 HostResolver* host_resolver, |
| 46 Delegate* delegate, | 47 Delegate* delegate, |
| 47 NetLog* net_log) | 48 NetLog* net_log) |
| 48 : ConnectJob(group_name, | 49 : ConnectJob(group_name, |
| 49 timeout_duration, | 50 timeout_duration, |
| 50 priority, | 51 priority, |
| 51 respect_limits, | 52 respect_limits, |
| 52 delegate, | 53 delegate, |
| 53 BoundNetLog::Make(net_log, NetLog::SOURCE_CONNECT_JOB)), | 54 BoundNetLog::Make(net_log, NetLogSourceType::CONNECT_JOB)), |
| 54 socks_params_(socks_params), | 55 socks_params_(socks_params), |
| 55 transport_pool_(transport_pool), | 56 transport_pool_(transport_pool), |
| 56 resolver_(host_resolver), | 57 resolver_(host_resolver), |
| 57 callback_( | 58 callback_( |
| 58 base::Bind(&SOCKSConnectJob::OnIOComplete, base::Unretained(this))) {} | 59 base::Bind(&SOCKSConnectJob::OnIOComplete, base::Unretained(this))) {} |
| 59 | 60 |
| 60 SOCKSConnectJob::~SOCKSConnectJob() { | 61 SOCKSConnectJob::~SOCKSConnectJob() { |
| 61 // We don't worry about cancelling the tcp socket since the destructor in | 62 // We don't worry about cancelling the tcp socket since the destructor in |
| 62 // std::unique_ptr<ClientSocketHandle> transport_socket_handle_ will take care | 63 // std::unique_ptr<ClientSocketHandle> transport_socket_handle_ will take care |
| 63 // of | 64 // of |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 base_.RemoveHigherLayeredPool(higher_pool); | 299 base_.RemoveHigherLayeredPool(higher_pool); |
| 299 } | 300 } |
| 300 | 301 |
| 301 bool SOCKSClientSocketPool::CloseOneIdleConnection() { | 302 bool SOCKSClientSocketPool::CloseOneIdleConnection() { |
| 302 if (base_.CloseOneIdleSocket()) | 303 if (base_.CloseOneIdleSocket()) |
| 303 return true; | 304 return true; |
| 304 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 305 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
| 305 } | 306 } |
| 306 | 307 |
| 307 } // namespace net | 308 } // namespace net |
| OLD | NEW |