diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 05:35:06 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-17 05:35:06 +0000 |
commit | d510a78cd1aef9c2bdc692c79bae4a89f4851a98 (patch) | |
tree | 1a81aa485c053d3e66ca3ba79f5563838e63ba85 /net/http/http_network_session.h | |
parent | a05725888f71e72e3335d265e47643fd2768e39f (diff) | |
download | chromium_src-d510a78cd1aef9c2bdc692c79bae4a89f4851a98.zip chromium_src-d510a78cd1aef9c2bdc692c79bae4a89f4851a98.tar.gz chromium_src-d510a78cd1aef9c2bdc692c79bae4a89f4851a98.tar.bz2 |
This is roughly a reland of r43908, although I had to rewrite a fair chunk since code's changed a lot. I've changed it so as not to flush the host resolver too. I suspect there might have been a bug there. I was unable to reproduce the crash here on network change, so I think either that fixed it or something else changed under the hood. In any case, I want to reland this and see if anyone encounters any problems with it.
BUG=40455,40457
Review URL: http://codereview.chromium.org/2114004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_session.h')
-rw-r--r-- | net/http/http_network_session.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index 9674b21..b8edd71 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h @@ -10,6 +10,7 @@ #include "base/scoped_ptr.h" #include "net/base/host_port_pair.h" #include "net/base/host_resolver.h" +#include "net/base/network_change_notifier.h" #include "net/base/ssl_client_auth_cache.h" #include "net/base/ssl_config_service.h" #include "net/http/http_alternate_protocols.h" @@ -28,7 +29,9 @@ class NetworkChangeNotifier; class SpdySessionPool; // This class holds session objects used by HttpNetworkTransaction objects. -class HttpNetworkSession : public base::RefCounted<HttpNetworkSession> { +class HttpNetworkSession + : public base::RefCounted<HttpNetworkSession>, + public NetworkChangeNotifier::Observer { public: HttpNetworkSession( NetworkChangeNotifier* network_change_notifier, @@ -36,9 +39,15 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession> { ProxyService* proxy_service, ClientSocketFactory* client_socket_factory, SSLConfigService* ssl_config_service, - SpdySessionPool* spdy_session_pool, HttpAuthHandlerFactory* http_auth_handler_factory); + // NetworkChangeNotifier::Observer methods: + virtual void OnIPAddressChanged(); + + // Flushes cached data in the HttpNetworkSession. Typically called on IP + // address change. + void Flush(); + HttpAuthCache* auth_cache() { return &auth_cache_; } SSLClientAuthCache* ssl_client_auth_cache() { return &ssl_client_auth_cache_; @@ -82,10 +91,6 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession> { return http_auth_handler_factory_; } - // Replace the current socket pool with a new one. This effectively - // abandons the current pool. This is only used for debugging. - void ReplaceTCPSocketPool(); - static void set_max_sockets_per_group(int socket_count); static uint16 fixed_http_port(); @@ -105,15 +110,17 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession> { ~HttpNetworkSession(); + scoped_refptr<TCPClientSocketPool> CreateNewTCPSocketPool(); + HttpAuthCache auth_cache_; SSLClientAuthCache ssl_client_auth_cache_; HttpAlternateProtocols alternate_protocols_; NetworkChangeNotifier* const network_change_notifier_; + ClientSocketFactory* socket_factory_; + scoped_refptr<HostResolver> host_resolver_; scoped_refptr<TCPClientSocketPool> tcp_socket_pool_; HTTPProxySocketPoolMap http_proxy_socket_pool_; SOCKSSocketPoolMap socks_socket_pool_; - ClientSocketFactory* socket_factory_; - scoped_refptr<HostResolver> host_resolver_; scoped_refptr<ProxyService> proxy_service_; scoped_refptr<SSLConfigService> ssl_config_service_; scoped_refptr<SpdySessionPool> spdy_session_pool_; |