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

Unified Diff: net/tools/fetch/fetch_client.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/spdy/spdy_test_util.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/fetch/fetch_client.cc
diff --git a/net/tools/fetch/fetch_client.cc b/net/tools/fetch/fetch_client.cc
index 0d9682ffea07e99c9eaa6a8c44fd49413c145e7e..8ba7534a429d19fdb1da4f30bbe375e796894c08 100644
--- a/net/tools/fetch/fetch_client.cc
+++ b/net/tools/fetch/fetch_client.cc
@@ -20,10 +20,12 @@
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_cache.h"
#include "net/http/http_network_layer.h"
+#include "net/http/http_network_session.h"
#include "net/http/http_request_info.h"
#include "net/http/http_transaction.h"
#include "net/proxy/proxy_service.h"
#include "net/socket/client_socket_factory.h"
+#include "net/spdy/spdy_session_pool.h"
void usage(const char* program_name) {
printf("usage: %s --url=<url> [--n=<clients>] [--stats] [--use_cache]\n",
@@ -149,24 +151,25 @@ int main(int argc, char**argv) {
net::HttpTransactionFactory* factory = NULL;
scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory(
net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
+ scoped_refptr<net::HttpNetworkSession> network_session(
+ new net::HttpNetworkSession(
+ host_resolver.get(),
+ cert_verifier.get(),
+ NULL /* dnsrr_resolver */,
+ NULL /* dns_cert_checker */,
+ NULL /* ssl_host_info_factory */,
+ proxy_service,
+ net::ClientSocketFactory::GetDefaultFactory(),
+ ssl_config_service,
+ new net::SpdySessionPool(NULL),
+ http_auth_handler_factory.get(),
+ NULL,
+ NULL));
if (use_cache) {
- factory = new net::HttpCache(host_resolver.get(), cert_verifier.get(),
- NULL, NULL, proxy_service, ssl_config_service,
- http_auth_handler_factory.get(), NULL, NULL,
- net::HttpCache::DefaultBackend::InMemory(0));
+ factory = new net::HttpCache(network_session,
+ net::HttpCache::DefaultBackend::InMemory(0));
} else {
- factory = new net::HttpNetworkLayer(
- net::ClientSocketFactory::GetDefaultFactory(),
- host_resolver.get(),
- cert_verifier.get(),
- NULL /* dnsrr_resolver */,
- NULL /* dns_cert_checker */,
- NULL /* ssl_host_info_factory */,
- proxy_service,
- ssl_config_service,
- http_auth_handler_factory.get(),
- NULL,
- NULL);
+ factory = new net::HttpNetworkLayer(network_session);
}
{
« no previous file with comments | « net/spdy/spdy_test_util.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698