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/http/http_proxy_client_socket_pool.h" | 5 #include "net/http/http_proxy_client_socket_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 HttpProxyConnectJob::HttpProxyConnectJob( | 77 HttpProxyConnectJob::HttpProxyConnectJob( |
78 const std::string& group_name, | 78 const std::string& group_name, |
79 RequestPriority priority, | 79 RequestPriority priority, |
80 ClientSocketPool::RespectLimits respect_limits, | 80 ClientSocketPool::RespectLimits respect_limits, |
81 const scoped_refptr<HttpProxySocketParams>& params, | 81 const scoped_refptr<HttpProxySocketParams>& params, |
82 const base::TimeDelta& timeout_duration, | 82 const base::TimeDelta& timeout_duration, |
83 TransportClientSocketPool* transport_pool, | 83 TransportClientSocketPool* transport_pool, |
84 SSLClientSocketPool* ssl_pool, | 84 SSLClientSocketPool* ssl_pool, |
85 Delegate* delegate, | 85 Delegate* delegate, |
86 NetLog* net_log) | 86 NetLog* net_log) |
87 : ConnectJob(group_name, | 87 : ConnectJob( |
88 base::TimeDelta() /* The socket takes care of timeouts */, | 88 group_name, |
89 priority, | 89 base::TimeDelta() /* The socket takes care of timeouts */, |
90 respect_limits, | 90 priority, |
91 delegate, | 91 respect_limits, |
92 BoundNetLog::Make(net_log, NetLogSourceType::CONNECT_JOB)), | 92 delegate, |
| 93 NetLogWithSource::Make(net_log, NetLogSourceType::CONNECT_JOB)), |
93 client_socket_(new HttpProxyClientSocketWrapper( | 94 client_socket_(new HttpProxyClientSocketWrapper( |
94 group_name, | 95 group_name, |
95 priority, | 96 priority, |
96 respect_limits, | 97 respect_limits, |
97 timeout_duration, | 98 timeout_duration, |
98 base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds), | 99 base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds), |
99 transport_pool, | 100 transport_pool, |
100 ssl_pool, | 101 ssl_pool, |
101 params->transport_params(), | 102 params->transport_params(), |
102 params->ssl_params(), | 103 params->ssl_params(), |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 211 |
211 HttpProxyClientSocketPool::~HttpProxyClientSocketPool() { | 212 HttpProxyClientSocketPool::~HttpProxyClientSocketPool() { |
212 } | 213 } |
213 | 214 |
214 int HttpProxyClientSocketPool::RequestSocket(const std::string& group_name, | 215 int HttpProxyClientSocketPool::RequestSocket(const std::string& group_name, |
215 const void* socket_params, | 216 const void* socket_params, |
216 RequestPriority priority, | 217 RequestPriority priority, |
217 RespectLimits respect_limits, | 218 RespectLimits respect_limits, |
218 ClientSocketHandle* handle, | 219 ClientSocketHandle* handle, |
219 const CompletionCallback& callback, | 220 const CompletionCallback& callback, |
220 const BoundNetLog& net_log) { | 221 const NetLogWithSource& net_log) { |
221 const scoped_refptr<HttpProxySocketParams>* casted_socket_params = | 222 const scoped_refptr<HttpProxySocketParams>* casted_socket_params = |
222 static_cast<const scoped_refptr<HttpProxySocketParams>*>(socket_params); | 223 static_cast<const scoped_refptr<HttpProxySocketParams>*>(socket_params); |
223 | 224 |
224 return base_.RequestSocket(group_name, *casted_socket_params, priority, | 225 return base_.RequestSocket(group_name, *casted_socket_params, priority, |
225 respect_limits, handle, callback, net_log); | 226 respect_limits, handle, callback, net_log); |
226 } | 227 } |
227 | 228 |
228 void HttpProxyClientSocketPool::RequestSockets( | 229 void HttpProxyClientSocketPool::RequestSockets( |
229 const std::string& group_name, | 230 const std::string& group_name, |
230 const void* params, | 231 const void* params, |
231 int num_sockets, | 232 int num_sockets, |
232 const BoundNetLog& net_log) { | 233 const NetLogWithSource& net_log) { |
233 const scoped_refptr<HttpProxySocketParams>* casted_params = | 234 const scoped_refptr<HttpProxySocketParams>* casted_params = |
234 static_cast<const scoped_refptr<HttpProxySocketParams>*>(params); | 235 static_cast<const scoped_refptr<HttpProxySocketParams>*>(params); |
235 | 236 |
236 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log); | 237 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log); |
237 } | 238 } |
238 | 239 |
239 void HttpProxyClientSocketPool::CancelRequest( | 240 void HttpProxyClientSocketPool::CancelRequest( |
240 const std::string& group_name, | 241 const std::string& group_name, |
241 ClientSocketHandle* handle) { | 242 ClientSocketHandle* handle) { |
242 base_.CancelRequest(group_name, handle); | 243 base_.CancelRequest(group_name, handle); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 base_.RemoveHigherLayeredPool(higher_pool); | 312 base_.RemoveHigherLayeredPool(higher_pool); |
312 } | 313 } |
313 | 314 |
314 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { | 315 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { |
315 if (base_.CloseOneIdleSocket()) | 316 if (base_.CloseOneIdleSocket()) |
316 return true; | 317 return true; |
317 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 318 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
318 } | 319 } |
319 | 320 |
320 } // namespace net | 321 } // namespace net |
OLD | NEW |