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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 ChromeNetLog* const net_log = g_browser_process->io_thread()->net_log(); | 173 ChromeNetLog* const net_log = g_browser_process->io_thread()->net_log(); |
174 | 174 |
175 io_data_->set_data_reduction_proxy_io_data( | 175 io_data_->set_data_reduction_proxy_io_data( |
176 CreateDataReductionProxyChromeIOData( | 176 CreateDataReductionProxyChromeIOData( |
177 net_log, profile_, profile_->GetPrefs(), | 177 net_log, profile_, profile_->GetPrefs(), |
178 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 178 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
179 BrowserThread::GetMessageLoopProxyForThread( | 179 BrowserThread::GetMessageLoopProxyForThread( |
180 BrowserThread::UI)).Pass()); | 180 BrowserThread::UI)).Pass()); |
181 | 181 |
| 182 io_data_->data_reduction_proxy_io_data()->Initialize( |
| 183 profile_->GetRequestContext()); |
182 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)-> | 184 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)-> |
183 InitDataReductionProxySettings(io_data_->data_reduction_proxy_io_data(), | 185 InitDataReductionProxySettings(io_data_->data_reduction_proxy_io_data(), |
184 profile_->GetPrefs(), | 186 profile_->GetPrefs()); |
185 g_browser_process->local_state(), | |
186 profile_->GetRequestContext()); | |
187 } | 187 } |
188 | 188 |
189 content::ResourceContext* | 189 content::ResourceContext* |
190 ProfileImplIOData::Handle::GetResourceContext() const { | 190 ProfileImplIOData::Handle::GetResourceContext() const { |
191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
192 LazyInitialize(); | 192 LazyInitialize(); |
193 return GetResourceContextNoInit(); | 193 return GetResourceContextNoInit(); |
194 } | 194 } |
195 | 195 |
196 content::ResourceContext* | 196 content::ResourceContext* |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 #endif // !defined(DISABLE_FTP_SUPPORT) | 578 #endif // !defined(DISABLE_FTP_SUPPORT) |
579 | 579 |
580 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | 580 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. |
581 tracked_objects::ScopedTracker tracking_profile8( | 581 tracked_objects::ScopedTracker tracking_profile8( |
582 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 582 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
583 "436671 ProfileImplIOData::InitializeInternal8")); | 583 "436671 ProfileImplIOData::InitializeInternal8")); |
584 | 584 |
585 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 585 scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory( |
586 new net::URLRequestJobFactoryImpl()); | 586 new net::URLRequestJobFactoryImpl()); |
587 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 587 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
588 | |
589 // The data reduction proxy interceptor should be as close to the network | 588 // The data reduction proxy interceptor should be as close to the network |
590 // as possible. | 589 // as possible. |
591 request_interceptors.insert( | 590 request_interceptors.insert( |
592 request_interceptors.begin(), | 591 request_interceptors.begin(), |
593 data_reduction_proxy_io_data()->CreateInterceptor().release()); | 592 data_reduction_proxy_io_data()->CreateInterceptor().release()); |
594 main_job_factory_ = SetUpJobFactoryDefaults( | 593 main_job_factory_ = SetUpJobFactoryDefaults( |
595 main_job_factory.Pass(), | 594 main_job_factory.Pass(), |
596 request_interceptors.Pass(), | 595 request_interceptors.Pass(), |
597 profile_params->protocol_handler_interceptor.Pass(), | 596 profile_params->protocol_handler_interceptor.Pass(), |
598 main_context->network_delegate(), | 597 main_context->network_delegate(), |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 const base::Closure& completion) { | 846 const base::Closure& completion) { |
848 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 847 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
849 DCHECK(initialized()); | 848 DCHECK(initialized()); |
850 | 849 |
851 DCHECK(transport_security_state()); | 850 DCHECK(transport_security_state()); |
852 // Completes synchronously. | 851 // Completes synchronously. |
853 transport_security_state()->DeleteAllDynamicDataSince(time); | 852 transport_security_state()->DeleteAllDynamicDataSince(time); |
854 DCHECK(http_server_properties_manager_); | 853 DCHECK(http_server_properties_manager_); |
855 http_server_properties_manager_->Clear(completion); | 854 http_server_properties_manager_->Clear(completion); |
856 } | 855 } |
OLD | NEW |