| 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/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 | 642 |
| 643 globals_->ssl_config_service = GetSSLConfigService(); | 643 globals_->ssl_config_service = GetSSLConfigService(); |
| 644 | 644 |
| 645 CreateDefaultAuthHandlerFactory(); | 645 CreateDefaultAuthHandlerFactory(); |
| 646 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); | 646 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); |
| 647 // For the ProxyScriptFetcher, we use a direct ProxyService. | 647 // For the ProxyScriptFetcher, we use a direct ProxyService. |
| 648 globals_->proxy_script_fetcher_proxy_service = | 648 globals_->proxy_script_fetcher_proxy_service = |
| 649 net::ProxyService::CreateDirectWithNetLog(net_log_); | 649 net::ProxyService::CreateDirectWithNetLog(net_log_); |
| 650 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); | 650 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); |
| 651 globals_->host_mapping_rules.reset(new net::HostMappingRules()); | 651 globals_->host_mapping_rules.reset(new net::HostMappingRules()); |
| 652 params_.host_mapping_rules = globals_->host_mapping_rules.get(); | |
| 653 globals_->http_user_agent_settings.reset( | |
| 654 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); | |
| 655 if (command_line.HasSwitch(switches::kHostRules)) { | 652 if (command_line.HasSwitch(switches::kHostRules)) { |
| 656 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); | 653 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); |
| 657 globals_->host_mapping_rules->SetRulesFromString( | 654 globals_->host_mapping_rules->SetRulesFromString( |
| 658 command_line.GetSwitchValueASCII(switches::kHostRules)); | 655 command_line.GetSwitchValueASCII(switches::kHostRules)); |
| 659 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); | 656 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); |
| 660 } | 657 } |
| 658 params_.host_mapping_rules = *globals_->host_mapping_rules.get(); |
| 659 globals_->http_user_agent_settings.reset( |
| 660 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); |
| 661 globals_->enable_brotli = | 661 globals_->enable_brotli = |
| 662 base::FeatureList::IsEnabled(features::kBrotliEncoding); | 662 base::FeatureList::IsEnabled(features::kBrotliEncoding); |
| 663 params_.enable_token_binding = | 663 params_.enable_token_binding = |
| 664 base::FeatureList::IsEnabled(features::kTokenBinding); | 664 base::FeatureList::IsEnabled(features::kTokenBinding); |
| 665 | 665 |
| 666 // Check for OS support of TCP FastOpen, and turn it on for all connections if | 666 // Check for OS support of TCP FastOpen, and turn it on for all connections if |
| 667 // indicated by user. | 667 // indicated by user. |
| 668 // TODO(rch): Make the client socket factory a per-network session instance, | 668 // TODO(rch): Make the client socket factory a per-network session instance, |
| 669 // constructed from a NetworkSession::Params, to allow us to move this option | 669 // constructed from a NetworkSession::Params, to allow us to move this option |
| 670 // to IOThread::Globals & HttpNetworkSession::Params. | 670 // to IOThread::Globals & HttpNetworkSession::Params. |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 | 1099 |
| 1100 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1100 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1101 // system URLRequestContext too. There's no reason this should be tied to a | 1101 // system URLRequestContext too. There's no reason this should be tied to a |
| 1102 // profile. | 1102 // profile. |
| 1103 return context; | 1103 return context; |
| 1104 } | 1104 } |
| 1105 | 1105 |
| 1106 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { | 1106 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { |
| 1107 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); | 1107 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); |
| 1108 } | 1108 } |
| OLD | NEW |