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

Side by Side Diff: net/socket/client_socket_pool.h

Issue 1580903002: Convert ignore_limits from a SocketParam to a socket request argument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 11 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 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_H_ 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_H_
6 #define NET_SOCKET_CLIENT_SOCKET_POOL_H_ 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // StreamSocket was reused, then ClientSocketPool will call 89 // StreamSocket was reused, then ClientSocketPool will call
90 // |handle|->set_reused(true). In either case, the socket will have been 90 // |handle|->set_reused(true). In either case, the socket will have been
91 // allocated and will be connected. A client might want to know whether or 91 // allocated and will be connected. A client might want to know whether or
92 // not the socket is reused in order to request a new socket if it encounters 92 // not the socket is reused in order to request a new socket if it encounters
93 // an error with the reused socket. 93 // an error with the reused socket.
94 // 94 //
95 // If ERR_IO_PENDING is returned, then the callback will be used to notify the 95 // If ERR_IO_PENDING is returned, then the callback will be used to notify the
96 // client of completion. 96 // client of completion.
97 // 97 //
98 // Profiling information for the request is saved to |net_log| if non-NULL. 98 // Profiling information for the request is saved to |net_log| if non-NULL.
99 //
100 // If |ignore_limits| is true, priority must be HIGHEST, and the request will
101 // ignore normal socket pool group limits.
99 virtual int RequestSocket(const std::string& group_name, 102 virtual int RequestSocket(const std::string& group_name,
100 const void* params, 103 const void* params,
101 RequestPriority priority, 104 RequestPriority priority,
105 bool ignore_limits,
102 ClientSocketHandle* handle, 106 ClientSocketHandle* handle,
103 const CompletionCallback& callback, 107 const CompletionCallback& callback,
104 const BoundNetLog& net_log) = 0; 108 const BoundNetLog& net_log) = 0;
105 109
106 // RequestSockets is used to request that |num_sockets| be connected in the 110 // RequestSockets is used to request that |num_sockets| be connected in the
107 // connection group for |group_name|. If the connection group already has 111 // connection group for |group_name|. If the connection group already has
108 // |num_sockets| idle sockets / active sockets / currently connecting sockets, 112 // |num_sockets| idle sockets / active sockets / currently connecting sockets,
109 // then this function doesn't do anything. Otherwise, it will start up as 113 // then this function doesn't do anything. Otherwise, it will start up as
110 // many connections as necessary to reach |num_sockets| total sockets for the 114 // many connections as necessary to reach |num_sockets| total sockets for the
111 // group. It uses |params| to control how to connect the sockets. The 115 // group. It uses |params| to control how to connect the sockets. The
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 const std::string& group_name, 196 const std::string& group_name,
193 const scoped_refptr<typename PoolType::SocketParams>& params, 197 const scoped_refptr<typename PoolType::SocketParams>& params,
194 int num_sockets, 198 int num_sockets,
195 const BoundNetLog& net_log) { 199 const BoundNetLog& net_log) {
196 pool->RequestSockets(group_name, &params, num_sockets, net_log); 200 pool->RequestSockets(group_name, &params, num_sockets, net_log);
197 } 201 }
198 202
199 } // namespace net 203 } // namespace net
200 204
201 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ 205 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698