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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 } | 387 } |
388 | 388 |
389 IOThread::Globals:: | 389 IOThread::Globals:: |
390 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { | 390 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { |
391 if (globals_->system_request_context.get()) | 391 if (globals_->system_request_context.get()) |
392 globals_->system_request_context->AssertNoURLRequests(); | 392 globals_->system_request_context->AssertNoURLRequests(); |
393 } | 393 } |
394 | 394 |
395 IOThread::Globals::Globals() | 395 IOThread::Globals::Globals() |
396 : system_request_context_leak_checker(this), | 396 : system_request_context_leak_checker(this), |
| 397 enable_ssl_connect_job_waiting(false), |
397 ignore_certificate_errors(false), | 398 ignore_certificate_errors(false), |
398 testing_fixed_http_port(0), | 399 testing_fixed_http_port(0), |
399 testing_fixed_https_port(0), | 400 testing_fixed_https_port(0), |
400 enable_user_alternate_protocol_ports(false) { | 401 enable_user_alternate_protocol_ports(false) { |
401 } | 402 } |
402 | 403 |
403 IOThread::Globals::~Globals() {} | 404 IOThread::Globals::~Globals() {} |
404 | 405 |
405 // |local_state| is passed in explicitly in order to (1) reduce implicit | 406 // |local_state| is passed in explicitly in order to (1) reduce implicit |
406 // dependencies and (2) make IOThread more flexible for testing. | 407 // dependencies and (2) make IOThread more flexible for testing. |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); | 626 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); |
626 globals_->host_mapping_rules.reset(new net::HostMappingRules()); | 627 globals_->host_mapping_rules.reset(new net::HostMappingRules()); |
627 globals_->http_user_agent_settings.reset( | 628 globals_->http_user_agent_settings.reset( |
628 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); | 629 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); |
629 if (command_line.HasSwitch(switches::kHostRules)) { | 630 if (command_line.HasSwitch(switches::kHostRules)) { |
630 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); | 631 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); |
631 globals_->host_mapping_rules->SetRulesFromString( | 632 globals_->host_mapping_rules->SetRulesFromString( |
632 command_line.GetSwitchValueASCII(switches::kHostRules)); | 633 command_line.GetSwitchValueASCII(switches::kHostRules)); |
633 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); | 634 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); |
634 } | 635 } |
| 636 if (command_line.HasSwitch(switches::kEnableSSLConnectJobWaiting)) |
| 637 globals_->enable_ssl_connect_job_waiting = true; |
635 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) | 638 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) |
636 globals_->ignore_certificate_errors = true; | 639 globals_->ignore_certificate_errors = true; |
637 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { | 640 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { |
638 globals_->testing_fixed_http_port = | 641 globals_->testing_fixed_http_port = |
639 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort); | 642 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort); |
640 } | 643 } |
641 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { | 644 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { |
642 globals_->testing_fixed_https_port = | 645 globals_->testing_fixed_https_port = |
643 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort); | 646 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort); |
644 } | 647 } |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 params->cert_verifier = globals_->cert_verifier.get(); | 938 params->cert_verifier = globals_->cert_verifier.get(); |
936 params->server_bound_cert_service = | 939 params->server_bound_cert_service = |
937 globals_->system_server_bound_cert_service.get(); | 940 globals_->system_server_bound_cert_service.get(); |
938 params->transport_security_state = globals_->transport_security_state.get(); | 941 params->transport_security_state = globals_->transport_security_state.get(); |
939 params->ssl_config_service = globals_->ssl_config_service.get(); | 942 params->ssl_config_service = globals_->ssl_config_service.get(); |
940 params->http_auth_handler_factory = globals_->http_auth_handler_factory.get(); | 943 params->http_auth_handler_factory = globals_->http_auth_handler_factory.get(); |
941 params->http_server_properties = | 944 params->http_server_properties = |
942 globals_->http_server_properties->GetWeakPtr(); | 945 globals_->http_server_properties->GetWeakPtr(); |
943 params->network_delegate = globals_->system_network_delegate.get(); | 946 params->network_delegate = globals_->system_network_delegate.get(); |
944 params->host_mapping_rules = globals_->host_mapping_rules.get(); | 947 params->host_mapping_rules = globals_->host_mapping_rules.get(); |
| 948 params->enable_ssl_connect_job_waiting = |
| 949 globals_->enable_ssl_connect_job_waiting; |
945 params->ignore_certificate_errors = globals_->ignore_certificate_errors; | 950 params->ignore_certificate_errors = globals_->ignore_certificate_errors; |
946 params->testing_fixed_http_port = globals_->testing_fixed_http_port; | 951 params->testing_fixed_http_port = globals_->testing_fixed_http_port; |
947 params->testing_fixed_https_port = globals_->testing_fixed_https_port; | 952 params->testing_fixed_https_port = globals_->testing_fixed_https_port; |
948 | 953 |
949 globals_->initial_max_spdy_concurrent_streams.CopyToIfSet( | 954 globals_->initial_max_spdy_concurrent_streams.CopyToIfSet( |
950 ¶ms->spdy_initial_max_concurrent_streams); | 955 ¶ms->spdy_initial_max_concurrent_streams); |
951 globals_->force_spdy_single_domain.CopyToIfSet( | 956 globals_->force_spdy_single_domain.CopyToIfSet( |
952 ¶ms->force_spdy_single_domain); | 957 ¶ms->force_spdy_single_domain); |
953 globals_->enable_spdy_compression.CopyToIfSet( | 958 globals_->enable_spdy_compression.CopyToIfSet( |
954 ¶ms->enable_spdy_compression); | 959 ¶ms->enable_spdy_compression); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 std::string version_flag = | 1218 std::string version_flag = |
1214 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1219 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
1215 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1220 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1216 net::QuicVersion version = supported_versions[i]; | 1221 net::QuicVersion version = supported_versions[i]; |
1217 if (net::QuicVersionToString(version) == version_flag) { | 1222 if (net::QuicVersionToString(version) == version_flag) { |
1218 return version; | 1223 return version; |
1219 } | 1224 } |
1220 } | 1225 } |
1221 return net::QUIC_VERSION_UNSUPPORTED; | 1226 return net::QUIC_VERSION_UNSUPPORTED; |
1222 } | 1227 } |
OLD | NEW |