OLD | NEW |
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // This flushes all state from the ClientSocketPool. This means that all | 146 // This flushes all state from the ClientSocketPool. This means that all |
147 // idle and connecting sockets are discarded with the given |error|. | 147 // idle and connecting sockets are discarded with the given |error|. |
148 // Active sockets being held by ClientSocketPool clients will be discarded | 148 // Active sockets being held by ClientSocketPool clients will be discarded |
149 // when released back to the pool. | 149 // when released back to the pool. |
150 // Does not flush any pools wrapped by |this|. | 150 // Does not flush any pools wrapped by |this|. |
151 virtual void FlushWithError(int error) = 0; | 151 virtual void FlushWithError(int error) = 0; |
152 | 152 |
153 // Called to close any idle connections held by the connection manager. | 153 // Called to close any idle connections held by the connection manager. |
154 virtual void CloseIdleSockets() = 0; | 154 virtual void CloseIdleSockets() = 0; |
155 | 155 |
| 156 // Called to close any idle connections held by the connection manager. |
| 157 virtual void CloseIdleSocketsInGroup(const std::string& group_name) = 0; |
| 158 |
156 // The total number of idle sockets in the pool. | 159 // The total number of idle sockets in the pool. |
157 virtual int IdleSocketCount() const = 0; | 160 virtual int IdleSocketCount() const = 0; |
158 | 161 |
159 // The total number of idle sockets in a connection group. | 162 // The total number of idle sockets in a connection group. |
160 virtual int IdleSocketCountInGroup(const std::string& group_name) const = 0; | 163 virtual int IdleSocketCountInGroup(const std::string& group_name) const = 0; |
161 | 164 |
162 // Determine the LoadState of a connecting ClientSocketHandle. | 165 // Determine the LoadState of a connecting ClientSocketHandle. |
163 virtual LoadState GetLoadState(const std::string& group_name, | 166 virtual LoadState GetLoadState(const std::string& group_name, |
164 const ClientSocketHandle* handle) const = 0; | 167 const ClientSocketHandle* handle) const = 0; |
165 | 168 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 const std::string& group_name, | 201 const std::string& group_name, |
199 const scoped_refptr<typename PoolType::SocketParams>& params, | 202 const scoped_refptr<typename PoolType::SocketParams>& params, |
200 int num_sockets, | 203 int num_sockets, |
201 const NetLogWithSource& net_log) { | 204 const NetLogWithSource& net_log) { |
202 pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); | 205 pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); |
203 } | 206 } |
204 | 207 |
205 } // namespace net | 208 } // namespace net |
206 | 209 |
207 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ | 210 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ |
OLD | NEW |