Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Unified Diff: net/http/http_network_layer.cc

Issue 6402002: Simplify HttpCache/HttpNetworkLayer/HttpNetworkSession interaction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_layer.h ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_layer.cc
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc
index 975e75cc7fabab00e9f8dc2a548d90c2ebcff8a6..293f8ec4ba6e29a5cd1b4d2f0f7e73af1e0db2a1 100644
--- a/net/http/http_network_layer.cc
+++ b/net/http/http_network_layer.cc
@@ -18,81 +18,8 @@
namespace net {
//-----------------------------------------------------------------------------
-
-HttpNetworkLayer::HttpNetworkLayer(
- ClientSocketFactory* socket_factory,
- HostResolver* host_resolver,
- CertVerifier* cert_verifier,
- DnsRRResolver* dnsrr_resolver,
- DnsCertProvenanceChecker* dns_cert_checker,
- SSLHostInfoFactory* ssl_host_info_factory,
- ProxyService* proxy_service,
- SSLConfigService* ssl_config_service,
- HttpAuthHandlerFactory* http_auth_handler_factory,
- HttpNetworkDelegate* network_delegate,
- NetLog* net_log)
- : socket_factory_(socket_factory),
- host_resolver_(host_resolver),
- cert_verifier_(cert_verifier),
- dnsrr_resolver_(dnsrr_resolver),
- dns_cert_checker_(dns_cert_checker),
- ssl_host_info_factory_(ssl_host_info_factory),
- proxy_service_(proxy_service),
- ssl_config_service_(ssl_config_service),
- session_(NULL),
- spdy_session_pool_(NULL),
- http_auth_handler_factory_(http_auth_handler_factory),
- network_delegate_(network_delegate),
- net_log_(net_log),
- suspended_(false) {
- DCHECK(proxy_service_);
- DCHECK(ssl_config_service_.get());
-}
-
-HttpNetworkLayer::HttpNetworkLayer(
- ClientSocketFactory* socket_factory,
- HostResolver* host_resolver,
- CertVerifier* cert_verifier,
- DnsRRResolver* dnsrr_resolver,
- DnsCertProvenanceChecker* dns_cert_checker,
- SSLHostInfoFactory* ssl_host_info_factory,
- ProxyService* proxy_service,
- SSLConfigService* ssl_config_service,
- SpdySessionPool* spdy_session_pool,
- HttpAuthHandlerFactory* http_auth_handler_factory,
- HttpNetworkDelegate* network_delegate,
- NetLog* net_log)
- : socket_factory_(socket_factory),
- host_resolver_(host_resolver),
- cert_verifier_(cert_verifier),
- dnsrr_resolver_(dnsrr_resolver),
- dns_cert_checker_(dns_cert_checker),
- ssl_host_info_factory_(ssl_host_info_factory),
- proxy_service_(proxy_service),
- ssl_config_service_(ssl_config_service),
- session_(NULL),
- spdy_session_pool_(spdy_session_pool),
- http_auth_handler_factory_(http_auth_handler_factory),
- network_delegate_(network_delegate),
- net_log_(net_log),
- suspended_(false) {
- DCHECK(proxy_service_);
- DCHECK(ssl_config_service_.get());
-}
-
HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session)
- : socket_factory_(ClientSocketFactory::GetDefaultFactory()),
- host_resolver_(NULL),
- cert_verifier_(NULL),
- dnsrr_resolver_(NULL),
- dns_cert_checker_(NULL),
- ssl_host_info_factory_(NULL),
- ssl_config_service_(NULL),
- session_(session),
- spdy_session_pool_(NULL),
- http_auth_handler_factory_(NULL),
- network_delegate_(NULL),
- net_log_(NULL),
+ : session_(session),
suspended_(false) {
DCHECK(session_.get());
}
@@ -104,29 +31,6 @@ HttpNetworkLayer::~HttpNetworkLayer() {
// static
HttpTransactionFactory* HttpNetworkLayer::CreateFactory(
- HostResolver* host_resolver,
- CertVerifier* cert_verifier,
- DnsRRResolver* dnsrr_resolver,
- DnsCertProvenanceChecker* dns_cert_checker,
- SSLHostInfoFactory* ssl_host_info_factory,
- ProxyService* proxy_service,
- SSLConfigService* ssl_config_service,
- HttpAuthHandlerFactory* http_auth_handler_factory,
- HttpNetworkDelegate* network_delegate,
- NetLog* net_log) {
- DCHECK(proxy_service);
-
- return new HttpNetworkLayer(ClientSocketFactory::GetDefaultFactory(),
- host_resolver, cert_verifier, dnsrr_resolver,
- dns_cert_checker,
- ssl_host_info_factory, proxy_service,
- ssl_config_service, http_auth_handler_factory,
- network_delegate,
- net_log);
-}
-
-// static
-HttpTransactionFactory* HttpNetworkLayer::CreateFactory(
HttpNetworkSession* session) {
DCHECK(session);
@@ -242,35 +146,6 @@ HttpCache* HttpNetworkLayer::GetCache() {
}
HttpNetworkSession* HttpNetworkLayer::GetSession() {
- if (!session_) {
- DCHECK(proxy_service_);
- if (!spdy_session_pool_.get())
- spdy_session_pool_.reset(new SpdySessionPool(ssl_config_service_));
- session_ = new HttpNetworkSession(
- host_resolver_,
- cert_verifier_,
- dnsrr_resolver_,
- dns_cert_checker_,
- ssl_host_info_factory_,
- proxy_service_,
- socket_factory_,
- ssl_config_service_,
- spdy_session_pool_.release(),
- http_auth_handler_factory_,
- network_delegate_,
- net_log_);
- // These were just temps for lazy-initializing HttpNetworkSession.
- host_resolver_ = NULL;
- cert_verifier_ = NULL;
- dnsrr_resolver_ = NULL;
- dns_cert_checker_ = NULL;
- ssl_host_info_factory_ = NULL;
- proxy_service_ = NULL;
- socket_factory_ = NULL;
- http_auth_handler_factory_ = NULL;
- net_log_ = NULL;
- network_delegate_ = NULL;
- }
return session_;
}
« no previous file with comments | « net/http/http_network_layer.h ('k') | net/http/http_network_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698