Chromium Code Reviews| 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.h" | 21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 22 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 22 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 23 #include "chrome/browser/io_thread.h" | 23 #include "chrome/browser/io_thread.h" |
| 24 #include "chrome/browser/net/chrome_net_log.h" | 24 #include "chrome/browser/net/chrome_net_log.h" |
| 25 #include "chrome/browser/net/chrome_network_delegate.h" | 25 #include "chrome/browser/net/chrome_network_delegate.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_settings.h" | |
| 32 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
| 33 #include "chrome/common/chrome_constants.h" | 32 #include "chrome/common/chrome_constants.h" |
| 34 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 36 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 37 #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" |
| 38 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf igurator.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_stat istics_prefs.h" | |
| 42 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_usag e_stats.h" | |
| 43 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" | |
| 44 #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" | |
|
sclittle
2015/01/14 22:54:46
Is this needed here?
bengr
2015/01/15 00:30:31
Nope. Done.
| |
| 45 #include "components/domain_reliability/monitor.h" | 39 #include "components/domain_reliability/monitor.h" |
| 46 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
| 47 #include "content/public/browser/cookie_store_factory.h" | 41 #include "content/public/browser/cookie_store_factory.h" |
| 48 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
| 49 #include "content/public/browser/resource_context.h" | 43 #include "content/public/browser/resource_context.h" |
| 50 #include "content/public/browser/storage_partition.h" | 44 #include "content/public/browser/storage_partition.h" |
| 51 #include "extensions/browser/extension_protocols.h" | 45 #include "extensions/browser/extension_protocols.h" |
| 52 #include "extensions/common/constants.h" | 46 #include "extensions/common/constants.h" |
| 53 #include "net/base/cache_type.h" | 47 #include "net/base/cache_type.h" |
| 54 #include "net/base/sdch_manager.h" | 48 #include "net/base/sdch_manager.h" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 83 experiment_name == "ExperimentYes2") { | 77 experiment_name == "ExperimentYes2") { |
| 84 return net::CACHE_BACKEND_SIMPLE; | 78 return net::CACHE_BACKEND_SIMPLE; |
| 85 } | 79 } |
| 86 return net::CACHE_BACKEND_BLOCKFILE; | 80 return net::CACHE_BACKEND_BLOCKFILE; |
| 87 #endif | 81 #endif |
| 88 } | 82 } |
| 89 | 83 |
| 90 } // namespace | 84 } // namespace |
| 91 | 85 |
| 92 using content::BrowserThread; | 86 using content::BrowserThread; |
| 93 using data_reduction_proxy::DataReductionProxyParams; | |
| 94 | 87 |
| 95 ProfileImplIOData::Handle::Handle(Profile* profile) | 88 ProfileImplIOData::Handle::Handle(Profile* profile) |
| 96 : io_data_(new ProfileImplIOData), | 89 : io_data_(new ProfileImplIOData), |
| 97 profile_(profile), | 90 profile_(profile), |
| 98 initialized_(false) { | 91 initialized_(false) { |
| 99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 100 DCHECK(profile); | 93 DCHECK(profile); |
| 101 } | 94 } |
| 102 | 95 |
| 103 ProfileImplIOData::Handle::~Handle() { | 96 ProfileImplIOData::Handle::~Handle() { |
| 104 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 97 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 105 io_data_->data_reduction_proxy_statistics_prefs()->WritePrefs(); | |
| 106 | |
| 107 if (io_data_->predictor_ != NULL) { | 98 if (io_data_->predictor_ != NULL) { |
| 108 // io_data_->predictor_ might be NULL if Init() was never called | 99 // io_data_->predictor_ might be NULL if Init() was never called |
| 109 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). | 100 // (i.e. we shut down before ProfileImpl::DoFinalInit() got called). |
| 110 bool save_prefs = true; | 101 bool save_prefs = true; |
| 111 #if defined(OS_CHROMEOS) | 102 #if defined(OS_CHROMEOS) |
| 112 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); | 103 save_prefs = !chromeos::ProfileHelper::IsSigninProfile(profile_); |
| 113 #endif | 104 #endif |
| 114 if (save_prefs) | 105 if (save_prefs) |
| 115 io_data_->predictor_->SaveStateForNextStartupAndTrim(); | 106 io_data_->predictor_->SaveStateForNextStartupAndTrim(); |
| 116 io_data_->predictor_->ShutdownOnUIThread(); | 107 io_data_->predictor_->ShutdownOnUIThread(); |
| 117 } | 108 } |
| 118 | 109 |
| 119 if (io_data_->http_server_properties_manager_) | 110 if (io_data_->http_server_properties_manager_) |
| 120 io_data_->http_server_properties_manager_->ShutdownOnPrefThread(); | 111 io_data_->http_server_properties_manager_->ShutdownOnPrefThread(); |
| 121 | 112 |
| 122 io_data_->data_reduction_proxy_enabled_.Destroy(); | 113 io_data_->data_reduction_proxy_io_data()->DestroyPrefsOnUIThread(); |
| 123 io_data_->ShutdownOnUIThread(GetAllContextGetters().Pass()); | 114 io_data_->ShutdownOnUIThread(GetAllContextGetters().Pass()); |
| 124 } | 115 } |
| 125 | 116 |
| 126 void ProfileImplIOData::Handle::Init( | 117 void ProfileImplIOData::Handle::Init( |
| 127 const base::FilePath& cookie_path, | 118 const base::FilePath& cookie_path, |
| 128 const base::FilePath& channel_id_path, | 119 const base::FilePath& channel_id_path, |
| 129 const base::FilePath& cache_path, | 120 const base::FilePath& cache_path, |
| 130 int cache_max_size, | 121 int cache_max_size, |
| 131 const base::FilePath& media_cache_path, | 122 const base::FilePath& media_cache_path, |
| 132 int media_cache_max_size, | 123 int media_cache_max_size, |
| 133 const base::FilePath& extensions_cookie_path, | 124 const base::FilePath& extensions_cookie_path, |
| 134 const base::FilePath& profile_path, | 125 const base::FilePath& profile_path, |
| 135 const base::FilePath& infinite_cache_path, | 126 const base::FilePath& infinite_cache_path, |
| 136 chrome_browser_net::Predictor* predictor, | 127 chrome_browser_net::Predictor* predictor, |
| 137 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, | 128 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, |
| 138 storage::SpecialStoragePolicy* special_storage_policy, | 129 storage::SpecialStoragePolicy* special_storage_policy, |
| 139 scoped_ptr<domain_reliability::DomainReliabilityMonitor> | 130 scoped_ptr<domain_reliability::DomainReliabilityMonitor> |
| 140 domain_reliability_monitor, | 131 domain_reliability_monitor, |
| 141 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, | 132 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData> |
| 142 scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> | 133 data_reduction_proxy_io_data) { |
| 143 data_reduction_proxy_configurator, | |
| 144 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | |
| 145 data_reduction_proxy_params, | |
| 146 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> | |
| 147 data_reduction_proxy_statistics_prefs, | |
| 148 scoped_ptr<data_reduction_proxy::DataReductionProxyEventStore> | |
| 149 data_reduction_proxy_event_store) { | |
| 150 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 134 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 151 DCHECK(!io_data_->lazy_params_); | 135 DCHECK(!io_data_->lazy_params_); |
| 152 DCHECK(predictor); | 136 DCHECK(predictor); |
| 153 | 137 |
| 154 LazyParams* lazy_params = new LazyParams(); | 138 LazyParams* lazy_params = new LazyParams(); |
| 155 | 139 |
| 156 lazy_params->cookie_path = cookie_path; | 140 lazy_params->cookie_path = cookie_path; |
| 157 lazy_params->channel_id_path = channel_id_path; | 141 lazy_params->channel_id_path = channel_id_path; |
| 158 lazy_params->cache_path = cache_path; | 142 lazy_params->cache_path = cache_path; |
| 159 lazy_params->cache_max_size = cache_max_size; | 143 lazy_params->cache_max_size = cache_max_size; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 172 io_data_->app_cache_max_size_ = cache_max_size; | 156 io_data_->app_cache_max_size_ = cache_max_size; |
| 173 io_data_->app_media_cache_max_size_ = media_cache_max_size; | 157 io_data_->app_media_cache_max_size_ = media_cache_max_size; |
| 174 | 158 |
| 175 io_data_->predictor_.reset(predictor); | 159 io_data_->predictor_.reset(predictor); |
| 176 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); | 160 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); |
| 177 | 161 |
| 178 io_data_->InitializeMetricsEnabledStateOnUIThread(); | 162 io_data_->InitializeMetricsEnabledStateOnUIThread(); |
| 179 if (io_data_->domain_reliability_monitor_) | 163 if (io_data_->domain_reliability_monitor_) |
| 180 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); | 164 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); |
| 181 | 165 |
| 182 io_data_->set_data_reduction_proxy_unavailable_callback( | 166 io_data_->set_data_reduction_proxy_io_data( |
| 183 data_reduction_proxy_unavailable); | 167 data_reduction_proxy_io_data.Pass()); |
| 184 io_data_->set_data_reduction_proxy_configurator( | |
| 185 data_reduction_proxy_configurator.Pass()); | |
| 186 io_data_->set_data_reduction_proxy_params(data_reduction_proxy_params.Pass()); | |
| 187 io_data_->set_data_reduction_proxy_statistics_prefs( | |
| 188 data_reduction_proxy_statistics_prefs.Pass()); | |
| 189 io_data_->set_data_reduction_proxy_event_store( | |
| 190 data_reduction_proxy_event_store.Pass()); | |
| 191 } | 168 } |
| 192 | 169 |
| 193 content::ResourceContext* | 170 content::ResourceContext* |
| 194 ProfileImplIOData::Handle::GetResourceContext() const { | 171 ProfileImplIOData::Handle::GetResourceContext() const { |
| 195 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 172 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 196 LazyInitialize(); | 173 LazyInitialize(); |
| 197 return GetResourceContextNoInit(); | 174 return GetResourceContextNoInit(); |
| 198 } | 175 } |
| 199 | 176 |
| 200 content::ResourceContext* | 177 content::ResourceContext* |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 360 io_data_->session_startup_pref()->Init( | 337 io_data_->session_startup_pref()->Init( |
| 361 prefs::kRestoreOnStartup, pref_service); | 338 prefs::kRestoreOnStartup, pref_service); |
| 362 io_data_->session_startup_pref()->MoveToThread( | 339 io_data_->session_startup_pref()->MoveToThread( |
| 363 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 340 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 364 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) | 341 #if defined(FULL_SAFE_BROWSING) || defined(MOBILE_SAFE_BROWSING) |
| 365 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled, | 342 io_data_->safe_browsing_enabled()->Init(prefs::kSafeBrowsingEnabled, |
| 366 pref_service); | 343 pref_service); |
| 367 io_data_->safe_browsing_enabled()->MoveToThread( | 344 io_data_->safe_browsing_enabled()->MoveToThread( |
| 368 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 345 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 369 #endif | 346 #endif |
| 370 io_data_->data_reduction_proxy_enabled_.Init( | 347 io_data_->data_reduction_proxy_io_data()->InitPrefsOnUIThread( |
| 371 data_reduction_proxy::prefs::kDataReductionProxyEnabled, pref_service); | 348 pref_service, |
| 372 io_data_->data_reduction_proxy_enabled_.MoveToThread( | |
| 373 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 349 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
| 374 io_data_->InitializeOnUIThread(profile_); | 350 io_data_->InitializeOnUIThread(profile_); |
| 375 } | 351 } |
| 376 | 352 |
| 377 scoped_ptr<ProfileIOData::ChromeURLRequestContextGetterVector> | 353 scoped_ptr<ProfileIOData::ChromeURLRequestContextGetterVector> |
| 378 ProfileImplIOData::Handle::GetAllContextGetters() { | 354 ProfileImplIOData::Handle::GetAllContextGetters() { |
| 379 ChromeURLRequestContextGetterMap::iterator iter; | 355 ChromeURLRequestContextGetterMap::iterator iter; |
| 380 scoped_ptr<ChromeURLRequestContextGetterVector> context_getters( | 356 scoped_ptr<ChromeURLRequestContextGetterVector> context_getters( |
| 381 new ChromeURLRequestContextGetterVector()); | 357 new ChromeURLRequestContextGetterVector()); |
| 382 | 358 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 451 monitor->AddBakedInConfigs(); | 427 monitor->AddBakedInConfigs(); |
| 452 monitor->SetDiscardUploads(!GetMetricsEnabledStateOnIOThread()); | 428 monitor->SetDiscardUploads(!GetMetricsEnabledStateOnIOThread()); |
| 453 chrome_network_delegate->set_domain_reliability_monitor(monitor); | 429 chrome_network_delegate->set_domain_reliability_monitor(monitor); |
| 454 } | 430 } |
| 455 | 431 |
| 456 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | 432 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. |
| 457 tracked_objects::ScopedTracker tracking_profile2( | 433 tracked_objects::ScopedTracker tracking_profile2( |
| 458 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 434 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 459 "436671 ProfileImplIOData::InitializeInternal2")); | 435 "436671 ProfileImplIOData::InitializeInternal2")); |
| 460 | 436 |
| 461 set_data_reduction_proxy_auth_request_handler( | |
| 462 scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler> | |
| 463 (new data_reduction_proxy::DataReductionProxyAuthRequestHandler( | |
| 464 DataReductionProxyChromeSettings::GetClient(), | |
| 465 data_reduction_proxy_params(), | |
| 466 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)))); | |
| 467 set_data_reduction_proxy_usage_stats( | |
| 468 scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats> | |
| 469 (new data_reduction_proxy::DataReductionProxyUsageStats( | |
| 470 data_reduction_proxy_params(), | |
| 471 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI) | |
| 472 .get()))); | |
| 473 data_reduction_proxy_usage_stats()->set_unavailable_callback( | |
| 474 data_reduction_proxy_unavailable_callback()); | |
| 475 | |
| 476 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | |
| 477 tracked_objects::ScopedTracker tracking_profile3( | |
| 478 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
| 479 "436671 ProfileImplIOData::InitializeInternal3")); | |
| 480 | |
| 481 scoped_ptr<data_reduction_proxy::DataReductionProxyNetworkDelegate> | |
| 482 data_reduction_proxy_network_delegate( | |
| 483 new data_reduction_proxy::DataReductionProxyNetworkDelegate( | |
| 484 chrome_network_delegate.Pass(), | |
| 485 data_reduction_proxy_params(), | |
| 486 data_reduction_proxy_auth_request_handler(), | |
| 487 base::Bind( | |
| 488 &data_reduction_proxy::DataReductionProxyConfigurator:: | |
| 489 GetProxyConfigOnIOThread, | |
| 490 base::Unretained(data_reduction_proxy_configurator())))); | |
| 491 data_reduction_proxy_network_delegate->InitProxyConfigOverrider( | |
| 492 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); | |
| 493 data_reduction_proxy_network_delegate->InitStatisticsPrefsAndUMA( | |
| 494 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | |
| 495 data_reduction_proxy_statistics_prefs(), | |
| 496 &data_reduction_proxy_enabled_, | |
| 497 data_reduction_proxy_usage_stats()); | |
| 498 network_delegate_ = data_reduction_proxy_network_delegate.Pass(); | |
| 499 | |
| 500 // Initialize context members. | |
| 501 | |
| 502 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | |
| 503 tracked_objects::ScopedTracker tracking_profile4( | |
| 504 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
| 505 "436671 ProfileImplIOData::InitializeInternal4")); | |
| 506 | |
| 507 ApplyProfileParamsToContext(main_context); | 437 ApplyProfileParamsToContext(main_context); |
| 508 | 438 |
| 509 if (http_server_properties_manager_) | 439 if (http_server_properties_manager_) |
| 510 http_server_properties_manager_->InitializeOnNetworkThread(); | 440 http_server_properties_manager_->InitializeOnNetworkThread(); |
| 511 | 441 |
| 512 main_context->set_transport_security_state(transport_security_state()); | 442 main_context->set_transport_security_state(transport_security_state()); |
| 513 | 443 |
| 514 main_context->set_net_log(io_thread->net_log()); | 444 main_context->set_net_log(io_thread->net_log()); |
| 515 | 445 |
| 446 network_delegate_ = data_reduction_proxy_io_data()->CreateNetworkDelegate( | |
| 447 chrome_network_delegate.Pass(), true).Pass(); | |
| 448 | |
| 516 main_context->set_network_delegate(network_delegate_.get()); | 449 main_context->set_network_delegate(network_delegate_.get()); |
| 517 | 450 |
| 518 main_context->set_http_server_properties(http_server_properties()); | 451 main_context->set_http_server_properties(http_server_properties()); |
| 519 | 452 |
| 520 main_context->set_host_resolver( | 453 main_context->set_host_resolver( |
| 521 io_thread_globals->host_resolver.get()); | 454 io_thread_globals->host_resolver.get()); |
| 522 main_context->set_cert_transparency_verifier( | 455 main_context->set_cert_transparency_verifier( |
| 523 io_thread_globals->cert_transparency_verifier.get()); | 456 io_thread_globals->cert_transparency_verifier.get()); |
| 524 main_context->set_http_auth_handler_factory( | 457 main_context->set_http_auth_handler_factory( |
| 525 io_thread_globals->http_auth_handler_factory.get()); | 458 io_thread_globals->http_auth_handler_factory.get()); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 633 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 566 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 634 "436671 ProfileImplIOData::InitializeInternal8")); | 567 "436671 ProfileImplIOData::InitializeInternal8")); |
| 635 | 568 |
| 636 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 569 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( |
| 637 new net::URLRequestJobFactoryImpl()); | 570 new net::URLRequestJobFactoryImpl()); |
| 638 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 571 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
| 639 // The data reduction proxy interceptor should be as close to the network | 572 // The data reduction proxy interceptor should be as close to the network |
| 640 // as possible. | 573 // as possible. |
| 641 request_interceptors.insert( | 574 request_interceptors.insert( |
| 642 request_interceptors.begin(), | 575 request_interceptors.begin(), |
| 643 new data_reduction_proxy::DataReductionProxyInterceptor( | 576 data_reduction_proxy_io_data()->CreateInterceptor()); |
| 644 data_reduction_proxy_params(), | |
| 645 data_reduction_proxy_usage_stats(), | |
| 646 data_reduction_proxy_event_store())); | |
| 647 main_job_factory_ = SetUpJobFactoryDefaults( | 577 main_job_factory_ = SetUpJobFactoryDefaults( |
| 648 main_job_factory.Pass(), | 578 main_job_factory.Pass(), |
| 649 request_interceptors.Pass(), | 579 request_interceptors.Pass(), |
| 650 profile_params->protocol_handler_interceptor.Pass(), | 580 profile_params->protocol_handler_interceptor.Pass(), |
| 651 main_context->network_delegate(), | 581 main_context->network_delegate(), |
| 652 ftp_factory_.get()); | 582 ftp_factory_.get()); |
| 653 main_context->set_job_factory(main_job_factory_.get()); | 583 main_context->set_job_factory(main_job_factory_.get()); |
| 654 | 584 |
| 655 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | 585 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. |
| 656 tracked_objects::ScopedTracker tracking_profile9( | 586 tracked_objects::ScopedTracker tracking_profile9( |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 790 context->SetCookieStore(cookie_store.get()); | 720 context->SetCookieStore(cookie_store.get()); |
| 791 context->SetHttpTransactionFactory(app_http_cache.Pass()); | 721 context->SetHttpTransactionFactory(app_http_cache.Pass()); |
| 792 | 722 |
| 793 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 723 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
| 794 new net::URLRequestJobFactoryImpl()); | 724 new net::URLRequestJobFactoryImpl()); |
| 795 InstallProtocolHandlers(job_factory.get(), protocol_handlers); | 725 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
| 796 // The data reduction proxy interceptor should be as close to the network | 726 // The data reduction proxy interceptor should be as close to the network |
| 797 // as possible. | 727 // as possible. |
| 798 request_interceptors.insert( | 728 request_interceptors.insert( |
| 799 request_interceptors.begin(), | 729 request_interceptors.begin(), |
| 800 new data_reduction_proxy::DataReductionProxyInterceptor( | 730 data_reduction_proxy_io_data()->CreateInterceptor()); |
| 801 data_reduction_proxy_params(), | |
| 802 data_reduction_proxy_usage_stats(), | |
| 803 data_reduction_proxy_event_store())); | |
| 804 scoped_ptr<net::URLRequestJobFactory> top_job_factory( | 731 scoped_ptr<net::URLRequestJobFactory> top_job_factory( |
| 805 SetUpJobFactoryDefaults(job_factory.Pass(), | 732 SetUpJobFactoryDefaults(job_factory.Pass(), |
| 806 request_interceptors.Pass(), | 733 request_interceptors.Pass(), |
| 807 protocol_handler_interceptor.Pass(), | 734 protocol_handler_interceptor.Pass(), |
| 808 main_context->network_delegate(), | 735 main_context->network_delegate(), |
| 809 ftp_factory_.get())); | 736 ftp_factory_.get())); |
| 810 context->SetJobFactory(top_job_factory.Pass()); | 737 context->SetJobFactory(top_job_factory.Pass()); |
| 811 | 738 |
| 812 return context; | 739 return context; |
| 813 } | 740 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 903 const base::Closure& completion) { | 830 const base::Closure& completion) { |
| 904 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 831 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 905 DCHECK(initialized()); | 832 DCHECK(initialized()); |
| 906 | 833 |
| 907 DCHECK(transport_security_state()); | 834 DCHECK(transport_security_state()); |
| 908 // Completes synchronously. | 835 // Completes synchronously. |
| 909 transport_security_state()->DeleteAllDynamicDataSince(time); | 836 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 910 DCHECK(http_server_properties_manager_); | 837 DCHECK(http_server_properties_manager_); |
| 911 http_server_properties_manager_->Clear(completion); | 838 http_server_properties_manager_->Clear(completion); |
| 912 } | 839 } |
| 913 | |
| 914 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { | |
| 915 return data_reduction_proxy_enabled_.GetValue() || | |
| 916 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 917 data_reduction_proxy::switches::kEnableDataReductionProxy); | |
| 918 } | |
| OLD | NEW |