| 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 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 21 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 22 #include "chrome/browser/io_thread.h" | 22 #include "chrome/browser/io_thread.h" |
| 23 #include "chrome/browser/net/chrome_net_log.h" | 23 #include "chrome/browser/net/chrome_net_log.h" |
| 24 #include "chrome/browser/net/chrome_network_delegate.h" | 24 #include "chrome/browser/net/chrome_network_delegate.h" |
| 25 #include "chrome/browser/net/chrome_sdch_policy.h" | 25 #include "chrome/browser/net/chrome_sdch_policy.h" |
| 26 #include "chrome/browser/net/connect_interceptor.h" | 26 #include "chrome/browser/net/connect_interceptor.h" |
| 27 #include "chrome/browser/net/cookie_store_util.h" | 27 #include "chrome/browser/net/cookie_store_util.h" |
| 28 #include "chrome/browser/net/http_server_properties_manager_factory.h" | 28 #include "chrome/browser/net/http_server_properties_manager_factory.h" |
| 29 #include "chrome/browser/net/predictor.h" | 29 #include "chrome/browser/net/predictor.h" |
| 30 #include "chrome/browser/net/quota_policy_channel_id_store.h" | 30 #include "chrome/browser/net/quota_policy_channel_id_store.h" |
| 31 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.
h" | |
| 32 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | |
| 33 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| 34 #include "chrome/common/chrome_constants.h" | 32 #include "chrome/common/chrome_constants.h" |
| 35 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 36 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 37 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 38 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_auth
_request_handler.h" | 36 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
| 39 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_inte
rceptor.h" | |
| 40 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw
ork_delegate.h" | |
| 41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prot
ocol.h" | |
| 42 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat
istics_prefs.h" | |
| 43 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usag
e_stats.h" | |
| 44 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" | |
| 45 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" | 37 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" |
| 38 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switc
hes.h" |
| 46 #include "components/domain_reliability/monitor.h" | 39 #include "components/domain_reliability/monitor.h" |
| 47 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
| 48 #include "content/public/browser/cookie_store_factory.h" | 41 #include "content/public/browser/cookie_store_factory.h" |
| 49 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
| 50 #include "content/public/browser/resource_context.h" | 43 #include "content/public/browser/resource_context.h" |
| 51 #include "content/public/browser/storage_partition.h" | 44 #include "content/public/browser/storage_partition.h" |
| 52 #include "extensions/browser/extension_protocols.h" | 45 #include "extensions/browser/extension_protocols.h" |
| 53 #include "extensions/common/constants.h" | 46 #include "extensions/common/constants.h" |
| 54 #include "net/base/cache_type.h" | 47 #include "net/base/cache_type.h" |
| 55 #include "net/base/sdch_manager.h" | 48 #include "net/base/sdch_manager.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 82 experiment_name == "ExperimentYes2") { | 75 experiment_name == "ExperimentYes2") { |
| 83 return net::CACHE_BACKEND_SIMPLE; | 76 return net::CACHE_BACKEND_SIMPLE; |
| 84 } | 77 } |
| 85 return net::CACHE_BACKEND_BLOCKFILE; | 78 return net::CACHE_BACKEND_BLOCKFILE; |
| 86 #endif | 79 #endif |
| 87 } | 80 } |
| 88 | 81 |
| 89 } // namespace | 82 } // namespace |
| 90 | 83 |
| 91 using content::BrowserThread; | 84 using content::BrowserThread; |
| 92 using data_reduction_proxy::DataReductionProxyParams; | |
| 93 | 85 |
| 94 ProfileImplIOData::Handle::Handle(Profile* profile) | 86 ProfileImplIOData::Handle::Handle(Profile* profile) |
| 95 : io_data_(new ProfileImplIOData), | 87 : io_data_(new ProfileImplIOData), |
| 96 profile_(profile), | 88 profile_(profile), |
| 97 initialized_(false) { | 89 initialized_(false) { |
| 98 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 90 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 99 DCHECK(profile); | 91 DCHECK(profile); |
| 100 } | 92 } |
| 101 | 93 |
| 102 ProfileImplIOData::Handle::~Handle() { | 94 ProfileImplIOData::Handle::~Handle() { |
| 103 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 104 io_data_->data_reduction_proxy_statistics_prefs()->WritePrefs(); | |
| 105 | |
| 106 if (io_data_->predictor_ != NULL) { | 96 if (io_data_->predictor_ != NULL) { |
| 107 // io_data_->predictor_ might be NULL if Init() was never called | 97 // io_data_->predictor_ might be NULL if Init() was never called |
| 108 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). | 98 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). |
| 109 bool save_prefs = true; | 99 bool save_prefs = true; |
| 110 #if defined(OS_CHROMEOS) | 100 #if defined(OS_CHROMEOS) |
| 111 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); | 101 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); |
| 112 #endif | 102 #endif |
| 113 if (save_prefs) | 103 if (save_prefs) |
| 114 io_data_->predictor_->SaveStateForNextStartupAndTrim(); | 104 io_data_->predictor_->SaveStateForNextStartupAndTrim(); |
| 115 io_data_->predictor_->ShutdownOnUIThread(); | 105 io_data_->predictor_->ShutdownOnUIThread(); |
| 116 } | 106 } |
| 117 | 107 |
| 118 if (io_data_->http_server_properties_manager_) | 108 if (io_data_->http_server_properties_manager_) |
| 119 io_data_->http_server_properties_manager_->ShutdownOnPrefThread(); | 109 io_data_->http_server_properties_manager_->ShutdownOnPrefThread(); |
| 120 | 110 |
| 121 io_data_->data_reduction_proxy_enabled_.Destroy(); | 111 io_data_->data_reduction_proxy_io_data()->DestroyPrefsOnUIThread(); |
| 122 io_data_->ShutdownOnUIThread(GetAllContextGetters().Pass()); | 112 io_data_->ShutdownOnUIThread(GetAllContextGetters().Pass()); |
| 123 } | 113 } |
| 124 | 114 |
| 125 void ProfileImplIOData::Handle::Init( | 115 void ProfileImplIOData::Handle::Init( |
| 126 const base::FilePath& cookie_path, | 116 const base::FilePath& cookie_path, |
| 127 const base::FilePath& channel_id_path, | 117 const base::FilePath& channel_id_path, |
| 128 const base::FilePath& cache_path, | 118 const base::FilePath& cache_path, |
| 129 int cache_max_size, | 119 int cache_max_size, |
| 130 const base::FilePath& media_cache_path, | 120 const base::FilePath& media_cache_path, |
| 131 int media_cache_max_size, | 121 int media_cache_max_size, |
| 132 const base::FilePath& extensions_cookie_path, | 122 const base::FilePath& extensions_cookie_path, |
| 133 const base::FilePath& profile_path, | 123 const base::FilePath& profile_path, |
| 134 const base::FilePath& infinite_cache_path, | 124 const base::FilePath& infinite_cache_path, |
| 135 chrome_browser_net::Predictor* predictor, | 125 chrome_browser_net::Predictor* predictor, |
| 136 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, | 126 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, |
| 137 storage::SpecialStoragePolicy* special_storage_policy, | 127 storage::SpecialStoragePolicy* special_storage_policy, |
| 138 scoped_ptr<domain_reliability::DomainReliabilityMonitor> | 128 scoped_ptr<domain_reliability::DomainReliabilityMonitor> |
| 139 domain_reliability_monitor, | 129 domain_reliability_monitor, |
| 140 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, | 130 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData> |
| 141 scoped_ptr<DataReductionProxyChromeConfigurator> | 131 data_reduction_proxy_io_data) { |
| 142 data_reduction_proxy_chrome_configurator, | |
| 143 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | |
| 144 data_reduction_proxy_params, | |
| 145 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> | |
| 146 data_reduction_proxy_statistics_prefs, | |
| 147 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> | |
| 148 data_reduction_proxy_event_store) { | |
| 149 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 132 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 150 DCHECK(!io_data_->lazy_params_); | 133 DCHECK(!io_data_->lazy_params_); |
| 151 DCHECK(predictor); | 134 DCHECK(predictor); |
| 152 | 135 |
| 153 LazyParams* lazy_params = new LazyParams(); | 136 LazyParams* lazy_params = new LazyParams(); |
| 154 | 137 |
| 155 lazy_params->cookie_path = cookie_path; | 138 lazy_params->cookie_path = cookie_path; |
| 156 lazy_params->channel_id_path = channel_id_path; | 139 lazy_params->channel_id_path = channel_id_path; |
| 157 lazy_params->cache_path = cache_path; | 140 lazy_params->cache_path = cache_path; |
| 158 lazy_params->cache_max_size = cache_max_size; | 141 lazy_params->cache_max_size = cache_max_size; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 171 io_data_->app_cache_max_size_ = cache_max_size; | 154 io_data_->app_cache_max_size_ = cache_max_size; |
| 172 io_data_->app_media_cache_max_size_ = media_cache_max_size; | 155 io_data_->app_media_cache_max_size_ = media_cache_max_size; |
| 173 | 156 |
| 174 io_data_->predictor_.reset(predictor); | 157 io_data_->predictor_.reset(predictor); |
| 175 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); | 158 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); |
| 176 | 159 |
| 177 io_data_->InitializeMetricsEnabledStateOnUIThread(); | 160 io_data_->InitializeMetricsEnabledStateOnUIThread(); |
| 178 if (io_data_->domain_reliability_monitor_) | 161 if (io_data_->domain_reliability_monitor_) |
| 179 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); | 162 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); |
| 180 | 163 |
| 181 io_data_->set_data_reduction_proxy_unavailable_callback( | 164 io_data_->set_data_reduction_proxy_io_data( |
| 182 data_reduction_proxy_unavailable); | 165 data_reduction_proxy_io_data.Pass()); |
| 183 io_data_->set_data_reduction_proxy_chrome_configurator( | |
| 184 data_reduction_proxy_chrome_configurator.Pass()); | |
| 185 io_data_->set_data_reduction_proxy_params(data_reduction_proxy_params.Pass()); | |
| 186 io_data_->set_data_reduction_proxy_statistics_prefs( | |
| 187 data_reduction_proxy_statistics_prefs.Pass()); | |
| 188 io_data_->set_data_reduction_proxy_event_store( | |
| 189 data_reduction_proxy_event_store.Pass()); | |
| 190 } | 166 } |
| 191 | 167 |
| 192 content::ResourceContext* | 168 content::ResourceContext* |
| 193 ProfileImplIOData::Handle::GetResourceContext() const { | 169 ProfileImplIOData::Handle::GetResourceContext() const { |
| 194 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 170 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 195 LazyInitialize(); | 171 LazyInitialize(); |
| 196 return GetResourceContextNoInit(); | 172 return GetResourceContextNoInit(); |
| 197 } | 173 } |
| 198 | 174 |
| 199 content::ResourceContext* | 175 content::ResourceContext* |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 io_data_->session_startup_pref()->Init( | 335 io_data_->session_startup_pref()->Init( |
| 360 prefs::kRestoreOnStartup, pref_service); | 336 prefs::kRestoreOnStartup, pref_service); |
| 361 io_data_->session_startup_pref()->MoveToThread( | 337 io_data_->session_startup_pref()->MoveToThread( |
| 362 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 338 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 363 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 339 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) |
| 364 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled, | 340 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled, |
| 365 pref_service); | 341 pref_service); |
| 366 io_data_->safe_browsing_enabled()->MoveToThread( | 342 io_data_->safe_browsing_enabled()->MoveToThread( |
| 367 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 343 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 368 #endif | 344 #endif |
| 369 io_data_->data_reduction_proxy_enabled_.Init( | 345 io_data_->data_reduction_proxy_io_data()->InitPrefsOnUIThread( |
| 370 data_reduction_proxy::prefs::kDataReductionProxyEnabled, pref_service); | 346 pref_service, |
| 371 io_data_->data_reduction_proxy_enabled_.MoveToThread( | |
| 372 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 347 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 373 io_data_->InitializeOnUIThread(profile_); | 348 io_data_->InitializeOnUIThread(profile_); |
| 374 } | 349 } |
| 375 | 350 |
| 376 scoped_ptr<ProfileIOData::ChromeURLRequestContextGetterVector> | 351 scoped_ptr<ProfileIOData::ChromeURLRequestContextGetterVector> |
| 377 ProfileImplIOData::Handle::GetAllContextGetters() { | 352 ProfileImplIOData::Handle::GetAllContextGetters() { |
| 378 ChromeURLRequestContextGetterMap::iterator iter; | 353 ChromeURLRequestContextGetterMap::iterator iter; |
| 379 scoped_ptr<ChromeURLRequestContextGetterVector> context_getters( | 354 scoped_ptr<ChromeURLRequestContextGetterVector> context_getters( |
| 380 new ChromeURLRequestContextGetterVector()); | 355 new ChromeURLRequestContextGetterVector()); |
| 381 | 356 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 410 |
| 436 if (domain_reliability_monitor_) { | 411 if (domain_reliability_monitor_) { |
| 437 domain_reliability::DomainReliabilityMonitor* monitor = | 412 domain_reliability::DomainReliabilityMonitor* monitor = |
| 438 domain_reliability_monitor_.get(); | 413 domain_reliability_monitor_.get(); |
| 439 monitor->InitURLRequestContext(main_context); | 414 monitor->InitURLRequestContext(main_context); |
| 440 monitor->AddBakedInConfigs(); | 415 monitor->AddBakedInConfigs(); |
| 441 monitor->SetDiscardUploads(!GetMetricsEnabledStateOnIOThread()); | 416 monitor->SetDiscardUploads(!GetMetricsEnabledStateOnIOThread()); |
| 442 chrome_network_delegate->set_domain_reliability_monitor(monitor); | 417 chrome_network_delegate->set_domain_reliability_monitor(monitor); |
| 443 } | 418 } |
| 444 | 419 |
| 445 set_data_reduction_proxy_auth_request_handler( | |
| 446 scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler> | |
| 447 (new data_reduction_proxy::DataReductionProxyAuthRequestHandler( | |
| 448 DataReductionProxyChromeSettings::GetClient(), | |
| 449 data_reduction_proxy_params(), | |
| 450 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)))); | |
| 451 set_data_reduction_proxy_usage_stats( | |
| 452 scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats> | |
| 453 (new data_reduction_proxy::DataReductionProxyUsageStats( | |
| 454 data_reduction_proxy_params(), | |
| 455 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI) | |
| 456 .get()))); | |
| 457 data_reduction_proxy_usage_stats()->set_unavailable_callback( | |
| 458 data_reduction_proxy_unavailable_callback()); | |
| 459 | |
| 460 scoped_ptr<data_reduction_proxy::DataReductionProxyNetworkDelegate> | |
| 461 data_reduction_proxy_network_delegate( | |
| 462 new data_reduction_proxy::DataReductionProxyNetworkDelegate( | |
| 463 chrome_network_delegate.Pass(), | |
| 464 data_reduction_proxy_params(), | |
| 465 data_reduction_proxy_auth_request_handler(), | |
| 466 base::Bind( | |
| 467 &DataReductionProxyChromeConfigurator::GetProxyConfigOnIOThread, | |
| 468 base::Unretained(data_reduction_proxy_chrome_configurator())))); | |
| 469 data_reduction_proxy_network_delegate->InitProxyConfigOverrider( | |
| 470 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); | |
| 471 data_reduction_proxy_network_delegate->InitStatisticsPrefsAndUMA( | |
| 472 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | |
| 473 data_reduction_proxy_statistics_prefs(), | |
| 474 &data_reduction_proxy_enabled_, | |
| 475 data_reduction_proxy_usage_stats()); | |
| 476 network_delegate_ = data_reduction_proxy_network_delegate.Pass(); | |
| 477 | |
| 478 // Initialize context members. | 420 // Initialize context members. |
| 479 | 421 |
| 480 ApplyProfileParamsToContext(main_context); | 422 ApplyProfileParamsToContext(main_context); |
| 481 | 423 |
| 482 if (http_server_properties_manager_) | 424 if (http_server_properties_manager_) |
| 483 http_server_properties_manager_->InitializeOnNetworkThread(); | 425 http_server_properties_manager_->InitializeOnNetworkThread(); |
| 484 | 426 |
| 485 main_context->set_transport_security_state(transport_security_state()); | 427 main_context->set_transport_security_state(transport_security_state()); |
| 486 | 428 |
| 487 main_context->set_net_log(io_thread->net_log()); | 429 main_context->set_net_log(io_thread->net_log()); |
| 488 | 430 |
| 431 network_delegate_ = data_reduction_proxy_io_data()->CreateNetworkDelegate( |
| 432 chrome_network_delegate.Pass(), true, true).Pass(); |
| 433 |
| 489 main_context->set_network_delegate(network_delegate_.get()); | 434 main_context->set_network_delegate(network_delegate_.get()); |
| 490 | 435 |
| 491 main_context->set_http_server_properties(http_server_properties()); | 436 main_context->set_http_server_properties(http_server_properties()); |
| 492 | 437 |
| 493 main_context->set_host_resolver( | 438 main_context->set_host_resolver( |
| 494 io_thread_globals->host_resolver.get()); | 439 io_thread_globals->host_resolver.get()); |
| 495 main_context->set_cert_transparency_verifier( | 440 main_context->set_cert_transparency_verifier( |
| 496 io_thread_globals->cert_transparency_verifier.get()); | 441 io_thread_globals->cert_transparency_verifier.get()); |
| 497 main_context->set_http_auth_handler_factory( | 442 main_context->set_http_auth_handler_factory( |
| 498 io_thread_globals->http_auth_handler_factory.get()); | 443 io_thread_globals->http_auth_handler_factory.get()); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 526 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
| 582 #endif // !defined(DISABLE_FTP_SUPPORT) | 527 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 583 | 528 |
| 584 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 529 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( |
| 585 new net::URLRequestJobFactoryImpl()); | 530 new net::URLRequestJobFactoryImpl()); |
| 586 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 531 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
| 587 // The data reduction proxy interceptor should be as close to the network | 532 // The data reduction proxy interceptor should be as close to the network |
| 588 // as possible. | 533 // as possible. |
| 589 request_interceptors.insert( | 534 request_interceptors.insert( |
| 590 request_interceptors.begin(), | 535 request_interceptors.begin(), |
| 591 new data_reduction_proxy::DataReductionProxyInterceptor( | 536 data_reduction_proxy_io_data()->CreateInterceptor()); |
| 592 data_reduction_proxy_params(), | |
| 593 data_reduction_proxy_usage_stats(), | |
| 594 data_reduction_proxy_event_store())); | |
| 595 main_job_factory_ = SetUpJobFactoryDefaults( | 537 main_job_factory_ = SetUpJobFactoryDefaults( |
| 596 main_job_factory.Pass(), | 538 main_job_factory.Pass(), |
| 597 request_interceptors.Pass(), | 539 request_interceptors.Pass(), |
| 598 profile_params->protocol_handler_interceptor.Pass(), | 540 profile_params->protocol_handler_interceptor.Pass(), |
| 599 main_context->network_delegate(), | 541 main_context->network_delegate(), |
| 600 ftp_factory_.get()); | 542 ftp_factory_.get()); |
| 601 main_context->set_job_factory(main_job_factory_.get()); | 543 main_context->set_job_factory(main_job_factory_.get()); |
| 602 | 544 |
| 603 #if defined(ENABLE_EXTENSIONS) | 545 #if defined(ENABLE_EXTENSIONS) |
| 604 InitializeExtensionsRequestContext(profile_params); | 546 InitializeExtensionsRequestContext(profile_params); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 context->SetCookieStore(cookie_store.get()); | 675 context->SetCookieStore(cookie_store.get()); |
| 734 context->SetHttpTransactionFactory(app_http_cache.Pass()); | 676 context->SetHttpTransactionFactory(app_http_cache.Pass()); |
| 735 | 677 |
| 736 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 678 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
| 737 new net::URLRequestJobFactoryImpl()); | 679 new net::URLRequestJobFactoryImpl()); |
| 738 InstallProtocolHandlers(job_factory.get(), protocol_handlers); | 680 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
| 739 // The data reduction proxy interceptor should be as close to the network | 681 // The data reduction proxy interceptor should be as close to the network |
| 740 // as possible. | 682 // as possible. |
| 741 request_interceptors.insert( | 683 request_interceptors.insert( |
| 742 request_interceptors.begin(), | 684 request_interceptors.begin(), |
| 743 new data_reduction_proxy::DataReductionProxyInterceptor( | 685 data_reduction_proxy_io_data()->CreateInterceptor()); |
| 744 data_reduction_proxy_params(), | |
| 745 data_reduction_proxy_usage_stats(), | |
| 746 data_reduction_proxy_event_store())); | |
| 747 scoped_ptr<net::URLRequestJobFactory> top_job_factory( | 686 scoped_ptr<net::URLRequestJobFactory> top_job_factory( |
| 748 SetUpJobFactoryDefaults(job_factory.Pass(), | 687 SetUpJobFactoryDefaults(job_factory.Pass(), |
| 749 request_interceptors.Pass(), | 688 request_interceptors.Pass(), |
| 750 protocol_handler_interceptor.Pass(), | 689 protocol_handler_interceptor.Pass(), |
| 751 main_context->network_delegate(), | 690 main_context->network_delegate(), |
| 752 ftp_factory_.get())); | 691 ftp_factory_.get())); |
| 753 context->SetJobFactory(top_job_factory.Pass()); | 692 context->SetJobFactory(top_job_factory.Pass()); |
| 754 | 693 |
| 755 return context; | 694 return context; |
| 756 } | 695 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 const base::Closure& completion) { | 785 const base::Closure& completion) { |
| 847 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 786 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 848 DCHECK(initialized()); | 787 DCHECK(initialized()); |
| 849 | 788 |
| 850 DCHECK(transport_security_state()); | 789 DCHECK(transport_security_state()); |
| 851 // Completes synchronously. | 790 // Completes synchronously. |
| 852 transport_security_state()->DeleteAllDynamicDataSince(time); | 791 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 853 DCHECK(http_server_properties_manager_); | 792 DCHECK(http_server_properties_manager_); |
| 854 http_server_properties_manager_->Clear(completion); | 793 http_server_properties_manager_->Clear(completion); |
| 855 } | 794 } |
| 856 | |
| 857 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { | |
| 858 return data_reduction_proxy_enabled_.GetValue() || | |
| 859 CommandLine::ForCurrentProcess()->HasSwitch( | |
| 860 data_reduction_proxy::switches::kEnableDataReductionProxy); | |
| 861 } | |
| OLD | NEW |