diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 06:33:58 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-28 06:33:58 +0000 |
commit | 57cb0f76bceab5f05f3d14a23e764795b476f3d3 (patch) | |
tree | a8c549a7c8e18f1e581cfba2ee78bca33699abf9 /net/url_request/url_request_test_util.cc | |
parent | d8397a8c9673136fe1deae24367b989e97f54bfb (diff) | |
download | chromium_src-57cb0f76bceab5f05f3d14a23e764795b476f3d3.zip chromium_src-57cb0f76bceab5f05f3d14a23e764795b476f3d3.tar.gz chromium_src-57cb0f76bceab5f05f3d14a23e764795b476f3d3.tar.bz2 |
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
Diffstat (limited to 'net/url_request/url_request_test_util.cc')
-rw-r--r-- | net/url_request/url_request_test_util.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc index 099810a..5053f35 100644 --- a/net/url_request/url_request_test_util.cc +++ b/net/url_request/url_request_test_util.cc @@ -7,6 +7,9 @@ #include "base/logging.h" #include "base/message_loop.h" #include "base/threading/thread.h" +#include "net/http/http_network_session.h" +#include "net/socket/client_socket_factory.h" +#include "net/spdy/spdy_session_pool.h" TestCookiePolicy::TestCookiePolicy(int options_bit_mask) : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), @@ -110,17 +113,19 @@ void TestURLRequestContext::Init() { http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( host_resolver_); http_transaction_factory_ = new net::HttpCache( - net::HttpNetworkLayer::CreateFactory(host_resolver_, - cert_verifier_, - NULL /* dnsrr_resolver */, - NULL /* dns_cert_checker */, - NULL /* ssl_host_info_factory */, - proxy_service_, - ssl_config_service_, - http_auth_handler_factory_, - network_delegate_, - NULL), - NULL /* net_log */, + new net::HttpNetworkSession( + host_resolver_, + cert_verifier_, + NULL /* dnsrr_resolver */, + NULL /* dns_cert_checker */, + NULL /* ssl_host_info_factory */, + proxy_service_, + net::ClientSocketFactory::GetDefaultFactory(), + ssl_config_service_, + new net::SpdySessionPool(ssl_config_service_), + http_auth_handler_factory_, + network_delegate_, + NULL), net::HttpCache::DefaultBackend::InMemory(0)); // In-memory cookie store. cookie_store_ = new net::CookieMonster(NULL, NULL); |