summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_session.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 23:57:45 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 23:57:45 +0000
commit95fb385e5e68a69a39c77d66d801bebdaf39c311 (patch)
tree2090dc35a76c8cb85b1ef20c200254884f6d6d3a /net/http/http_network_session.h
parent711726473047dc051e3bddc04657f3f6ce42569f (diff)
downloadchromium_src-95fb385e5e68a69a39c77d66d801bebdaf39c311.zip
chromium_src-95fb385e5e68a69a39c77d66d801bebdaf39c311.tar.gz
chromium_src-95fb385e5e68a69a39c77d66d801bebdaf39c311.tar.bz2
Refactor HttpStreamFactory.
Rename StreamFactory and StreamRequest to HttpStreamFactory and HttpStreamRequest. Rename HttpStreamFactory to HttpStreamFactoryImpl. Create HttpStreamFactoryImpl::Request (inherits from HttpStreamRequest) and HttpStreamFactoryImpl::Job (most of the old HttpStreamRequest code, other than the interface, moved here). Currently there is still a strong binding within HttpStreamFactoryImpl between requests and jobs. This will be removed in a future changelist. Note that due to the preparation for late binding, information like HttpRequestInfo and SSLConfig and ProxyInfo are just copied. It's possible we can consider refcounting them to reduce copies, but I think it's not worth the effort / ugliness. I also did some minor cleanups like moving SpdySettingsStorage into SpdySessionPool and some CloseIdleConnections() cleanup. BUG=54371,42669 TEST=unit tests Review URL: http://codereview.chromium.org/6543004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75668 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_session.h')
-rw-r--r--net/http/http_network_session.h39
1 files changed, 19 insertions, 20 deletions
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index 36cb652..5c8f705 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -71,7 +71,7 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>,
explicit HttpNetworkSession(const Params& params);
- HttpAuthCache* auth_cache() { return &auth_cache_; }
+ HttpAuthCache* http_auth_cache() { return &http_auth_cache_; }
SSLClientAuthCache* ssl_client_auth_cache() {
return &ssl_client_auth_cache_;
}
@@ -87,14 +87,6 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>,
return &alternate_protocols_;
}
- // Access to the SpdySettingsStorage
- const SpdySettingsStorage& spdy_settings() const {
- return spdy_settings_;
- }
- SpdySettingsStorage* mutable_spdy_settings() {
- return &spdy_settings_;
- }
-
TCPClientSocketPool* tcp_socket_pool() {
return socket_pool_manager_.tcp_socket_pool();
}
@@ -130,7 +122,7 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>,
}
HttpStreamFactory* http_stream_factory() {
- return &http_stream_factory_;
+ return http_stream_factory_.get();
}
NetLog* net_log() {
@@ -147,30 +139,37 @@ class HttpNetworkSession : public base::RefCounted<HttpNetworkSession>,
// responsible for deleting the returned value.
Value* SpdySessionPoolInfoToValue() const;
- void FlushSocketPools() {
+ void CloseAllConnections() {
socket_pool_manager_.FlushSocketPools();
+ spdy_session_pool_.CloseCurrentSessions();
+ }
+
+ void CloseIdleConnections() {
+ socket_pool_manager_.CloseIdleSockets();
}
+
private:
friend class base::RefCounted<HttpNetworkSession>;
friend class HttpNetworkSessionPeer;
~HttpNetworkSession();
- HttpAuthCache auth_cache_;
- SSLClientAuthCache ssl_client_auth_cache_;
- HttpAlternateProtocols alternate_protocols_;
- CertVerifier* cert_verifier_;
+ NetLog* const net_log_;
+ HttpNetworkDelegate* const network_delegate_;
+ CertVerifier* const cert_verifier_;
+ HttpAuthHandlerFactory* const http_auth_handler_factory_;
+
// Not const since it's modified by HttpNetworkSessionPeer for testing.
scoped_refptr<ProxyService> proxy_service_;
const scoped_refptr<SSLConfigService> ssl_config_service_;
+
+ HttpAuthCache http_auth_cache_;
+ SSLClientAuthCache ssl_client_auth_cache_;
+ HttpAlternateProtocols alternate_protocols_;
ClientSocketPoolManager socket_pool_manager_;
SpdySessionPool spdy_session_pool_;
- HttpStreamFactory http_stream_factory_;
- HttpAuthHandlerFactory* const http_auth_handler_factory_;
- HttpNetworkDelegate* const network_delegate_;
- NetLog* const net_log_;
- SpdySettingsStorage spdy_settings_;
+ scoped_ptr<HttpStreamFactory> http_stream_factory_;
std::set<HttpResponseBodyDrainer*> response_drainers_;
};