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

Unified Diff: chrome/browser/profiles/off_the_record_profile_io_data.cc

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed two comments, fix some tests Created 5 years, 3 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
Index: chrome/browser/profiles/off_the_record_profile_io_data.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index 85a30f548932ee3a9e95599530742c8a76388c7f..015924d8a91a8b87fa96977e42e5b0f110949d42 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -249,7 +249,9 @@ void OffTheRecordProfileIOData::InitializeInternal(
net::HttpCache::BackendFactory* main_backend =
net::HttpCache::DefaultBackend::InMemory(0);
- main_http_factory_ = CreateMainHttpFactory(profile_params, main_backend);
+ http_network_session_ = CreateHttpNetworkSession(*profile_params);
+ main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(),
+ main_backend);
main_context->set_http_transaction_factory(main_http_factory_.get());
#if !defined(DISABLE_FTP_SUPPORT)
@@ -348,10 +350,8 @@ net::URLRequestContext* OffTheRecordProfileIOData::InitializeAppRequestContext(
// Use a separate in-memory cache for the app.
net::HttpCache::BackendFactory* app_backend =
net::HttpCache::DefaultBackend::InMemory(0);
- net::HttpNetworkSession* main_network_session =
- main_http_factory_->GetSession();
scoped_ptr<net::HttpCache> app_http_cache =
- CreateHttpFactory(main_network_session, app_backend);
+ CreateHttpFactory(http_network_session_.get(), app_backend);
context->SetHttpTransactionFactory(app_http_cache.Pass());

Powered by Google App Engine
This is Rietveld 408576698