| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BASE_H_ | 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
| 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ | 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 void ReleaseSocket(const std::string& group_name, | 143 void ReleaseSocket(const std::string& group_name, |
| 144 ClientSocket* socket); | 144 ClientSocket* socket); |
| 145 | 145 |
| 146 void CloseIdleSockets(); | 146 void CloseIdleSockets(); |
| 147 | 147 |
| 148 int idle_socket_count() const { | 148 int idle_socket_count() const { |
| 149 return idle_socket_count_; | 149 return idle_socket_count_; |
| 150 } | 150 } |
| 151 | 151 |
| 152 int max_sockets_per_group() const { |
| 153 return max_sockets_per_group_; |
| 154 } |
| 155 |
| 152 int IdleSocketCountInGroup(const std::string& group_name) const; | 156 int IdleSocketCountInGroup(const std::string& group_name) const; |
| 153 | 157 |
| 154 LoadState GetLoadState(const std::string& group_name, | 158 LoadState GetLoadState(const std::string& group_name, |
| 155 const ClientSocketHandle* handle) const; | 159 const ClientSocketHandle* handle) const; |
| 156 | 160 |
| 157 virtual void OnConnectJobComplete(int result, ConnectJob* job); | 161 virtual void OnConnectJobComplete(int result, ConnectJob* job); |
| 158 | 162 |
| 159 private: | 163 private: |
| 160 // Entry for a persistent socket which became idle at time |start_time|. | 164 // Entry for a persistent socket which became idle at time |start_time|. |
| 161 struct IdleSocket { | 165 struct IdleSocket { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 const int max_sockets_per_group_; | 260 const int max_sockets_per_group_; |
| 257 | 261 |
| 258 const scoped_ptr<ConnectJobFactory> connect_job_factory_; | 262 const scoped_ptr<ConnectJobFactory> connect_job_factory_; |
| 259 | 263 |
| 260 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); | 264 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); |
| 261 }; | 265 }; |
| 262 | 266 |
| 263 } // namespace net | 267 } // namespace net |
| 264 | 268 |
| 265 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ | 269 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
| OLD | NEW |