| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/leak_tracker.h" | 10 #include "base/debug/leak_tracker.h" |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 | 666 |
| 667 net::SSLConfigService* IOThread::GetSSLConfigService() { | 667 net::SSLConfigService* IOThread::GetSSLConfigService() { |
| 668 return ssl_config_service_manager_->Get(); | 668 return ssl_config_service_manager_->Get(); |
| 669 } | 669 } |
| 670 | 670 |
| 671 void IOThread::InitSystemRequestContext() { | 671 void IOThread::InitSystemRequestContext() { |
| 672 if (system_url_request_context_getter_) | 672 if (system_url_request_context_getter_) |
| 673 return; | 673 return; |
| 674 // If we're in unit_tests, IOThread may not be run. |
| 675 if (!message_loop()) |
| 676 return; |
| 674 system_proxy_config_service_.reset( | 677 system_proxy_config_service_.reset( |
| 675 ProxyServiceFactory::CreateProxyConfigService( | 678 ProxyServiceFactory::CreateProxyConfigService( |
| 676 pref_proxy_config_tracker_)); | 679 pref_proxy_config_tracker_)); |
| 677 system_url_request_context_getter_ = | 680 system_url_request_context_getter_ = |
| 678 new SystemURLRequestContextGetter(this); | 681 new SystemURLRequestContextGetter(this); |
| 679 message_loop()->PostTask( | 682 message_loop()->PostTask( |
| 680 FROM_HERE, | 683 FROM_HERE, |
| 681 NewRunnableMethod( | 684 NewRunnableMethod( |
| 682 this, | 685 this, |
| 683 &IOThread::InitSystemRequestContextOnIOThread)); | 686 &IOThread::InitSystemRequestContextOnIOThread)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 708 system_params.network_delegate = globals_->system_network_delegate.get(); | 711 system_params.network_delegate = globals_->system_network_delegate.get(); |
| 709 system_params.net_log = net_log_; | 712 system_params.net_log = net_log_; |
| 710 globals_->system_http_transaction_factory.reset( | 713 globals_->system_http_transaction_factory.reset( |
| 711 new net::HttpNetworkLayer( | 714 new net::HttpNetworkLayer( |
| 712 new net::HttpNetworkSession(system_params))); | 715 new net::HttpNetworkSession(system_params))); |
| 713 globals_->system_ftp_transaction_factory.reset( | 716 globals_->system_ftp_transaction_factory.reset( |
| 714 new net::FtpNetworkLayer(globals_->host_resolver.get())); | 717 new net::FtpNetworkLayer(globals_->host_resolver.get())); |
| 715 globals_->system_request_context = | 718 globals_->system_request_context = |
| 716 ConstructSystemRequestContext(globals_, net_log_); | 719 ConstructSystemRequestContext(globals_, net_log_); |
| 717 } | 720 } |
| OLD | NEW |