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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 ignore_certificate_errors(false), | 397 ignore_certificate_errors(false), |
398 testing_fixed_http_port(0), | 398 testing_fixed_http_port(0), |
399 testing_fixed_https_port(0), | 399 testing_fixed_https_port(0), |
400 enable_user_alternate_protocol_ports(false) { | 400 enable_user_alternate_protocol_ports(false), |
401 enable_ssl_connect_job_waiting(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. |
407 IOThread::IOThread( | 408 IOThread::IOThread( |
408 PrefService* local_state, | 409 PrefService* local_state, |
409 policy::PolicyService* policy_service, | 410 policy::PolicyService* policy_service, |
410 ChromeNetLog* net_log, | 411 ChromeNetLog* net_log, |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
640 } | 641 } |
641 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { | 642 if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { |
642 globals_->testing_fixed_https_port = | 643 globals_->testing_fixed_https_port = |
643 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort); | 644 GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort); |
644 } | 645 } |
645 ConfigureQuic(command_line); | 646 ConfigureQuic(command_line); |
646 if (command_line.HasSwitch( | 647 if (command_line.HasSwitch( |
647 switches::kEnableUserAlternateProtocolPorts)) { | 648 switches::kEnableUserAlternateProtocolPorts)) { |
648 globals_->enable_user_alternate_protocol_ports = true; | 649 globals_->enable_user_alternate_protocol_ports = true; |
649 } | 650 } |
651 if (command_line.HasSwitch(switches::kEnableSSLConnectJobWaiting)) { | |
652 globals_->enable_ssl_connect_job_waiting = true; | |
653 } | |
wtc
2014/07/23 22:53:32
1. Omit curly braces.
2. Nit: move this before li
mshelley
2014/07/24 20:37:46
Done.
| |
650 InitializeNetworkOptions(command_line); | 654 InitializeNetworkOptions(command_line); |
651 | 655 |
652 net::HttpNetworkSession::Params session_params; | 656 net::HttpNetworkSession::Params session_params; |
653 InitializeNetworkSessionParams(&session_params); | 657 InitializeNetworkSessionParams(&session_params); |
654 session_params.net_log = net_log_; | 658 session_params.net_log = net_log_; |
655 session_params.proxy_service = | 659 session_params.proxy_service = |
656 globals_->proxy_script_fetcher_proxy_service.get(); | 660 globals_->proxy_script_fetcher_proxy_service.get(); |
657 | 661 |
658 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:HttpNetworkSession"); | 662 TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:HttpNetworkSession"); |
659 scoped_refptr<net::HttpNetworkSession> network_session( | 663 scoped_refptr<net::HttpNetworkSession> network_session( |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
977 globals_->enable_quic_port_selection.CopyToIfSet( | 981 globals_->enable_quic_port_selection.CopyToIfSet( |
978 ¶ms->enable_quic_port_selection); | 982 ¶ms->enable_quic_port_selection); |
979 globals_->quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); | 983 globals_->quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); |
980 globals_->quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); | 984 globals_->quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); |
981 globals_->quic_supported_versions.CopyToIfSet( | 985 globals_->quic_supported_versions.CopyToIfSet( |
982 ¶ms->quic_supported_versions); | 986 ¶ms->quic_supported_versions); |
983 globals_->origin_to_force_quic_on.CopyToIfSet( | 987 globals_->origin_to_force_quic_on.CopyToIfSet( |
984 ¶ms->origin_to_force_quic_on); | 988 ¶ms->origin_to_force_quic_on); |
985 params->enable_user_alternate_protocol_ports = | 989 params->enable_user_alternate_protocol_ports = |
986 globals_->enable_user_alternate_protocol_ports; | 990 globals_->enable_user_alternate_protocol_ports; |
991 params->enable_ssl_connect_job_waiting = | |
992 globals_->enable_ssl_connect_job_waiting; | |
wtc
2014/07/23 22:53:32
Nit: move this before line 949, if you reordered t
mshelley
2014/07/24 20:37:46
Done.
| |
987 } | 993 } |
988 | 994 |
989 base::TimeTicks IOThread::creation_time() const { | 995 base::TimeTicks IOThread::creation_time() const { |
990 return creation_time_; | 996 return creation_time_; |
991 } | 997 } |
992 | 998 |
993 net::SSLConfigService* IOThread::GetSSLConfigService() { | 999 net::SSLConfigService* IOThread::GetSSLConfigService() { |
994 return ssl_config_service_manager_->Get(); | 1000 return ssl_config_service_manager_->Get(); |
995 } | 1001 } |
996 | 1002 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1213 std::string version_flag = | 1219 std::string version_flag = |
1214 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1220 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
1215 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1221 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1216 net::QuicVersion version = supported_versions[i]; | 1222 net::QuicVersion version = supported_versions[i]; |
1217 if (net::QuicVersionToString(version) == version_flag) { | 1223 if (net::QuicVersionToString(version) == version_flag) { |
1218 return version; | 1224 return version; |
1219 } | 1225 } |
1220 } | 1226 } |
1221 return net::QUIC_VERSION_UNSUPPORTED; | 1227 return net::QUIC_VERSION_UNSUPPORTED; |
1222 } | 1228 } |
OLD | NEW |