| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 main_context->set_server_bound_cert_service(server_bound_cert_service); | 442 main_context->set_server_bound_cert_service(server_bound_cert_service); |
| 443 | 443 |
| 444 net::HttpCache::DefaultBackend* main_backend = | 444 net::HttpCache::DefaultBackend* main_backend = |
| 445 new net::HttpCache::DefaultBackend( | 445 new net::HttpCache::DefaultBackend( |
| 446 net::DISK_CACHE, | 446 net::DISK_CACHE, |
| 447 ChooseCacheBackendType(), | 447 ChooseCacheBackendType(), |
| 448 lazy_params_->cache_path, | 448 lazy_params_->cache_path, |
| 449 lazy_params_->cache_max_size, | 449 lazy_params_->cache_max_size, |
| 450 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) | 450 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) |
| 451 .get()); | 451 .get()); |
| 452 net::HttpNetworkSession::Params network_session_params; | 452 scoped_ptr<net::HttpCache> main_cache = CreateMainHttpFactory( |
| 453 PopulateNetworkSessionParams(profile_params, &network_session_params); | 453 profile_params, main_backend); |
| 454 net::HttpCache* main_cache = new net::HttpCache( | |
| 455 network_session_params, main_backend); | |
| 456 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); | 454 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); |
| 457 | 455 |
| 458 #if defined(OS_ANDROID) || defined(OS_IOS) | 456 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 459 DataReductionProxySettings::InitDataReductionProxySession( | 457 DataReductionProxySettings::InitDataReductionProxySession( |
| 460 main_cache->GetSession()); | 458 main_cache->GetSession()); |
| 461 #endif | 459 #endif |
| 462 | 460 |
| 463 if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) { | 461 if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) { |
| 464 main_cache->set_mode( | 462 main_cache->set_mode( |
| 465 chrome_browser_net::IsCookieRecordMode() ? | 463 chrome_browser_net::IsCookieRecordMode() ? |
| 466 net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | 464 net::HttpCache::RECORD : net::HttpCache::PLAYBACK); |
| 467 } | 465 } |
| 468 | 466 |
| 469 main_http_factory_.reset(main_cache); | 467 main_http_factory_ = main_cache.PassAs<net::HttpTransactionFactory>(); |
| 470 main_context->set_http_transaction_factory(main_cache); | 468 main_context->set_http_transaction_factory(main_http_factory_.get()); |
| 471 | 469 |
| 472 #if !defined(DISABLE_FTP_SUPPORT) | 470 #if !defined(DISABLE_FTP_SUPPORT) |
| 473 ftp_factory_.reset( | 471 ftp_factory_.reset( |
| 474 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 472 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
| 475 #endif // !defined(DISABLE_FTP_SUPPORT) | 473 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 476 | 474 |
| 477 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 475 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( |
| 478 new net::URLRequestJobFactoryImpl()); | 476 new net::URLRequestJobFactoryImpl()); |
| 479 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 477 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
| 480 main_job_factory_ = SetUpJobFactoryDefaults( | 478 main_job_factory_ = SetUpJobFactoryDefaults( |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 const base::Closure& completion) { | 716 const base::Closure& completion) { |
| 719 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 717 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 720 DCHECK(initialized()); | 718 DCHECK(initialized()); |
| 721 | 719 |
| 722 DCHECK(transport_security_state()); | 720 DCHECK(transport_security_state()); |
| 723 // Completes synchronously. | 721 // Completes synchronously. |
| 724 transport_security_state()->DeleteAllDynamicDataSince(time); | 722 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 725 DCHECK(http_server_properties_manager_); | 723 DCHECK(http_server_properties_manager_); |
| 726 http_server_properties_manager_->Clear(completion); | 724 http_server_properties_manager_->Clear(completion); |
| 727 } | 725 } |
| OLD | NEW |