From 57cb0f76bceab5f05f3d14a23e764795b476f3d3 Mon Sep 17 00:00:00 2001 From: "willchan@chromium.org" Date: Fri, 28 Jan 2011 06:33:58 +0000 Subject: Simplify HttpCache/HttpNetworkLayer/HttpNetworkSession interaction. Eliminate lazy initialization of HttpNetworkSession in HttpNetworkLayer. * This eliminates the need to update parameters for HttpNetworkLayer, it just takes a HttpNetworkSession. * It is OK to eliminate lazy initialization since these variables are cheap. BUG=none TEST=none Review URL: http://codereview.chromium.org/6402002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72931 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/net/connection_tester_unittest.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'chrome/browser/net/connection_tester_unittest.cc') diff --git a/chrome/browser/net/connection_tester_unittest.cc b/chrome/browser/net/connection_tester_unittest.cc index 8eecd81..f08daf4 100644 --- a/chrome/browser/net/connection_tester_unittest.cc +++ b/chrome/browser/net/connection_tester_unittest.cc @@ -14,6 +14,7 @@ #include "net/ftp/ftp_network_layer.h" #include "net/http/http_auth_handler_factory.h" #include "net/http/http_network_layer.h" +#include "net/http/http_network_session.h" #include "net/proxy/proxy_config_service_fixed.h" #include "net/socket/client_socket_factory.h" #include "net/spdy/spdy_session_pool.h" @@ -117,20 +118,22 @@ class ConnectionTesterTest : public PlatformTest { proxy_service_ = net::ProxyService::CreateDirect(); proxy_script_fetcher_context_->set_proxy_service(proxy_service_); ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); - http_transaction_factory_.reset( - new net::HttpNetworkLayer( - client_socket_factory_, + scoped_refptr network_session( + new net::HttpNetworkSession( &host_resolver_, &cert_verifier_, &dnsrr_resolver_, - NULL /* DNS cert provenance checker */, + NULL /* dns_cert_checker */, NULL /* ssl_host_info_factory */, proxy_service_.get(), + client_socket_factory_, ssl_config_service_, new net::SpdySessionPool(ssl_config_service_), &http_auth_handler_factory_, - NULL /* NetworkDelegate */, - NULL /* NetLog */)); + NULL /* network_delegate */, + NULL /* net_log */)); + http_transaction_factory_.reset( + new net::HttpNetworkLayer(network_session)); proxy_script_fetcher_context_->set_http_transaction_factory( http_transaction_factory_.get()); // In-memory cookie store. -- cgit v1.1