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

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

Issue 1342613002: Revert of Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl_io_data.cc
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index b3c8748772cd71e21e1179cffb5d059c076308c0..b45a287fd7fb019c15107d4d118568a42dd4377a 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -57,7 +57,6 @@
#include "net/base/sdch_manager.h"
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_cache.h"
-#include "net/http/http_network_session.h"
#include "net/http/http_server_properties_manager.h"
#include "net/sdch/sdch_owner.h"
#include "net/ssl/channel_id_service.h"
@@ -538,22 +537,22 @@
set_channel_id_service(channel_id_service);
main_context->set_channel_id_service(channel_id_service);
+ scoped_ptr<net::HttpCache> main_cache;
{
// TODO(ttuttle): Remove ScopedTracker below once crbug.com/436671 is fixed.
tracked_objects::ScopedTracker tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION("436671 HttpCache construction"));
- net::HttpCache::BackendFactory* main_backend(
+ net::HttpCache::DefaultBackend* main_backend =
new net::HttpCache::DefaultBackend(
net::DISK_CACHE,
ChooseCacheBackendType(),
lazy_params_->cache_path,
lazy_params_->cache_max_size,
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
- http_network_session_ = CreateHttpNetworkSession(*profile_params);
- main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(),
- main_backend);
- }
-
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
+ main_cache = CreateMainHttpFactory(profile_params, main_backend);
+ }
+
+ main_http_factory_.reset(main_cache.release());
main_context->set_http_transaction_factory(main_http_factory_.get());
#if !defined(DISABLE_FTP_SUPPORT)
@@ -665,7 +664,7 @@
partition_descriptor.path.Append(chrome::kCacheDirname);
// Use a separate HTTP disk cache for isolated apps.
- net::HttpCache::BackendFactory* app_backend;
+ net::HttpCache::BackendFactory* app_backend = NULL;
if (partition_descriptor.in_memory) {
app_backend = net::HttpCache::DefaultBackend::InMemory(0);
} else {
@@ -676,8 +675,10 @@
app_cache_max_size_,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
}
+ net::HttpNetworkSession* main_network_session =
+ main_http_factory_->GetSession();
scoped_ptr<net::HttpCache> app_http_cache =
- CreateHttpFactory(http_network_session_.get(), app_backend);
+ CreateHttpFactory(main_network_session, app_backend);
scoped_refptr<net::CookieStore> cookie_store = NULL;
if (partition_descriptor.in_memory) {
@@ -757,8 +758,10 @@
cache_path,
cache_max_size,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
+ net::HttpNetworkSession* main_network_session =
+ main_http_factory_->GetSession();
scoped_ptr<net::HttpCache> media_http_cache =
- CreateHttpFactory(http_network_session_.get(), media_backend);
+ CreateHttpFactory(main_network_session, media_backend);
// Transfer ownership of the cache to MediaRequestContext.
context->SetHttpTransactionFactory(media_http_cache.Pass());
« no previous file with comments | « chrome/browser/profiles/profile_impl_io_data.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698