summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_session.h
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-14 03:37:18 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-14 03:37:18 +0000
commite60e47ad57e7ff423c39cff9c88725a7aed85118 (patch)
treef8b53b60daa05f2e2c5df92ca333ad1283e389cc /net/http/http_network_session.h
parent548adcb9cb9343fe542f82cc35ffaa8f8279dfb6 (diff)
downloadchromium_src-e60e47ad57e7ff423c39cff9c88725a7aed85118.zip
chromium_src-e60e47ad57e7ff423c39cff9c88725a7aed85118.tar.gz
chromium_src-e60e47ad57e7ff423c39cff9c88725a7aed85118.tar.bz2
Implement SSLClientSocketPool.
To support SSLClientSocketPool, ClientSocketPoolBase and ClientSocketHandle require a notion of additional error state reported from the pool. Overtime the error handling may get become more integrated, alleviating the need for some of the additional error state. To support getting Http Proxy credentials from the user, the SSLClientSocketPool will release unauthenticated HttpProxyClientSocket's into the pool as idle. However, it checks their authentication status when receiving one, completing the authentication once the user has provided the credentials. BUG=30357 TEST=existing unit tests, ClientSocketPoolBaseTest.AdditionalErrorState*, SSLClientSocketPoolTest.* Review URL: http://codereview.chromium.org/2870030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_session.h')
-rw-r--r--net/http/http_network_session.h44
1 files changed, 42 insertions, 2 deletions
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index 5f1b869..de57eba 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -21,6 +21,7 @@
#include "net/proxy/proxy_service.h"
#include "net/socket/client_socket_pool_histograms.h"
#include "net/socket/socks_client_socket_pool.h"
+#include "net/socket/ssl_client_socket_pool.h"
#include "net/socket/tcp_client_socket_pool.h"
#include "net/spdy/spdy_settings_storage.h"
@@ -71,12 +72,19 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>,
return tcp_socket_pool_;
}
+ const scoped_refptr<SSLClientSocketPool>& ssl_socket_pool() {
+ return ssl_socket_pool_;
+ }
+
const scoped_refptr<SOCKSClientSocketPool>& GetSocketPoolForSOCKSProxy(
const HostPortPair& socks_proxy);
const scoped_refptr<HttpProxyClientSocketPool>& GetSocketPoolForHTTPProxy(
const HostPortPair& http_proxy);
+ const scoped_refptr<SSLClientSocketPool>& GetSocketPoolForSSLWithProxy(
+ const HostPortPair& proxy_server);
+
// SSL sockets come from the socket_factory().
ClientSocketFactory* socket_factory() { return socket_factory_; }
HostResolver* host_resolver() { return host_resolver_; }
@@ -100,11 +108,40 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>,
static uint16 fixed_https_port();
static void set_fixed_https_port(uint16 port);
+#ifdef UNIT_TEST
+ void FlushSocketPools() {
+ if (ssl_socket_pool_.get())
+ ssl_socket_pool_->Flush();
+ if (tcp_socket_pool_.get())
+ tcp_socket_pool_->Flush();
+
+ for (SSLSocketPoolMap::const_iterator it =
+ ssl_socket_pools_for_proxies_.begin();
+ it != ssl_socket_pools_for_proxies_.end();
+ it++)
+ it->second->Flush();
+
+ for (SOCKSSocketPoolMap::const_iterator it =
+ socks_socket_pools_.begin();
+ it != socks_socket_pools_.end();
+ it++)
+ it->second->Flush();
+
+ for (HTTPProxySocketPoolMap::const_iterator it =
+ http_proxy_socket_pools_.begin();
+ it != http_proxy_socket_pools_.end();
+ it++)
+ it->second->Flush();
+ }
+#endif
+
private:
typedef std::map<HostPortPair, scoped_refptr<HttpProxyClientSocketPool> >
HTTPProxySocketPoolMap;
typedef std::map<HostPortPair, scoped_refptr<SOCKSClientSocketPool> >
SOCKSSocketPoolMap;
+ typedef std::map<HostPortPair, scoped_refptr<SSLClientSocketPool> >
+ SSLSocketPoolMap;
friend class base::RefCounted<HttpNetworkSession>;
friend class HttpNetworkSessionPeer;
@@ -119,9 +156,12 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>,
scoped_refptr<ClientSocketPoolHistograms> http_proxy_pool_histograms_;
scoped_refptr<ClientSocketPoolHistograms> tcp_for_socks_pool_histograms_;
scoped_refptr<ClientSocketPoolHistograms> socks_pool_histograms_;
+ scoped_refptr<ClientSocketPoolHistograms> ssl_pool_histograms_;
scoped_refptr<TCPClientSocketPool> tcp_socket_pool_;
- HTTPProxySocketPoolMap http_proxy_socket_pool_;
- SOCKSSocketPoolMap socks_socket_pool_;
+ scoped_refptr<SSLClientSocketPool> ssl_socket_pool_;
+ HTTPProxySocketPoolMap http_proxy_socket_pools_;
+ SOCKSSocketPoolMap socks_socket_pools_;
+ SSLSocketPoolMap ssl_socket_pools_for_proxies_;
ClientSocketFactory* socket_factory_;
scoped_refptr<HostResolver> host_resolver_;
scoped_refptr<ProxyService> proxy_service_;