OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/time.h" | 7 #include "base/time.h" |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/socket/client_socket_factory.h" | 10 #include "net/socket/client_socket_factory.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 SOCKSClientSocketPool::SOCKSConnectJobFactory::ConnectionTimeout() const { | 154 SOCKSClientSocketPool::SOCKSConnectJobFactory::ConnectionTimeout() const { |
155 return tcp_pool_->ConnectionTimeout() + | 155 return tcp_pool_->ConnectionTimeout() + |
156 base::TimeDelta::FromSeconds(kSOCKSConnectJobTimeoutInSeconds); | 156 base::TimeDelta::FromSeconds(kSOCKSConnectJobTimeoutInSeconds); |
157 } | 157 } |
158 | 158 |
159 SOCKSClientSocketPool::SOCKSClientSocketPool( | 159 SOCKSClientSocketPool::SOCKSClientSocketPool( |
160 int max_sockets, | 160 int max_sockets, |
161 int max_sockets_per_group, | 161 int max_sockets_per_group, |
162 const std::string& name, | 162 const std::string& name, |
163 const scoped_refptr<HostResolver>& host_resolver, | 163 const scoped_refptr<HostResolver>& host_resolver, |
164 const scoped_refptr<TCPClientSocketPool>& tcp_pool, | 164 const scoped_refptr<TCPClientSocketPool>& tcp_pool) |
165 NetworkChangeNotifier* network_change_notifier) | |
166 : base_(max_sockets, max_sockets_per_group, name, | 165 : base_(max_sockets, max_sockets_per_group, name, |
167 base::TimeDelta::FromSeconds(kUnusedIdleSocketTimeout), | 166 base::TimeDelta::FromSeconds(kUnusedIdleSocketTimeout), |
168 base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout), | 167 base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout), |
169 new SOCKSConnectJobFactory(tcp_pool, host_resolver), | 168 new SOCKSConnectJobFactory(tcp_pool, host_resolver)) {} |
170 network_change_notifier) {} | |
171 | 169 |
172 SOCKSClientSocketPool::~SOCKSClientSocketPool() {} | 170 SOCKSClientSocketPool::~SOCKSClientSocketPool() {} |
173 | 171 |
174 int SOCKSClientSocketPool::RequestSocket( | 172 int SOCKSClientSocketPool::RequestSocket( |
175 const std::string& group_name, | 173 const std::string& group_name, |
176 const void* socket_params, | 174 const void* socket_params, |
177 RequestPriority priority, | 175 RequestPriority priority, |
178 ClientSocketHandle* handle, | 176 ClientSocketHandle* handle, |
179 CompletionCallback* callback, | 177 CompletionCallback* callback, |
180 const BoundNetLog& net_log) { | 178 const BoundNetLog& net_log) { |
(...skipping 24 matching lines...) Expand all Loading... |
205 const std::string& group_name) const { | 203 const std::string& group_name) const { |
206 return base_.IdleSocketCountInGroup(group_name); | 204 return base_.IdleSocketCountInGroup(group_name); |
207 } | 205 } |
208 | 206 |
209 LoadState SOCKSClientSocketPool::GetLoadState( | 207 LoadState SOCKSClientSocketPool::GetLoadState( |
210 const std::string& group_name, const ClientSocketHandle* handle) const { | 208 const std::string& group_name, const ClientSocketHandle* handle) const { |
211 return base_.GetLoadState(group_name, handle); | 209 return base_.GetLoadState(group_name, handle); |
212 } | 210 } |
213 | 211 |
214 } // namespace net | 212 } // namespace net |
OLD | NEW |