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

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

Issue 1898133002: Add reprioritization to socket pools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated Matt's comments. Created 4 years, 7 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 <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // group. It uses |params| to control how to connect the sockets. The 116 // group. It uses |params| to control how to connect the sockets. The
117 // ClientSocketPool will assign a priority to the new connections, if any. 117 // ClientSocketPool will assign a priority to the new connections, if any.
118 // This priority will probably be lower than all others, since this method 118 // This priority will probably be lower than all others, since this method
119 // is intended to make sure ahead of time that |num_sockets| sockets are 119 // is intended to make sure ahead of time that |num_sockets| sockets are
120 // available to talk to a host. 120 // available to talk to a host.
121 virtual void RequestSockets(const std::string& group_name, 121 virtual void RequestSockets(const std::string& group_name,
122 const void* params, 122 const void* params,
123 int num_sockets, 123 int num_sockets,
124 const BoundNetLog& net_log) = 0; 124 const BoundNetLog& net_log) = 0;
125 125
126 // Called to change the priority of a RequestSocket call that returned
127 // ERR_IO_PENDING and has not yet asynchronously completed. The same handle
128 // parameter must be passed to this method as was passed to the
129 // RequestSocket call being modified.
130 virtual void SetPriority(const std::string& group_name,
131 ClientSocketHandle* handle,
132 RequestPriority priority) = 0;
133
126 // Called to cancel a RequestSocket call that returned ERR_IO_PENDING. The 134 // Called to cancel a RequestSocket call that returned ERR_IO_PENDING. The
127 // same handle parameter must be passed to this method as was passed to the 135 // same handle parameter must be passed to this method as was passed to the
128 // RequestSocket call being cancelled. The associated CompletionCallback is 136 // RequestSocket call being cancelled. The associated CompletionCallback is
129 // not run. However, for performance, we will let one ConnectJob complete 137 // not run. However, for performance, we will let one ConnectJob complete
130 // and go idle. 138 // and go idle.
131 virtual void CancelRequest(const std::string& group_name, 139 virtual void CancelRequest(const std::string& group_name,
132 ClientSocketHandle* handle) = 0; 140 ClientSocketHandle* handle) = 0;
133 141
134 // Called to release a socket once the socket is no longer needed. If the 142 // Called to release a socket once the socket is no longer needed. If the
135 // socket still has an established connection, then it will be added to the 143 // socket still has an established connection, then it will be added to the
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 const std::string& group_name, 205 const std::string& group_name,
198 const scoped_refptr<typename PoolType::SocketParams>& params, 206 const scoped_refptr<typename PoolType::SocketParams>& params,
199 int num_sockets, 207 int num_sockets,
200 const BoundNetLog& net_log) { 208 const BoundNetLog& net_log) {
201 pool->RequestSockets(group_name, &params, num_sockets, net_log); 209 pool->RequestSockets(group_name, &params, num_sockets, net_log);
202 } 210 }
203 211
204 } // namespace net 212 } // namespace net
205 213
206 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ 214 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698