diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 17:10:10 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 17:10:10 +0000 |
commit | c689457d13245e024e67c256455d4ba92f79993d (patch) | |
tree | bf22ebd8b477d9a95c74a276b0b69797fb76e870 /net/tools | |
parent | 9c9c761a2e070a8a6eb00f22a4365fc6cc2e1eff (diff) | |
download | chromium_src-c689457d13245e024e67c256455d4ba92f79993d.zip chromium_src-c689457d13245e024e67c256455d4ba92f79993d.tar.gz chromium_src-c689457d13245e024e67c256455d4ba92f79993d.tar.bz2 |
Make HttpNetworkLayer tests network-independent.
This includes a small refactoring which allows using a different socket factory.
TEST=Covered by net_unittests.
BUG=http://crbug.com/14107
Review URL: http://codereview.chromium.org/126147
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r-- | net/tools/fetch/fetch_client.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/tools/fetch/fetch_client.cc b/net/tools/fetch/fetch_client.cc index 349eed9..6e86a88 100644 --- a/net/tools/fetch/fetch_client.cc +++ b/net/tools/fetch/fetch_client.cc @@ -8,6 +8,7 @@ #include "base/singleton.h" #include "base/stats_counters.h" #include "base/string_util.h" +#include "net/base/client_socket_factory.h" #include "net/base/completion_callback.h" #include "net/base/host_resolver.h" #include "net/base/io_buffer.h" @@ -129,10 +130,13 @@ int main(int argc, char**argv) { net::HostResolver host_resolver; scoped_ptr<net::ProxyService> proxy_service(net::ProxyService::CreateNull()); net::HttpTransactionFactory* factory = NULL; - if (use_cache) + if (use_cache) { factory = new net::HttpCache(&host_resolver, proxy_service.get(), 0); - else - factory = new net::HttpNetworkLayer(&host_resolver, proxy_service.get()); + } else { + factory = new net::HttpNetworkLayer( + net::ClientSocketFactory::GetDefaultFactory(), &host_resolver, + proxy_service.get()); + } { StatsCounterTimer driver_time("FetchClient.total_time"); |