Chromium Code Reviews| 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 ceeeb420c8d0c25cfc77af33ad379f9d2448426d..b57c89a560db286b3d762ff373533cf4cee0be90 100644 |
| --- a/chrome/browser/profiles/profile_impl_io_data.cc |
| +++ b/chrome/browser/profiles/profile_impl_io_data.cc |
| @@ -459,10 +459,8 @@ void ProfileImplIOData::InitializeInternal( |
| lazy_params_->cache_max_size, |
| BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) |
| .get()); |
| - net::HttpNetworkSession::Params network_session_params; |
| - PopulateNetworkSessionParams(profile_params, &network_session_params); |
| - net::HttpCache* main_cache = new net::HttpCache( |
| - network_session_params, main_backend); |
| + scoped_ptr<net::HttpCache> main_cache = CreateMainHttpFactory( |
| + profile_params, main_backend); |
| main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); |
| #if defined(OS_ANDROID) || defined(OS_IOS) |
| @@ -476,8 +474,8 @@ void ProfileImplIOData::InitializeInternal( |
| net::HttpCache::RECORD : net::HttpCache::PLAYBACK); |
| } |
| - main_http_factory_.reset(main_cache); |
| - main_context->set_http_transaction_factory(main_cache); |
| + main_http_factory_ = main_cache.PassAs<net::HttpTransactionFactory>(); |
|
mmenke
2014/03/31 18:10:20
Think "main_http_factory_.reset(main_cache.release
eustas
2014/04/18 12:33:19
Done.
|
| + main_context->set_http_transaction_factory(main_http_factory_.get()); |
| #if !defined(DISABLE_FTP_SUPPORT) |
| ftp_factory_.reset( |
| @@ -591,8 +589,8 @@ ChromeURLRequestContext* ProfileImplIOData::InitializeAppRequestContext( |
| } |
| net::HttpNetworkSession* main_network_session = |
| main_http_factory_->GetSession(); |
| - net::HttpCache* app_http_cache = |
| - new net::HttpCache(main_network_session, app_backend); |
| + scoped_ptr<net::HttpCache> app_http_cache = |
| + CreateHttpFactory(main_network_session, app_backend); |
| scoped_refptr<net::CookieStore> cookie_store = NULL; |
| if (partition_descriptor.in_memory) { |
| @@ -627,7 +625,8 @@ ChromeURLRequestContext* ProfileImplIOData::InitializeAppRequestContext( |
| // Transfer ownership of the cookies and cache to AppRequestContext. |
| context->SetCookieStore(cookie_store.get()); |
| context->SetHttpTransactionFactory( |
| - scoped_ptr<net::HttpTransactionFactory>(app_http_cache)); |
| + scoped_ptr<net::HttpTransactionFactory>( |
| + app_http_cache.PassAs<net::HttpTransactionFactory>())); |
| scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
| new net::URLRequestJobFactoryImpl()); |
| @@ -680,11 +679,12 @@ ProfileImplIOData::InitializeMediaRequestContext( |
| .get()); |
| net::HttpNetworkSession* main_network_session = |
| main_http_factory_->GetSession(); |
| - scoped_ptr<net::HttpTransactionFactory> media_http_cache( |
| - new net::HttpCache(main_network_session, media_backend)); |
| + scoped_ptr<net::HttpCache> media_http_cache = |
| + CreateHttpFactory(main_network_session, media_backend); |
| // Transfer ownership of the cache to MediaRequestContext. |
| - context->SetHttpTransactionFactory(media_http_cache.Pass()); |
| + context->SetHttpTransactionFactory( |
| + media_http_cache.PassAs<net::HttpTransactionFactory>()); |
| // Note that we do not create a new URLRequestJobFactory because |
| // the media context should behave exactly like its parent context |