| 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 cf9c3a70f11c24ec5a1803495b4ff58395478874..4b0bc02ad77a2858d33c66e6cbc79263b6388059 100644
|
| --- a/chrome/browser/profiles/profile_impl_io_data.cc
|
| +++ b/chrome/browser/profiles/profile_impl_io_data.cc
|
| @@ -57,6 +57,7 @@
|
| #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"
|
| @@ -537,22 +538,22 @@ void ProfileImplIOData::InitializeInternal(
|
| 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::DefaultBackend* main_backend =
|
| + net::HttpCache::BackendFactory* main_backend(
|
| new net::HttpCache::DefaultBackend(
|
| net::DISK_CACHE,
|
| ChooseCacheBackendType(),
|
| lazy_params_->cache_path,
|
| lazy_params_->cache_max_size,
|
| - BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
|
| - main_cache = CreateMainHttpFactory(profile_params, main_backend);
|
| + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
|
| + http_network_session_ = CreateHttpNetworkSession(*profile_params);
|
| + main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(),
|
| + main_backend);
|
| }
|
|
|
| - main_http_factory_.reset(main_cache.release());
|
| main_context->set_http_transaction_factory(main_http_factory_.get());
|
|
|
| #if !defined(DISABLE_FTP_SUPPORT)
|
| @@ -664,7 +665,7 @@ net::URLRequestContext* ProfileImplIOData::InitializeAppRequestContext(
|
| partition_descriptor.path.Append(chrome::kCacheDirname);
|
|
|
| // Use a separate HTTP disk cache for isolated apps.
|
| - net::HttpCache::BackendFactory* app_backend = NULL;
|
| + net::HttpCache::BackendFactory* app_backend;
|
| if (partition_descriptor.in_memory) {
|
| app_backend = net::HttpCache::DefaultBackend::InMemory(0);
|
| } else {
|
| @@ -675,10 +676,8 @@ net::URLRequestContext* ProfileImplIOData::InitializeAppRequestContext(
|
| 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(main_network_session, app_backend);
|
| + CreateHttpFactory(http_network_session_.get(), app_backend);
|
|
|
| scoped_refptr<net::CookieStore> cookie_store = NULL;
|
| if (partition_descriptor.in_memory) {
|
| @@ -758,10 +757,8 @@ ProfileImplIOData::InitializeMediaRequestContext(
|
| 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(main_network_session, media_backend);
|
| + CreateHttpFactory(http_network_session_.get(), media_backend);
|
|
|
| // Transfer ownership of the cache to MediaRequestContext.
|
| context->SetHttpTransactionFactory(media_http_cache.Pass());
|
|
|