| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 } | 425 } |
| 426 | 426 |
| 427 IOThread::Globals:: | 427 IOThread::Globals:: |
| 428 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { | 428 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { |
| 429 if (globals_->system_request_context.get()) | 429 if (globals_->system_request_context.get()) |
| 430 globals_->system_request_context->AssertNoURLRequests(); | 430 globals_->system_request_context->AssertNoURLRequests(); |
| 431 } | 431 } |
| 432 | 432 |
| 433 IOThread::Globals::Globals() | 433 IOThread::Globals::Globals() |
| 434 : system_request_context_leak_checker(this), | 434 : system_request_context_leak_checker(this), |
| 435 enable_ssl_connect_job_waiting(false), |
| 435 ignore_certificate_errors(false), | 436 ignore_certificate_errors(false), |
| 436 testing_fixed_http_port(0), | 437 testing_fixed_http_port(0), |
| 437 testing_fixed_https_port(0), | 438 testing_fixed_https_port(0), |
| 438 enable_user_alternate_protocol_ports(false) { | 439 enable_user_alternate_protocol_ports(false) { |
| 439 } | 440 } |
| 440 | 441 |
| 441 IOThread::Globals::~Globals() {} | 442 IOThread::Globals::~Globals() {} |
| 442 | 443 |
| 443 // |local_state| is passed in explicitly in order to (1) reduce implicit | 444 // |local_state| is passed in explicitly in order to (1) reduce implicit |
| 444 // dependencies and (2) make IOThread more flexible for testing. | 445 // dependencies and (2) make IOThread more flexible for testing. |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); | 688 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); |
| 688 globals_->host_mapping_rules.reset(new net::HostMappingRules()); | 689 globals_->host_mapping_rules.reset(new net::HostMappingRules()); |
| 689 globals_->http_user_agent_settings.reset( | 690 globals_->http_user_agent_settings.reset( |
| 690 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); | 691 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); |
| 691 if (command_line.HasSwitch(switches::kHostRules)) { | 692 if (command_line.HasSwitch(switches::kHostRules)) { |
| 692 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); | 693 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); |
| 693 globals_->host_mapping_rules->SetRulesFromString( | 694 globals_->host_mapping_rules->SetRulesFromString( |
| 694 command_line.GetSwitchValueASCII(switches::kHostRules)); | 695 command_line.GetSwitchValueASCII(switches::kHostRules)); |
| 695 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); | 696 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); |
| 696 } | 697 } |
| 698 if (command_line.HasSwitch(switches::kEnableSSLConnectJobWaiting)) |
| 699 globals_->enable_ssl_connect_job_waiting = true; |
| 697 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) | 700 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) |
| 698 globals_->ignore_certificate_errors = true; | 701 globals_->ignore_certificate_errors = true; |
| 699 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { | 702 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { |
| 700 globals_->testing_fixed_http_port = | 703 globals_->testing_fixed_http_port = |
| 701 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort); | 704 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort); |
| 702 } | 705 } |
| 703 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { | 706 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { |
| 704 globals_->testing_fixed_https_port = | 707 globals_->testing_fixed_https_port = |
| 705 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort); | 708 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort); |
| 706 } | 709 } |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 params->host_resolver = globals.host_resolver.get(); | 1006 params->host_resolver = globals.host_resolver.get(); |
| 1004 params->cert_verifier = globals.cert_verifier.get(); | 1007 params->cert_verifier = globals.cert_verifier.get(); |
| 1005 params->channel_id_service = globals.system_channel_id_service.get(); | 1008 params->channel_id_service = globals.system_channel_id_service.get(); |
| 1006 params->transport_security_state = globals.transport_security_state.get(); | 1009 params->transport_security_state = globals.transport_security_state.get(); |
| 1007 params->ssl_config_service = globals.ssl_config_service.get(); | 1010 params->ssl_config_service = globals.ssl_config_service.get(); |
| 1008 params->http_auth_handler_factory = globals.http_auth_handler_factory.get(); | 1011 params->http_auth_handler_factory = globals.http_auth_handler_factory.get(); |
| 1009 params->http_server_properties = | 1012 params->http_server_properties = |
| 1010 globals.http_server_properties->GetWeakPtr(); | 1013 globals.http_server_properties->GetWeakPtr(); |
| 1011 params->network_delegate = globals.system_network_delegate.get(); | 1014 params->network_delegate = globals.system_network_delegate.get(); |
| 1012 params->host_mapping_rules = globals.host_mapping_rules.get(); | 1015 params->host_mapping_rules = globals.host_mapping_rules.get(); |
| 1016 params->enable_ssl_connect_job_waiting = |
| 1017 globals.enable_ssl_connect_job_waiting; |
| 1013 params->ignore_certificate_errors = globals.ignore_certificate_errors; | 1018 params->ignore_certificate_errors = globals.ignore_certificate_errors; |
| 1014 params->testing_fixed_http_port = globals.testing_fixed_http_port; | 1019 params->testing_fixed_http_port = globals.testing_fixed_http_port; |
| 1015 params->testing_fixed_https_port = globals.testing_fixed_https_port; | 1020 params->testing_fixed_https_port = globals.testing_fixed_https_port; |
| 1016 | 1021 |
| 1017 globals.initial_max_spdy_concurrent_streams.CopyToIfSet( | 1022 globals.initial_max_spdy_concurrent_streams.CopyToIfSet( |
| 1018 ¶ms->spdy_initial_max_concurrent_streams); | 1023 ¶ms->spdy_initial_max_concurrent_streams); |
| 1019 globals.force_spdy_single_domain.CopyToIfSet( | 1024 globals.force_spdy_single_domain.CopyToIfSet( |
| 1020 ¶ms->force_spdy_single_domain); | 1025 ¶ms->force_spdy_single_domain); |
| 1021 globals.enable_spdy_compression.CopyToIfSet( | 1026 globals.enable_spdy_compression.CopyToIfSet( |
| 1022 ¶ms->enable_spdy_compression); | 1027 ¶ms->enable_spdy_compression); |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1387 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1383 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1388 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1384 net::QuicVersion version = supported_versions[i]; | 1389 net::QuicVersion version = supported_versions[i]; |
| 1385 if (net::QuicVersionToString(version) == quic_version) { | 1390 if (net::QuicVersionToString(version) == quic_version) { |
| 1386 return version; | 1391 return version; |
| 1387 } | 1392 } |
| 1388 } | 1393 } |
| 1389 | 1394 |
| 1390 return net::QUIC_VERSION_UNSUPPORTED; | 1395 return net::QUIC_VERSION_UNSUPPORTED; |
| 1391 } | 1396 } |
| OLD | NEW |