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

Unified Diff: net/url_request/url_request_context_builder.cc

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 years, 2 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_common.cc ('k') | net/url_request/url_request_context_storage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context_builder.cc
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index e2c77e9da77a172f1a175d033f67658276ebcb19..76d85c0ffa70e940a4520db80ca0e6a0b4fb24bb 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -386,9 +386,12 @@ scoped_ptr<URLRequestContext> URLRequestContextBuilder::Build() {
network_session_params.quic_connection_options =
http_network_session_params_.quic_connection_options;
+ storage->set_http_network_session(
+ make_scoped_ptr(new HttpNetworkSession(network_session_params)));
+
scoped_ptr<HttpTransactionFactory> http_transaction_factory;
if (http_cache_enabled_) {
- HttpCache::BackendFactory* http_cache_backend = NULL;
+ HttpCache::BackendFactory* http_cache_backend;
if (http_cache_params_.type == HttpCacheParams::DISK) {
http_cache_backend = new HttpCache::DefaultBackend(
DISK_CACHE, CACHE_BACKEND_DEFAULT, http_cache_params_.path,
@@ -398,13 +401,11 @@ scoped_ptr<URLRequestContext> URLRequestContextBuilder::Build() {
HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size);
}
- http_transaction_factory.reset(
- new HttpCache(network_session_params, http_cache_backend));
+ http_transaction_factory.reset(new HttpCache(
+ storage->http_network_session(), http_cache_backend, true));
} else {
- scoped_refptr<HttpNetworkSession> network_session(
- new HttpNetworkSession(network_session_params));
-
- http_transaction_factory.reset(new HttpNetworkLayer(network_session.get()));
+ http_transaction_factory.reset(
+ new HttpNetworkLayer(storage->http_network_session()));
}
storage->set_http_transaction_factory(http_transaction_factory.Pass());
« no previous file with comments | « net/spdy/spdy_test_util_common.cc ('k') | net/url_request/url_request_context_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698