Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: net/socket/socks_client_socket_pool.cc

Issue 8526006: Close idle sockets next time we are about to send data. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: code conventions Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/values.h" 8 #include "base/values.h"
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 return transport_pool_->ConnectionTimeout() + 189 return transport_pool_->ConnectionTimeout() +
190 base::TimeDelta::FromSeconds(kSOCKSConnectJobTimeoutInSeconds); 190 base::TimeDelta::FromSeconds(kSOCKSConnectJobTimeoutInSeconds);
191 } 191 }
192 192
193 SOCKSClientSocketPool::SOCKSClientSocketPool( 193 SOCKSClientSocketPool::SOCKSClientSocketPool(
194 int max_sockets, 194 int max_sockets,
195 int max_sockets_per_group, 195 int max_sockets_per_group,
196 ClientSocketPoolHistograms* histograms, 196 ClientSocketPoolHistograms* histograms,
197 HostResolver* host_resolver, 197 HostResolver* host_resolver,
198 TransportClientSocketPool* transport_pool, 198 TransportClientSocketPool* transport_pool,
199 NetLog* net_log) 199 NetLog* net_log,
200 const ClientSocketPoolOptions& options)
200 : transport_pool_(transport_pool), 201 : transport_pool_(transport_pool),
201 base_(max_sockets, max_sockets_per_group, histograms, 202 base_(max_sockets, max_sockets_per_group, histograms,
202 ClientSocketPool::unused_idle_socket_timeout(), 203 ClientSocketPool::unused_idle_socket_timeout(),
203 ClientSocketPool::used_idle_socket_timeout(), 204 ClientSocketPool::used_idle_socket_timeout(),
204 new SOCKSConnectJobFactory(transport_pool, 205 new SOCKSConnectJobFactory(transport_pool,
205 host_resolver, 206 host_resolver,
206 net_log)) { 207 net_log),
208 options) {
207 } 209 }
208 210
209 SOCKSClientSocketPool::~SOCKSClientSocketPool() {} 211 SOCKSClientSocketPool::~SOCKSClientSocketPool() {}
210 212
211 int SOCKSClientSocketPool::RequestSocket(const std::string& group_name, 213 int SOCKSClientSocketPool::RequestSocket(const std::string& group_name,
212 const void* socket_params, 214 const void* socket_params,
213 RequestPriority priority, 215 RequestPriority priority,
214 ClientSocketHandle* handle, 216 ClientSocketHandle* handle,
215 OldCompletionCallback* callback, 217 OldCompletionCallback* callback,
216 const BoundNetLog& net_log) { 218 const BoundNetLog& net_log) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 283
282 base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const { 284 base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const {
283 return base_.ConnectionTimeout(); 285 return base_.ConnectionTimeout();
284 } 286 }
285 287
286 ClientSocketPoolHistograms* SOCKSClientSocketPool::histograms() const { 288 ClientSocketPoolHistograms* SOCKSClientSocketPool::histograms() const {
287 return base_.histograms(); 289 return base_.histograms();
288 }; 290 };
289 291
290 } // namespace net 292 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698