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( | 420 data_reduction_proxy_io_data()->Init( |
446 scoped_ptr<data_reduction_proxy::DataReductionProxyAuthRequestHandler> | 421 chrome_network_delegate.Pass(), |
447 (new data_reduction_proxy::DataReductionProxyAuthRequestHandler( | 422 true, true, false); |
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 | 423 |
478 // Initialize context members. | 424 // Initialize context members. |
479 | 425 |
480 ApplyProfileParamsToContext(main_context); | 426 ApplyProfileParamsToContext(main_context); |
481 | 427 |
482 if (http_server_properties_manager_) | 428 if (http_server_properties_manager_) |
483 http_server_properties_manager_->InitializeOnNetworkThread(); | 429 http_server_properties_manager_->InitializeOnNetworkThread(); |
484 | 430 |
485 main_context->set_transport_security_state(transport_security_state()); | 431 main_context->set_transport_security_state(transport_security_state()); |
486 | 432 |
487 main_context->set_net_log(io_thread->net_log()); | 433 main_context->set_net_log(io_thread->net_log()); |
488 | 434 |
489 main_context->set_network_delegate(network_delegate_.get()); | 435 main_context->set_network_delegate( |
| 436 data_reduction_proxy_io_data()->network_delegate()); |
490 | 437 |
491 main_context->set_http_server_properties(http_server_properties()); | 438 main_context->set_http_server_properties(http_server_properties()); |
492 | 439 |
493 main_context->set_host_resolver( | 440 main_context->set_host_resolver( |
494 io_thread_globals->host_resolver.get()); | 441 io_thread_globals->host_resolver.get()); |
495 main_context->set_cert_transparency_verifier( | 442 main_context->set_cert_transparency_verifier( |
496 io_thread_globals->cert_transparency_verifier.get()); | 443 io_thread_globals->cert_transparency_verifier.get()); |
497 main_context->set_http_auth_handler_factory( | 444 main_context->set_http_auth_handler_factory( |
498 io_thread_globals->http_auth_handler_factory.get()); | 445 io_thread_globals->http_auth_handler_factory.get()); |
499 | 446 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 528 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
582 #endif // !defined(DISABLE_FTP_SUPPORT) | 529 #endif // !defined(DISABLE_FTP_SUPPORT) |
583 | 530 |
584 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 531 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( |
585 new net::URLRequestJobFactoryImpl()); | 532 new net::URLRequestJobFactoryImpl()); |
586 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 533 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
587 // The data reduction proxy interceptor should be as close to the network | 534 // The data reduction proxy interceptor should be as close to the network |
588 // as possible. | 535 // as possible. |
589 request_interceptors.insert( | 536 request_interceptors.insert( |
590 request_interceptors.begin(), | 537 request_interceptors.begin(), |
591 new data_reduction_proxy::DataReductionProxyInterceptor( | 538 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( | 539 main_job_factory_ = SetUpJobFactoryDefaults( |
596 main_job_factory.Pass(), | 540 main_job_factory.Pass(), |
597 request_interceptors.Pass(), | 541 request_interceptors.Pass(), |
598 profile_params->protocol_handler_interceptor.Pass(), | 542 profile_params->protocol_handler_interceptor.Pass(), |
599 main_context->network_delegate(), | 543 main_context->network_delegate(), |
600 ftp_factory_.get()); | 544 ftp_factory_.get()); |
601 main_context->set_job_factory(main_job_factory_.get()); | 545 main_context->set_job_factory(main_job_factory_.get()); |
602 | 546 |
603 #if defined(ENABLE_EXTENSIONS) | 547 #if defined(ENABLE_EXTENSIONS) |
604 InitializeExtensionsRequestContext(profile_params); | 548 InitializeExtensionsRequestContext(profile_params); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 context->SetCookieStore(cookie_store.get()); | 677 context->SetCookieStore(cookie_store.get()); |
734 context->SetHttpTransactionFactory(app_http_cache.Pass()); | 678 context->SetHttpTransactionFactory(app_http_cache.Pass()); |
735 | 679 |
736 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( | 680 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
737 new net::URLRequestJobFactoryImpl()); | 681 new net::URLRequestJobFactoryImpl()); |
738 InstallProtocolHandlers(job_factory.get(), protocol_handlers); | 682 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
739 // The data reduction proxy interceptor should be as close to the network | 683 // The data reduction proxy interceptor should be as close to the network |
740 // as possible. | 684 // as possible. |
741 request_interceptors.insert( | 685 request_interceptors.insert( |
742 request_interceptors.begin(), | 686 request_interceptors.begin(), |
743 new data_reduction_proxy::DataReductionProxyInterceptor( | 687 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( | 688 scoped_ptr<net::URLRequestJobFactory> top_job_factory( |
748 SetUpJobFactoryDefaults(job_factory.Pass(), | 689 SetUpJobFactoryDefaults(job_factory.Pass(), |
749 request_interceptors.Pass(), | 690 request_interceptors.Pass(), |
750 protocol_handler_interceptor.Pass(), | 691 protocol_handler_interceptor.Pass(), |
751 main_context->network_delegate(), | 692 main_context->network_delegate(), |
752 ftp_factory_.get())); | 693 ftp_factory_.get())); |
753 context->SetJobFactory(top_job_factory.Pass()); | 694 context->SetJobFactory(top_job_factory.Pass()); |
754 | 695 |
755 return context; | 696 return context; |
756 } | 697 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 const base::Closure& completion) { | 787 const base::Closure& completion) { |
847 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 788 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
848 DCHECK(initialized()); | 789 DCHECK(initialized()); |
849 | 790 |
850 DCHECK(transport_security_state()); | 791 DCHECK(transport_security_state()); |
851 // Completes synchronously. | 792 // Completes synchronously. |
852 transport_security_state()->DeleteAllDynamicDataSince(time); | 793 transport_security_state()->DeleteAllDynamicDataSince(time); |
853 DCHECK(http_server_properties_manager_); | 794 DCHECK(http_server_properties_manager_); |
854 http_server_properties_manager_->Clear(completion); | 795 http_server_properties_manager_->Clear(completion); |
855 } | 796 } |
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 |