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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 } | 428 } |
429 | 429 |
430 IOThread::Globals:: | 430 IOThread::Globals:: |
431 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { | 431 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { |
432 if (globals_->system_request_context.get()) | 432 if (globals_->system_request_context.get()) |
433 globals_->system_request_context->AssertNoURLRequests(); | 433 globals_->system_request_context->AssertNoURLRequests(); |
434 } | 434 } |
435 | 435 |
436 IOThread::Globals::Globals() | 436 IOThread::Globals::Globals() |
437 : system_request_context_leak_checker(this), | 437 : system_request_context_leak_checker(this), |
438 enable_ssl_connect_job_waiting(false), | |
439 ignore_certificate_errors(false), | 438 ignore_certificate_errors(false), |
440 use_stale_while_revalidate(false), | 439 use_stale_while_revalidate(false), |
441 testing_fixed_http_port(0), | 440 testing_fixed_http_port(0), |
442 testing_fixed_https_port(0), | 441 testing_fixed_https_port(0), |
443 enable_user_alternate_protocol_ports(false) { | 442 enable_user_alternate_protocol_ports(false) { |
444 } | 443 } |
445 | 444 |
446 IOThread::Globals::~Globals() {} | 445 IOThread::Globals::~Globals() {} |
447 | 446 |
448 // |local_state| is passed in explicitly in order to (1) reduce implicit | 447 // |local_state| is passed in explicitly in order to (1) reduce implicit |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); | 662 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); |
664 globals_->host_mapping_rules.reset(new net::HostMappingRules()); | 663 globals_->host_mapping_rules.reset(new net::HostMappingRules()); |
665 globals_->http_user_agent_settings.reset( | 664 globals_->http_user_agent_settings.reset( |
666 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); | 665 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); |
667 if (command_line.HasSwitch(switches::kHostRules)) { | 666 if (command_line.HasSwitch(switches::kHostRules)) { |
668 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); | 667 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); |
669 globals_->host_mapping_rules->SetRulesFromString( | 668 globals_->host_mapping_rules->SetRulesFromString( |
670 command_line.GetSwitchValueASCII(switches::kHostRules)); | 669 command_line.GetSwitchValueASCII(switches::kHostRules)); |
671 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); | 670 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); |
672 } | 671 } |
673 if (command_line.HasSwitch(switches::kEnableSSLConnectJobWaiting)) | |
674 globals_->enable_ssl_connect_job_waiting = true; | |
675 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) | 672 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) |
676 globals_->ignore_certificate_errors = true; | 673 globals_->ignore_certificate_errors = true; |
677 globals_->use_stale_while_revalidate = | 674 globals_->use_stale_while_revalidate = |
678 IsStaleWhileRevalidateEnabled(command_line); | 675 IsStaleWhileRevalidateEnabled(command_line); |
679 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { | 676 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { |
680 globals_->testing_fixed_http_port = | 677 globals_->testing_fixed_http_port = |
681 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort); | 678 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort); |
682 } | 679 } |
683 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { | 680 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { |
684 globals_->testing_fixed_https_port = | 681 globals_->testing_fixed_https_port = |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 params->cert_verifier = globals.cert_verifier.get(); | 1001 params->cert_verifier = globals.cert_verifier.get(); |
1005 params->cert_policy_enforcer = globals.cert_policy_enforcer.get(); | 1002 params->cert_policy_enforcer = globals.cert_policy_enforcer.get(); |
1006 params->channel_id_service = globals.system_channel_id_service.get(); | 1003 params->channel_id_service = globals.system_channel_id_service.get(); |
1007 params->transport_security_state = globals.transport_security_state.get(); | 1004 params->transport_security_state = globals.transport_security_state.get(); |
1008 params->ssl_config_service = globals.ssl_config_service.get(); | 1005 params->ssl_config_service = globals.ssl_config_service.get(); |
1009 params->http_auth_handler_factory = globals.http_auth_handler_factory.get(); | 1006 params->http_auth_handler_factory = globals.http_auth_handler_factory.get(); |
1010 params->http_server_properties = | 1007 params->http_server_properties = |
1011 globals.http_server_properties->GetWeakPtr(); | 1008 globals.http_server_properties->GetWeakPtr(); |
1012 params->network_delegate = globals.system_network_delegate.get(); | 1009 params->network_delegate = globals.system_network_delegate.get(); |
1013 params->host_mapping_rules = globals.host_mapping_rules.get(); | 1010 params->host_mapping_rules = globals.host_mapping_rules.get(); |
1014 params->enable_ssl_connect_job_waiting = | |
1015 globals.enable_ssl_connect_job_waiting; | |
1016 params->ignore_certificate_errors = globals.ignore_certificate_errors; | 1011 params->ignore_certificate_errors = globals.ignore_certificate_errors; |
1017 params->use_stale_while_revalidate = globals.use_stale_while_revalidate; | 1012 params->use_stale_while_revalidate = globals.use_stale_while_revalidate; |
1018 params->testing_fixed_http_port = globals.testing_fixed_http_port; | 1013 params->testing_fixed_http_port = globals.testing_fixed_http_port; |
1019 params->testing_fixed_https_port = globals.testing_fixed_https_port; | 1014 params->testing_fixed_https_port = globals.testing_fixed_https_port; |
1020 globals.enable_tcp_fast_open_for_ssl.CopyToIfSet( | 1015 globals.enable_tcp_fast_open_for_ssl.CopyToIfSet( |
1021 ¶ms->enable_tcp_fast_open_for_ssl); | 1016 ¶ms->enable_tcp_fast_open_for_ssl); |
1022 | 1017 |
1023 globals.initial_max_spdy_concurrent_streams.CopyToIfSet( | 1018 globals.initial_max_spdy_concurrent_streams.CopyToIfSet( |
1024 ¶ms->spdy_initial_max_concurrent_streams); | 1019 ¶ms->spdy_initial_max_concurrent_streams); |
1025 globals.force_spdy_single_domain.CopyToIfSet( | 1020 globals.force_spdy_single_domain.CopyToIfSet( |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1436 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1442 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1437 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1443 net::QuicVersion version = supported_versions[i]; | 1438 net::QuicVersion version = supported_versions[i]; |
1444 if (net::QuicVersionToString(version) == quic_version) { | 1439 if (net::QuicVersionToString(version) == quic_version) { |
1445 return version; | 1440 return version; |
1446 } | 1441 } |
1447 } | 1442 } |
1448 | 1443 |
1449 return net::QUIC_VERSION_UNSUPPORTED; | 1444 return net::QUIC_VERSION_UNSUPPORTED; |
1450 } | 1445 } |
OLD | NEW |