| 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_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| 6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 6 #define NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "net/socket/client_socket_pool_base.h" | 21 #include "net/socket/client_socket_pool_base.h" |
| 22 #include "net/socket/ssl_client_socket.h" | 22 #include "net/socket/ssl_client_socket.h" |
| 23 #include "net/spdy/chromium/spdy_session.h" | 23 #include "net/spdy/chromium/spdy_session.h" |
| 24 | 24 |
| 25 namespace net { | 25 namespace net { |
| 26 | 26 |
| 27 class HttpAuthCache; | 27 class HttpAuthCache; |
| 28 class HttpAuthHandlerFactory; | 28 class HttpAuthHandlerFactory; |
| 29 class HttpProxyClientSocketWrapper; | 29 class HttpProxyClientSocketWrapper; |
| 30 class NetLog; | 30 class NetLog; |
| 31 class NetworkQualityEstimator; |
| 31 class ProxyDelegate; | 32 class ProxyDelegate; |
| 32 class SSLClientSocketPool; | 33 class SSLClientSocketPool; |
| 33 class SSLSocketParams; | 34 class SSLSocketParams; |
| 34 class SpdySessionPool; | 35 class SpdySessionPool; |
| 35 class TransportClientSocketPool; | 36 class TransportClientSocketPool; |
| 36 class TransportSocketParams; | 37 class TransportSocketParams; |
| 37 | 38 |
| 38 // HttpProxySocketParams only needs the socket params for one of the proxy | 39 // HttpProxySocketParams only needs the socket params for one of the proxy |
| 39 // types. The other param must be NULL. When using an HTTP Proxy, | 40 // types. The other param must be NULL. When using an HTTP Proxy, |
| 40 // |transport_params| must be set. When using an HTTPS Proxy, |ssl_params| | 41 // |transport_params| must be set. When using an HTTPS Proxy, |ssl_params| |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 class NET_EXPORT_PRIVATE HttpProxyClientSocketPool | 137 class NET_EXPORT_PRIVATE HttpProxyClientSocketPool |
| 137 : public ClientSocketPool, | 138 : public ClientSocketPool, |
| 138 public HigherLayeredPool { | 139 public HigherLayeredPool { |
| 139 public: | 140 public: |
| 140 typedef HttpProxySocketParams SocketParams; | 141 typedef HttpProxySocketParams SocketParams; |
| 141 | 142 |
| 142 HttpProxyClientSocketPool(int max_sockets, | 143 HttpProxyClientSocketPool(int max_sockets, |
| 143 int max_sockets_per_group, | 144 int max_sockets_per_group, |
| 144 TransportClientSocketPool* transport_pool, | 145 TransportClientSocketPool* transport_pool, |
| 145 SSLClientSocketPool* ssl_pool, | 146 SSLClientSocketPool* ssl_pool, |
| 147 NetworkQualityEstimator* network_quality_estimator, |
| 146 NetLog* net_log); | 148 NetLog* net_log); |
| 147 | 149 |
| 148 ~HttpProxyClientSocketPool() override; | 150 ~HttpProxyClientSocketPool() override; |
| 149 | 151 |
| 150 // ClientSocketPool implementation. | 152 // ClientSocketPool implementation. |
| 151 int RequestSocket(const std::string& group_name, | 153 int RequestSocket(const std::string& group_name, |
| 152 const void* connect_params, | 154 const void* connect_params, |
| 153 RequestPriority priority, | 155 RequestPriority priority, |
| 154 RespectLimits respect_limits, | 156 RespectLimits respect_limits, |
| 155 ClientSocketHandle* handle, | 157 ClientSocketHandle* handle, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override; | 202 void RemoveHigherLayeredPool(HigherLayeredPool* higher_pool) override; |
| 201 | 203 |
| 202 // HigherLayeredPool implementation. | 204 // HigherLayeredPool implementation. |
| 203 bool CloseOneIdleConnection() override; | 205 bool CloseOneIdleConnection() override; |
| 204 | 206 |
| 205 private: | 207 private: |
| 206 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase; | 208 typedef ClientSocketPoolBase<HttpProxySocketParams> PoolBase; |
| 207 | 209 |
| 208 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory { | 210 class HttpProxyConnectJobFactory : public PoolBase::ConnectJobFactory { |
| 209 public: | 211 public: |
| 210 HttpProxyConnectJobFactory(TransportClientSocketPool* transport_pool, | 212 HttpProxyConnectJobFactory( |
| 211 SSLClientSocketPool* ssl_pool, | 213 TransportClientSocketPool* transport_pool, |
| 212 NetLog* net_log); | 214 SSLClientSocketPool* ssl_pool, |
| 215 NetworkQualityEstimator* network_quality_estimator, |
| 216 NetLog* net_log); |
| 213 | 217 |
| 214 // ClientSocketPoolBase::ConnectJobFactory methods. | 218 // ClientSocketPoolBase::ConnectJobFactory methods. |
| 215 std::unique_ptr<ConnectJob> NewConnectJob( | 219 std::unique_ptr<ConnectJob> NewConnectJob( |
| 216 const std::string& group_name, | 220 const std::string& group_name, |
| 217 const PoolBase::Request& request, | 221 const PoolBase::Request& request, |
| 218 ConnectJob::Delegate* delegate) const override; | 222 ConnectJob::Delegate* delegate) const override; |
| 219 | 223 |
| 220 base::TimeDelta ConnectionTimeout() const override; | 224 base::TimeDelta ConnectionTimeout() const override; |
| 221 | 225 |
| 222 private: | 226 private: |
| 223 TransportClientSocketPool* const transport_pool_; | 227 TransportClientSocketPool* const transport_pool_; |
| 224 SSLClientSocketPool* const ssl_pool_; | 228 SSLClientSocketPool* const ssl_pool_; |
| 229 NetworkQualityEstimator* network_quality_estimator_; |
| 230 const base::TimeDelta default_connection_timeout_; |
| 225 NetLog* net_log_; | 231 NetLog* net_log_; |
| 226 base::TimeDelta timeout_; | |
| 227 | 232 |
| 228 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJobFactory); | 233 DISALLOW_COPY_AND_ASSIGN(HttpProxyConnectJobFactory); |
| 229 }; | 234 }; |
| 230 | 235 |
| 231 TransportClientSocketPool* const transport_pool_; | 236 TransportClientSocketPool* const transport_pool_; |
| 232 SSLClientSocketPool* const ssl_pool_; | 237 SSLClientSocketPool* const ssl_pool_; |
| 233 PoolBase base_; | 238 PoolBase base_; |
| 234 | 239 |
| 235 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); | 240 DISALLOW_COPY_AND_ASSIGN(HttpProxyClientSocketPool); |
| 236 }; | 241 }; |
| 237 | 242 |
| 238 } // namespace net | 243 } // namespace net |
| 239 | 244 |
| 240 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ | 245 #endif // NET_HTTP_HTTP_PROXY_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |