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

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

Issue 1898133002: Add reprioritization to socket pools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumbed SetPriority down from HttpStreamFactoryImpl::Job. Created 4 years, 8 months 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) 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"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 const std::string& group_name, 225 const std::string& group_name,
226 const void* params, 226 const void* params,
227 int num_sockets, 227 int num_sockets,
228 const BoundNetLog& net_log) { 228 const BoundNetLog& net_log) {
229 const scoped_refptr<SOCKSSocketParams>* casted_params = 229 const scoped_refptr<SOCKSSocketParams>* casted_params =
230 static_cast<const scoped_refptr<SOCKSSocketParams>*>(params); 230 static_cast<const scoped_refptr<SOCKSSocketParams>*>(params);
231 231
232 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log); 232 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log);
233 } 233 }
234 234
235 void SOCKSClientSocketPool::SetPriority(const std::string& group_name,
236 ClientSocketHandle* handle,
237 RequestPriority priority) {
238 base_.SetPriority(group_name, handle, priority);
239 }
240
235 void SOCKSClientSocketPool::CancelRequest(const std::string& group_name, 241 void SOCKSClientSocketPool::CancelRequest(const std::string& group_name,
236 ClientSocketHandle* handle) { 242 ClientSocketHandle* handle) {
237 base_.CancelRequest(group_name, handle); 243 base_.CancelRequest(group_name, handle);
238 } 244 }
239 245
240 void SOCKSClientSocketPool::ReleaseSocket(const std::string& group_name, 246 void SOCKSClientSocketPool::ReleaseSocket(const std::string& group_name,
241 std::unique_ptr<StreamSocket> socket, 247 std::unique_ptr<StreamSocket> socket,
242 int id) { 248 int id) {
243 base_.ReleaseSocket(group_name, std::move(socket), id); 249 base_.ReleaseSocket(group_name, std::move(socket), id);
244 } 250 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 base_.RemoveHigherLayeredPool(higher_pool); 304 base_.RemoveHigherLayeredPool(higher_pool);
299 } 305 }
300 306
301 bool SOCKSClientSocketPool::CloseOneIdleConnection() { 307 bool SOCKSClientSocketPool::CloseOneIdleConnection() {
302 if (base_.CloseOneIdleSocket()) 308 if (base_.CloseOneIdleSocket())
303 return true; 309 return true;
304 return base_.CloseOneIdleConnectionInHigherLayeredPool(); 310 return base_.CloseOneIdleConnectionInHigherLayeredPool();
305 } 311 }
306 312
307 } // namespace net 313 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698