| 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 #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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 static const int kMaxConnectRetryIntervalMs = 250; | 117 static const int kMaxConnectRetryIntervalMs = 250; |
| 118 | 118 |
| 119 // The set of histograms specific to this pool. We can't use the standard | 119 // The set of histograms specific to this pool. We can't use the standard |
| 120 // UMA_HISTOGRAM_* macros because they are callsite static. | 120 // UMA_HISTOGRAM_* macros because they are callsite static. |
| 121 virtual scoped_refptr<ClientSocketPoolHistograms> histograms() const = 0; | 121 virtual scoped_refptr<ClientSocketPoolHistograms> histograms() const = 0; |
| 122 | 122 |
| 123 static int unused_idle_socket_timeout(); | 123 static int unused_idle_socket_timeout(); |
| 124 static void set_unused_idle_socket_timeout(int timeout); | 124 static void set_unused_idle_socket_timeout(int timeout); |
| 125 | 125 |
| 126 protected: | 126 protected: |
| 127 ClientSocketPool() {} | 127 ClientSocketPool(); |
| 128 virtual ~ClientSocketPool() {} | 128 virtual ~ClientSocketPool(); |
| 129 | 129 |
| 130 // Return the connection timeout for this pool. | 130 // Return the connection timeout for this pool. |
| 131 virtual base::TimeDelta ConnectionTimeout() const = 0; | 131 virtual base::TimeDelta ConnectionTimeout() const = 0; |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 friend class base::RefCounted<ClientSocketPool>; | 134 friend class base::RefCounted<ClientSocketPool>; |
| 135 | 135 |
| 136 DISALLOW_COPY_AND_ASSIGN(ClientSocketPool); | 136 DISALLOW_COPY_AND_ASSIGN(ClientSocketPool); |
| 137 }; | 137 }; |
| 138 | 138 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 159 // should be optimized out by the compiler. | 159 // should be optimized out by the compiler. |
| 160 #define REGISTER_SOCKET_PARAMS_FOR_POOL(pool_type, socket_params) \ | 160 #define REGISTER_SOCKET_PARAMS_FOR_POOL(pool_type, socket_params) \ |
| 161 template<> \ | 161 template<> \ |
| 162 struct SocketParamTraits<pool_type, scoped_refptr<socket_params> > \ | 162 struct SocketParamTraits<pool_type, scoped_refptr<socket_params> > \ |
| 163 : public base::true_type { \ | 163 : public base::true_type { \ |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace net | 166 } // namespace net |
| 167 | 167 |
| 168 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ | 168 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |