| 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_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "net/base/privacy_mode.h" | 15 #include "net/base/privacy_mode.h" |
| 16 #include "net/dns/host_resolver.h" | |
| 17 #include "net/http/http_response_info.h" | 16 #include "net/http/http_response_info.h" |
| 18 #include "net/socket/client_socket_pool.h" | 17 #include "net/socket/client_socket_pool.h" |
| 19 #include "net/socket/client_socket_pool_base.h" | 18 #include "net/socket/client_socket_pool_base.h" |
| 20 #include "net/socket/client_socket_pool_histograms.h" | 19 #include "net/socket/client_socket_pool_histograms.h" |
| 21 #include "net/socket/ssl_client_socket.h" | 20 #include "net/socket/ssl_client_socket.h" |
| 22 #include "net/ssl/ssl_config_service.h" | 21 #include "net/ssl/ssl_config_service.h" |
| 23 | 22 |
| 24 namespace net { | 23 namespace net { |
| 25 | 24 |
| 26 class CertPolicyEnforcer; | 25 class CertPolicyEnforcer; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 public HigherLayeredPool, | 271 public HigherLayeredPool, |
| 273 public SSLConfigService::Observer { | 272 public SSLConfigService::Observer { |
| 274 public: | 273 public: |
| 275 typedef SSLSocketParams SocketParams; | 274 typedef SSLSocketParams SocketParams; |
| 276 | 275 |
| 277 // Only the pools that will be used are required. i.e. if you never | 276 // Only the pools that will be used are required. i.e. if you never |
| 278 // try to create an SSL over SOCKS socket, |socks_pool| may be NULL. | 277 // try to create an SSL over SOCKS socket, |socks_pool| may be NULL. |
| 279 SSLClientSocketPool(int max_sockets, | 278 SSLClientSocketPool(int max_sockets, |
| 280 int max_sockets_per_group, | 279 int max_sockets_per_group, |
| 281 ClientSocketPoolHistograms* histograms, | 280 ClientSocketPoolHistograms* histograms, |
| 282 HostResolver* host_resolver, | |
| 283 CertVerifier* cert_verifier, | 281 CertVerifier* cert_verifier, |
| 284 ChannelIDService* channel_id_service, | 282 ChannelIDService* channel_id_service, |
| 285 TransportSecurityState* transport_security_state, | 283 TransportSecurityState* transport_security_state, |
| 286 CTVerifier* cert_transparency_verifier, | 284 CTVerifier* cert_transparency_verifier, |
| 287 CertPolicyEnforcer* cert_policy_enforcer, | 285 CertPolicyEnforcer* cert_policy_enforcer, |
| 288 const std::string& ssl_session_cache_shard, | 286 const std::string& ssl_session_cache_shard, |
| 289 ClientSocketFactory* client_socket_factory, | 287 ClientSocketFactory* client_socket_factory, |
| 290 TransportClientSocketPool* transport_pool, | 288 TransportClientSocketPool* transport_pool, |
| 291 SOCKSClientSocketPool* socks_pool, | 289 SOCKSClientSocketPool* socks_pool, |
| 292 HttpProxyClientSocketPool* http_proxy_pool, | 290 HttpProxyClientSocketPool* http_proxy_pool, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 // won't get re-used. | 361 // won't get re-used. |
| 364 void OnSSLConfigChanged() override; | 362 void OnSSLConfigChanged() override; |
| 365 | 363 |
| 366 class SSLConnectJobFactory : public PoolBase::ConnectJobFactory { | 364 class SSLConnectJobFactory : public PoolBase::ConnectJobFactory { |
| 367 public: | 365 public: |
| 368 SSLConnectJobFactory( | 366 SSLConnectJobFactory( |
| 369 TransportClientSocketPool* transport_pool, | 367 TransportClientSocketPool* transport_pool, |
| 370 SOCKSClientSocketPool* socks_pool, | 368 SOCKSClientSocketPool* socks_pool, |
| 371 HttpProxyClientSocketPool* http_proxy_pool, | 369 HttpProxyClientSocketPool* http_proxy_pool, |
| 372 ClientSocketFactory* client_socket_factory, | 370 ClientSocketFactory* client_socket_factory, |
| 373 HostResolver* host_resolver, | |
| 374 const SSLClientSocketContext& context, | 371 const SSLClientSocketContext& context, |
| 375 const SSLConnectJob::GetMessengerCallback& get_messenger_callback, | 372 const SSLConnectJob::GetMessengerCallback& get_messenger_callback, |
| 376 NetLog* net_log); | 373 NetLog* net_log); |
| 377 | 374 |
| 378 ~SSLConnectJobFactory() override; | 375 ~SSLConnectJobFactory() override; |
| 379 | 376 |
| 380 // ClientSocketPoolBase::ConnectJobFactory methods. | 377 // ClientSocketPoolBase::ConnectJobFactory methods. |
| 381 scoped_ptr<ConnectJob> NewConnectJob( | 378 scoped_ptr<ConnectJob> NewConnectJob( |
| 382 const std::string& group_name, | 379 const std::string& group_name, |
| 383 const PoolBase::Request& request, | 380 const PoolBase::Request& request, |
| 384 ConnectJob::Delegate* delegate) const override; | 381 ConnectJob::Delegate* delegate) const override; |
| 385 | 382 |
| 386 base::TimeDelta ConnectionTimeout() const override; | 383 base::TimeDelta ConnectionTimeout() const override; |
| 387 | 384 |
| 388 private: | 385 private: |
| 389 TransportClientSocketPool* const transport_pool_; | 386 TransportClientSocketPool* const transport_pool_; |
| 390 SOCKSClientSocketPool* const socks_pool_; | 387 SOCKSClientSocketPool* const socks_pool_; |
| 391 HttpProxyClientSocketPool* const http_proxy_pool_; | 388 HttpProxyClientSocketPool* const http_proxy_pool_; |
| 392 ClientSocketFactory* const client_socket_factory_; | 389 ClientSocketFactory* const client_socket_factory_; |
| 393 HostResolver* const host_resolver_; | |
| 394 const SSLClientSocketContext context_; | 390 const SSLClientSocketContext context_; |
| 395 base::TimeDelta timeout_; | 391 base::TimeDelta timeout_; |
| 396 SSLConnectJob::GetMessengerCallback get_messenger_callback_; | 392 SSLConnectJob::GetMessengerCallback get_messenger_callback_; |
| 397 NetLog* net_log_; | 393 NetLog* net_log_; |
| 398 | 394 |
| 399 DISALLOW_COPY_AND_ASSIGN(SSLConnectJobFactory); | 395 DISALLOW_COPY_AND_ASSIGN(SSLConnectJobFactory); |
| 400 }; | 396 }; |
| 401 | 397 |
| 402 TransportClientSocketPool* const transport_pool_; | 398 TransportClientSocketPool* const transport_pool_; |
| 403 SOCKSClientSocketPool* const socks_pool_; | 399 SOCKSClientSocketPool* const socks_pool_; |
| 404 HttpProxyClientSocketPool* const http_proxy_pool_; | 400 HttpProxyClientSocketPool* const http_proxy_pool_; |
| 405 PoolBase base_; | 401 PoolBase base_; |
| 406 const scoped_refptr<SSLConfigService> ssl_config_service_; | 402 const scoped_refptr<SSLConfigService> ssl_config_service_; |
| 407 MessengerMap messenger_map_; | 403 MessengerMap messenger_map_; |
| 408 bool enable_ssl_connect_job_waiting_; | 404 bool enable_ssl_connect_job_waiting_; |
| 409 | 405 |
| 410 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool); | 406 DISALLOW_COPY_AND_ASSIGN(SSLClientSocketPool); |
| 411 }; | 407 }; |
| 412 | 408 |
| 413 } // namespace net | 409 } // namespace net |
| 414 | 410 |
| 415 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ | 411 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_POOL_H_ |
| OLD | NEW |