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

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

Issue 8990001: base::Bind: Convert most of net/http. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang. Created 9 years 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 | Annotate | Revision Log
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/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (transport_pool_) 203 if (transport_pool_)
204 transport_pool_->AddLayeredPool(this); 204 transport_pool_->AddLayeredPool(this);
205 } 205 }
206 206
207 SOCKSClientSocketPool::~SOCKSClientSocketPool() { 207 SOCKSClientSocketPool::~SOCKSClientSocketPool() {
208 // We should always have a |transport_pool_| except in unit tests. 208 // We should always have a |transport_pool_| except in unit tests.
209 if (transport_pool_) 209 if (transport_pool_)
210 transport_pool_->RemoveLayeredPool(this); 210 transport_pool_->RemoveLayeredPool(this);
211 } 211 }
212 212
213 int SOCKSClientSocketPool::RequestSocket(const std::string& group_name, 213 int SOCKSClientSocketPool::RequestSocket(
214 const void* socket_params, 214 const std::string& group_name, const void* socket_params,
215 RequestPriority priority, 215 RequestPriority priority, ClientSocketHandle* handle,
216 ClientSocketHandle* handle, 216 const CompletionCallback& callback, const BoundNetLog& net_log) {
217 OldCompletionCallback* callback,
218 const BoundNetLog& net_log) {
219 const scoped_refptr<SOCKSSocketParams>* casted_socket_params = 217 const scoped_refptr<SOCKSSocketParams>* casted_socket_params =
220 static_cast<const scoped_refptr<SOCKSSocketParams>*>(socket_params); 218 static_cast<const scoped_refptr<SOCKSSocketParams>*>(socket_params);
221 219
222 return base_.RequestSocket(group_name, *casted_socket_params, priority, 220 return base_.RequestSocket(group_name, *casted_socket_params, priority,
223 handle, callback, net_log); 221 handle, callback, net_log);
224 } 222 }
225 223
226 void SOCKSClientSocketPool::RequestSockets( 224 void SOCKSClientSocketPool::RequestSockets(
227 const std::string& group_name, 225 const std::string& group_name,
228 const void* params, 226 const void* params,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return base_.histograms(); 299 return base_.histograms();
302 }; 300 };
303 301
304 bool SOCKSClientSocketPool::CloseOneIdleConnection() { 302 bool SOCKSClientSocketPool::CloseOneIdleConnection() {
305 if (base_.CloseOneIdleSocket()) 303 if (base_.CloseOneIdleSocket())
306 return true; 304 return true;
307 return base_.CloseOneIdleConnectionInLayeredPool(); 305 return base_.CloseOneIdleConnectionInLayeredPool();
308 } 306 }
309 307
310 } // namespace net 308 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698