| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // This flushes all state from the ClientSocketPool. This means that all | 156 // This flushes all state from the ClientSocketPool. This means that all |
| 157 // idle and connecting sockets are discarded with the given |error|. | 157 // idle and connecting sockets are discarded with the given |error|. |
| 158 // Active sockets being held by ClientSocketPool clients will be discarded | 158 // Active sockets being held by ClientSocketPool clients will be discarded |
| 159 // when released back to the pool. | 159 // when released back to the pool. |
| 160 // Does not flush any pools wrapped by |this|. | 160 // Does not flush any pools wrapped by |this|. |
| 161 virtual void FlushWithError(int error) = 0; | 161 virtual void FlushWithError(int error) = 0; |
| 162 | 162 |
| 163 // Called to close any idle connections held by the connection manager. | 163 // Called to close any idle connections held by the connection manager. |
| 164 virtual void CloseIdleSockets() = 0; | 164 virtual void CloseIdleSockets() = 0; |
| 165 | 165 |
| 166 // Called to close any idle connections held by the connection manager. |
| 167 virtual void CloseIdleSocketsInGroup(const std::string& group_name) = 0; |
| 168 |
| 166 // The total number of idle sockets in the pool. | 169 // The total number of idle sockets in the pool. |
| 167 virtual int IdleSocketCount() const = 0; | 170 virtual int IdleSocketCount() const = 0; |
| 168 | 171 |
| 169 // The total number of idle sockets in a connection group. | 172 // The total number of idle sockets in a connection group. |
| 170 virtual int IdleSocketCountInGroup(const std::string& group_name) const = 0; | 173 virtual int IdleSocketCountInGroup(const std::string& group_name) const = 0; |
| 171 | 174 |
| 172 // Determine the LoadState of a connecting ClientSocketHandle. | 175 // Determine the LoadState of a connecting ClientSocketHandle. |
| 173 virtual LoadState GetLoadState(const std::string& group_name, | 176 virtual LoadState GetLoadState(const std::string& group_name, |
| 174 const ClientSocketHandle* handle) const = 0; | 177 const ClientSocketHandle* handle) const = 0; |
| 175 | 178 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 const std::string& group_name, | 211 const std::string& group_name, |
| 209 const scoped_refptr<typename PoolType::SocketParams>& params, | 212 const scoped_refptr<typename PoolType::SocketParams>& params, |
| 210 int num_sockets, | 213 int num_sockets, |
| 211 const NetLogWithSource& net_log) { | 214 const NetLogWithSource& net_log) { |
| 212 pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); | 215 pool->RequestSockets(group_name, ¶ms, num_sockets, net_log); |
| 213 } | 216 } |
| 214 | 217 |
| 215 } // namespace net | 218 } // namespace net |
| 216 | 219 |
| 217 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ | 220 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |