| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // A ClientSocketPoolBase is used to restrict the number of sockets open at | 5 // A ClientSocketPoolBase is used to restrict the number of sockets open at |
| 6 // a time. It also maintains a list of idle persistent sockets for reuse. | 6 // a time. It also maintains a list of idle persistent sockets for reuse. |
| 7 // Subclasses of ClientSocketPool should compose ClientSocketPoolBase to handle | 7 // Subclasses of ClientSocketPool should compose ClientSocketPoolBase to handle |
| 8 // the core logic of (1) restricting the number of active (connected or | 8 // the core logic of (1) restricting the number of active (connected or |
| 9 // connecting) sockets per "group" (generally speaking, the hostname), (2) | 9 // connecting) sockets per "group" (generally speaking, the hostname), (2) |
| 10 // maintaining a per-group list of idle, persistent sockets for reuse, and (3) | 10 // maintaining a per-group list of idle, persistent sockets for reuse, and (3) |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 401 |
| 402 // The total number of idle sockets in the system. | 402 // The total number of idle sockets in the system. |
| 403 int idle_socket_count_; | 403 int idle_socket_count_; |
| 404 | 404 |
| 405 // Number of connecting sockets across all groups. | 405 // Number of connecting sockets across all groups. |
| 406 int connecting_socket_count_; | 406 int connecting_socket_count_; |
| 407 | 407 |
| 408 // Number of connected sockets we handed out across all groups. | 408 // Number of connected sockets we handed out across all groups. |
| 409 int handed_out_socket_count_; | 409 int handed_out_socket_count_; |
| 410 | 410 |
| 411 // Number of sockets being released. |
| 412 int num_releasing_sockets_; |
| 413 |
| 411 // The maximum total number of sockets. See ReachedMaxSocketsLimit. | 414 // The maximum total number of sockets. See ReachedMaxSocketsLimit. |
| 412 const int max_sockets_; | 415 const int max_sockets_; |
| 413 | 416 |
| 414 // The maximum number of sockets kept per group. | 417 // The maximum number of sockets kept per group. |
| 415 const int max_sockets_per_group_; | 418 const int max_sockets_per_group_; |
| 416 | 419 |
| 417 // The time to wait until closing idle sockets. | 420 // The time to wait until closing idle sockets. |
| 418 const base::TimeDelta unused_idle_socket_timeout_; | 421 const base::TimeDelta unused_idle_socket_timeout_; |
| 419 const base::TimeDelta used_idle_socket_timeout_; | 422 const base::TimeDelta used_idle_socket_timeout_; |
| 420 | 423 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 // the posting of the task and the execution, then we'll hit the DCHECK that | 623 // the posting of the task and the execution, then we'll hit the DCHECK that |
| 621 // |ClientSocketPoolBaseHelper::group_map_| is empty. | 624 // |ClientSocketPoolBaseHelper::group_map_| is empty. |
| 622 scoped_refptr<internal::ClientSocketPoolBaseHelper> helper_; | 625 scoped_refptr<internal::ClientSocketPoolBaseHelper> helper_; |
| 623 | 626 |
| 624 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); | 627 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); |
| 625 }; | 628 }; |
| 626 | 629 |
| 627 } // namespace net | 630 } // namespace net |
| 628 | 631 |
| 629 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ | 632 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
| OLD | NEW |