Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: chrome/browser/io_thread.cc

Issue 353713005: Implements new, more robust design for communicating between SSLConnectJobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved tests back to ssl_client_socket_unittest.cc, fixed various other issues. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 } 424 }
425 425
426 IOThread::Globals:: 426 IOThread::Globals::
427 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { 427 SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() {
428 if (globals_->system_request_context.get()) 428 if (globals_->system_request_context.get())
429 globals_->system_request_context->AssertNoURLRequests(); 429 globals_->system_request_context->AssertNoURLRequests();
430 } 430 }
431 431
432 IOThread::Globals::Globals() 432 IOThread::Globals::Globals()
433 : system_request_context_leak_checker(this), 433 : system_request_context_leak_checker(this),
434 enable_ssl_connect_job_waiting(false),
434 ignore_certificate_errors(false), 435 ignore_certificate_errors(false),
435 testing_fixed_http_port(0), 436 testing_fixed_http_port(0),
436 testing_fixed_https_port(0), 437 testing_fixed_https_port(0),
437 enable_user_alternate_protocol_ports(false) { 438 enable_user_alternate_protocol_ports(false) {
438 } 439 }
439 440
440 IOThread::Globals::~Globals() {} 441 IOThread::Globals::~Globals() {}
441 442
442 // |local_state| is passed in explicitly in order to (1) reduce implicit 443 // |local_state| is passed in explicitly in order to (1) reduce implicit
443 // dependencies and (2) make IOThread more flexible for testing. 444 // dependencies and (2) make IOThread more flexible for testing.
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); 687 globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService());
687 globals_->host_mapping_rules.reset(new net::HostMappingRules()); 688 globals_->host_mapping_rules.reset(new net::HostMappingRules());
688 globals_->http_user_agent_settings.reset( 689 globals_->http_user_agent_settings.reset(
689 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); 690 new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent()));
690 if (command_line.HasSwitch(switches::kHostRules)) { 691 if (command_line.HasSwitch(switches::kHostRules)) {
691 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); 692 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString");
692 globals_->host_mapping_rules->SetRulesFromString( 693 globals_->host_mapping_rules->SetRulesFromString(
693 command_line.GetSwitchValueASCII(switches::kHostRules)); 694 command_line.GetSwitchValueASCII(switches::kHostRules));
694 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); 695 TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString");
695 } 696 }
697 if (command_line.HasSwitch(switches::kEnableSSLConnectJobWaiting))
698 globals_->enable_ssl_connect_job_waiting = true;
696 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) 699 if (command_line.HasSwitch(switches::kIgnoreCertificateErrors))
697 globals_->ignore_certificate_errors = true; 700 globals_->ignore_certificate_errors = true;
698 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { 701 if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) {
699 globals_->testing_fixed_http_port = 702 globals_->testing_fixed_http_port =
700 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort); 703 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort);
701 } 704 }
702 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { 705 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) {
703 globals_->testing_fixed_https_port = 706 globals_->testing_fixed_https_port =
704 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort); 707 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort);
705 } 708 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 params->host_resolver = globals.host_resolver.get(); 1005 params->host_resolver = globals.host_resolver.get();
1003 params->cert_verifier = globals.cert_verifier.get(); 1006 params->cert_verifier = globals.cert_verifier.get();
1004 params->channel_id_service = globals.system_channel_id_service.get(); 1007 params->channel_id_service = globals.system_channel_id_service.get();
1005 params->transport_security_state = globals.transport_security_state.get(); 1008 params->transport_security_state = globals.transport_security_state.get();
1006 params->ssl_config_service = globals.ssl_config_service.get(); 1009 params->ssl_config_service = globals.ssl_config_service.get();
1007 params->http_auth_handler_factory = globals.http_auth_handler_factory.get(); 1010 params->http_auth_handler_factory = globals.http_auth_handler_factory.get();
1008 params->http_server_properties = 1011 params->http_server_properties =
1009 globals.http_server_properties->GetWeakPtr(); 1012 globals.http_server_properties->GetWeakPtr();
1010 params->network_delegate = globals.system_network_delegate.get(); 1013 params->network_delegate = globals.system_network_delegate.get();
1011 params->host_mapping_rules = globals.host_mapping_rules.get(); 1014 params->host_mapping_rules = globals.host_mapping_rules.get();
1015 params->enable_ssl_connect_job_waiting =
1016 globals.enable_ssl_connect_job_waiting;
1012 params->ignore_certificate_errors = globals.ignore_certificate_errors; 1017 params->ignore_certificate_errors = globals.ignore_certificate_errors;
1013 params->testing_fixed_http_port = globals.testing_fixed_http_port; 1018 params->testing_fixed_http_port = globals.testing_fixed_http_port;
1014 params->testing_fixed_https_port = globals.testing_fixed_https_port; 1019 params->testing_fixed_https_port = globals.testing_fixed_https_port;
1015 1020
1016 globals.initial_max_spdy_concurrent_streams.CopyToIfSet( 1021 globals.initial_max_spdy_concurrent_streams.CopyToIfSet(
1017 &params->spdy_initial_max_concurrent_streams); 1022 &params->spdy_initial_max_concurrent_streams);
1018 globals.force_spdy_single_domain.CopyToIfSet( 1023 globals.force_spdy_single_domain.CopyToIfSet(
1019 &params->force_spdy_single_domain); 1024 &params->force_spdy_single_domain);
1020 globals.enable_spdy_compression.CopyToIfSet( 1025 globals.enable_spdy_compression.CopyToIfSet(
1021 &params->enable_spdy_compression); 1026 &params->enable_spdy_compression);
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); 1386 net::QuicVersionVector supported_versions = net::QuicSupportedVersions();
1382 for (size_t i = 0; i < supported_versions.size(); ++i) { 1387 for (size_t i = 0; i < supported_versions.size(); ++i) {
1383 net::QuicVersion version = supported_versions[i]; 1388 net::QuicVersion version = supported_versions[i];
1384 if (net::QuicVersionToString(version) == quic_version) { 1389 if (net::QuicVersionToString(version) == quic_version) {
1385 return version; 1390 return version;
1386 } 1391 }
1387 } 1392 }
1388 1393
1389 return net::QUIC_VERSION_UNSUPPORTED; 1394 return net::QUIC_VERSION_UNSUPPORTED;
1390 } 1395 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698