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

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

Issue 1898133002: Add reprioritization to socket pools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Attempt to fix windows compile failure. Created 3 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_HANDLE_H_ 5 #ifndef NET_SOCKET_CLIENT_SOCKET_HANDLE_H_
6 #define NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ 6 #define NET_SOCKET_CLIENT_SOCKET_HANDLE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // 84 //
85 template <typename PoolType> 85 template <typename PoolType>
86 int Init(const std::string& group_name, 86 int Init(const std::string& group_name,
87 const scoped_refptr<typename PoolType::SocketParams>& socket_params, 87 const scoped_refptr<typename PoolType::SocketParams>& socket_params,
88 RequestPriority priority, 88 RequestPriority priority,
89 ClientSocketPool::RespectLimits respect_limits, 89 ClientSocketPool::RespectLimits respect_limits,
90 const CompletionCallback& callback, 90 const CompletionCallback& callback,
91 PoolType* pool, 91 PoolType* pool,
92 const NetLogWithSource& net_log); 92 const NetLogWithSource& net_log);
93 93
94 // Changes the priority of the ClientSocketHandle to the passed value.
95 // This function is a no-op if |priority| is the same as the current
96 // priority, of if Init() has not been called since the last time
97 // the ClientSocketHandle was reset.
98 void SetPriority(RequestPriority priority);
99
94 // An initialized handle can be reset, which causes it to return to the 100 // An initialized handle can be reset, which causes it to return to the
95 // un-initialized state. This releases the underlying socket, which in the 101 // un-initialized state. This releases the underlying socket, which in the
96 // case of a socket that still has an established connection, indicates that 102 // case of a socket that still has an established connection, indicates that
97 // the socket may be kept alive for use by a subsequent ClientSocketHandle. 103 // the socket may be kept alive for use by a subsequent ClientSocketHandle.
98 // 104 //
99 // NOTE: To prevent the socket from being kept alive, be sure to call its 105 // NOTE: To prevent the socket from being kept alive, be sure to call its
100 // Disconnect method. This will result in the ClientSocketPool deleting the 106 // Disconnect method. This will result in the ClientSocketPool deleting the
101 // StreamSocket. 107 // StreamSocket.
102 void Reset(); 108 void Reset();
103 109
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 user_callback_ = callback; 260 user_callback_ = callback;
255 } else { 261 } else {
256 HandleInitCompletion(rv); 262 HandleInitCompletion(rv);
257 } 263 }
258 return rv; 264 return rv;
259 } 265 }
260 266
261 } // namespace net 267 } // namespace net
262 268
263 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ 269 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698