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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "chrome/browser/net/predictor.h" | 31 #include "chrome/browser/net/predictor.h" |
32 #include "chrome/browser/net/quota_policy_channel_id_store.h" | 32 #include "chrome/browser/net/quota_policy_channel_id_store.h" |
33 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" | 33 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" |
34 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 34 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
35 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 35 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
36 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
37 #include "chrome/common/chrome_constants.h" | 37 #include "chrome/common/chrome_constants.h" |
38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
40 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
igurator.h" | |
42 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
43 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" | |
44 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 42 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
45 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_stat
istics_prefs.h" | |
46 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" | |
47 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" | |
48 #include "components/domain_reliability/monitor.h" | 43 #include "components/domain_reliability/monitor.h" |
49 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
50 #include "content/public/browser/cookie_store_factory.h" | 45 #include "content/public/browser/cookie_store_factory.h" |
51 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
52 #include "content/public/browser/resource_context.h" | 47 #include "content/public/browser/resource_context.h" |
53 #include "content/public/browser/storage_partition.h" | 48 #include "content/public/browser/storage_partition.h" |
54 #include "extensions/browser/extension_protocols.h" | 49 #include "extensions/browser/extension_protocols.h" |
55 #include "extensions/common/constants.h" | 50 #include "extensions/common/constants.h" |
56 #include "net/base/cache_type.h" | 51 #include "net/base/cache_type.h" |
57 #include "net/base/sdch_manager.h" | 52 #include "net/base/sdch_manager.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 io_data_->app_cache_max_size_ = cache_max_size; | 158 io_data_->app_cache_max_size_ = cache_max_size; |
164 io_data_->app_media_cache_max_size_ = media_cache_max_size; | 159 io_data_->app_media_cache_max_size_ = media_cache_max_size; |
165 | 160 |
166 io_data_->predictor_.reset(predictor); | 161 io_data_->predictor_.reset(predictor); |
167 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); | 162 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); |
168 | 163 |
169 io_data_->InitializeMetricsEnabledStateOnUIThread(); | 164 io_data_->InitializeMetricsEnabledStateOnUIThread(); |
170 if (io_data_->domain_reliability_monitor_) | 165 if (io_data_->domain_reliability_monitor_) |
171 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); | 166 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); |
172 | 167 |
173 ChromeNetLog* const net_log = g_browser_process->io_thread()->net_log(); | |
174 | |
175 io_data_->set_data_reduction_proxy_io_data( | 168 io_data_->set_data_reduction_proxy_io_data( |
176 CreateDataReductionProxyChromeIOData( | 169 CreateDataReductionProxyChromeIOData( |
177 net_log, profile_, profile_->GetPrefs(), | 170 g_browser_process->io_thread()->net_log(), profile_->GetPrefs(), |
178 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 171 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
179 BrowserThread::GetMessageLoopProxyForThread( | 172 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)) |
180 BrowserThread::UI)).Pass()); | 173 .Pass()); |
181 | 174 |
182 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)-> | 175 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)-> |
183 InitDataReductionProxySettings(io_data_->data_reduction_proxy_io_data(), | 176 InitDataReductionProxySettings( |
184 profile_->GetPrefs(), | 177 io_data_->data_reduction_proxy_io_data(), profile_->GetPrefs(), |
185 g_browser_process->local_state(), | 178 profile_->GetRequestContext(), |
186 profile_->GetRequestContext()); | 179 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)); |
187 } | 180 } |
188 | 181 |
189 content::ResourceContext* | 182 content::ResourceContext* |
190 ProfileImplIOData::Handle::GetResourceContext() const { | 183 ProfileImplIOData::Handle::GetResourceContext() const { |
191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
192 LazyInitialize(); | 185 LazyInitialize(); |
193 return GetResourceContextNoInit(); | 186 return GetResourceContextNoInit(); |
194 } | 187 } |
195 | 188 |
196 content::ResourceContext* | 189 content::ResourceContext* |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 445 |
453 ApplyProfileParamsToContext(main_context); | 446 ApplyProfileParamsToContext(main_context); |
454 | 447 |
455 if (http_server_properties_manager_) | 448 if (http_server_properties_manager_) |
456 http_server_properties_manager_->InitializeOnNetworkThread(); | 449 http_server_properties_manager_->InitializeOnNetworkThread(); |
457 | 450 |
458 main_context->set_transport_security_state(transport_security_state()); | 451 main_context->set_transport_security_state(transport_security_state()); |
459 | 452 |
460 main_context->set_net_log(io_thread->net_log()); | 453 main_context->set_net_log(io_thread->net_log()); |
461 | 454 |
462 data_reduction_proxy_io_data()->Init(); | |
463 | |
464 network_delegate_ = data_reduction_proxy_io_data()->CreateNetworkDelegate( | 455 network_delegate_ = data_reduction_proxy_io_data()->CreateNetworkDelegate( |
465 chrome_network_delegate.Pass(), true).Pass(); | 456 chrome_network_delegate.Pass(), true).Pass(); |
466 | 457 |
467 main_context->set_network_delegate(network_delegate_.get()); | 458 main_context->set_network_delegate(network_delegate_.get()); |
468 | 459 |
469 main_context->set_http_server_properties(http_server_properties()); | 460 main_context->set_http_server_properties(http_server_properties()); |
470 | 461 |
471 main_context->set_host_resolver( | 462 main_context->set_host_resolver( |
472 io_thread_globals->host_resolver.get()); | 463 io_thread_globals->host_resolver.get()); |
473 main_context->set_cert_transparency_verifier( | 464 main_context->set_cert_transparency_verifier( |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 const base::Closure& completion) { | 840 const base::Closure& completion) { |
850 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 841 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
851 DCHECK(initialized()); | 842 DCHECK(initialized()); |
852 | 843 |
853 DCHECK(transport_security_state()); | 844 DCHECK(transport_security_state()); |
854 // Completes synchronously. | 845 // Completes synchronously. |
855 transport_security_state()->DeleteAllDynamicDataSince(time); | 846 transport_security_state()->DeleteAllDynamicDataSince(time); |
856 DCHECK(http_server_properties_manager_); | 847 DCHECK(http_server_properties_manager_); |
857 http_server_properties_manager_->Clear(completion); | 848 http_server_properties_manager_->Clear(completion); |
858 } | 849 } |
OLD | NEW |