OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "net/base/network_change_notifier.h" | 44 #include "net/base/network_change_notifier.h" |
45 #include "net/base/request_priority.h" | 45 #include "net/base/request_priority.h" |
46 #include "net/socket/client_socket_pool.h" | 46 #include "net/socket/client_socket_pool.h" |
47 #include "net/socket/stream_socket.h" | 47 #include "net/socket/stream_socket.h" |
48 | 48 |
49 namespace net { | 49 namespace net { |
50 | 50 |
51 class ClientSocketHandle; | 51 class ClientSocketHandle; |
52 | 52 |
53 // Returns the client socket reuse policy. | 53 // Returns the client socket reuse policy. |
54 int GetSocketReusePolicy(); | 54 NET_TEST int GetSocketReusePolicy(); |
55 | 55 |
56 // Sets the client socket reuse policy. | 56 // Sets the client socket reuse policy. |
57 // NOTE: 'policy' should be a valid ClientSocketReusePolicy enum value. | 57 // NOTE: 'policy' should be a valid ClientSocketReusePolicy enum value. |
58 NET_API void SetSocketReusePolicy(int policy); | 58 NET_API void SetSocketReusePolicy(int policy); |
59 | 59 |
60 // ConnectJob provides an abstract interface for "connecting" a socket. | 60 // ConnectJob provides an abstract interface for "connecting" a socket. |
61 // The connection may involve host resolution, tcp connection, ssl connection, | 61 // The connection may involve host resolution, tcp connection, ssl connection, |
62 // etc. | 62 // etc. |
63 class NET_TEST ConnectJob { | 63 class NET_TEST ConnectJob { |
64 public: | 64 public: |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 // Histograms for the pool | 764 // Histograms for the pool |
765 ClientSocketPoolHistograms* const histograms_; | 765 ClientSocketPoolHistograms* const histograms_; |
766 internal::ClientSocketPoolBaseHelper helper_; | 766 internal::ClientSocketPoolBaseHelper helper_; |
767 | 767 |
768 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); | 768 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); |
769 }; | 769 }; |
770 | 770 |
771 } // namespace net | 771 } // namespace net |
772 | 772 |
773 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ | 773 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ |
OLD | NEW |