| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "net/spdy/spdy_session.h" | 72 #include "net/spdy/spdy_session.h" |
| 73 #include "net/ssl/default_server_bound_cert_store.h" | 73 #include "net/ssl/default_server_bound_cert_store.h" |
| 74 #include "net/ssl/server_bound_cert_service.h" | 74 #include "net/ssl/server_bound_cert_service.h" |
| 75 #include "net/url_request/data_protocol_handler.h" | 75 #include "net/url_request/data_protocol_handler.h" |
| 76 #include "net/url_request/file_protocol_handler.h" | 76 #include "net/url_request/file_protocol_handler.h" |
| 77 #include "net/url_request/ftp_protocol_handler.h" | 77 #include "net/url_request/ftp_protocol_handler.h" |
| 78 #include "net/url_request/static_http_user_agent_settings.h" | 78 #include "net/url_request/static_http_user_agent_settings.h" |
| 79 #include "net/url_request/url_fetcher.h" | 79 #include "net/url_request/url_fetcher.h" |
| 80 #include "net/url_request/url_request_job_factory_impl.h" | 80 #include "net/url_request/url_request_job_factory_impl.h" |
| 81 #include "net/url_request/url_request_throttler_manager.h" | 81 #include "net/url_request/url_request_throttler_manager.h" |
| 82 #include "net/websockets/websocket_job.h" | |
| 83 | 82 |
| 84 #if defined(ENABLE_CONFIGURATION_POLICY) | 83 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 85 #include "policy/policy_constants.h" | 84 #include "policy/policy_constants.h" |
| 86 #endif | 85 #endif |
| 87 | 86 |
| 88 #if !defined(USE_OPENSSL) | 87 #if !defined(USE_OPENSSL) |
| 89 #include "net/cert/ct_log_verifier.h" | 88 #include "net/cert/ct_log_verifier.h" |
| 90 #include "net/cert/multi_log_ct_verifier.h" | 89 #include "net/cert/multi_log_ct_verifier.h" |
| 91 #endif | 90 #endif |
| 92 | 91 |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 // Only handle use-spdy command line flags if "spdy.disabled" preference is | 740 // Only handle use-spdy command line flags if "spdy.disabled" preference is |
| 742 // not disabled via policy. | 741 // not disabled via policy. |
| 743 if (is_spdy_disabled_by_policy_) { | 742 if (is_spdy_disabled_by_policy_) { |
| 744 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); | 743 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); |
| 745 if (trial) | 744 if (trial) |
| 746 trial->Disable(); | 745 trial->Disable(); |
| 747 } else { | 746 } else { |
| 748 std::string spdy_trial_group = | 747 std::string spdy_trial_group = |
| 749 base::FieldTrialList::FindFullName(kSpdyFieldTrialName); | 748 base::FieldTrialList::FindFullName(kSpdyFieldTrialName); |
| 750 | 749 |
| 751 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | |
| 752 // Enable WebSocket over SPDY. | |
| 753 net::WebSocketJob::set_websocket_over_spdy_enabled(true); | |
| 754 } | |
| 755 | |
| 756 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { | 750 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { |
| 757 globals_->trusted_spdy_proxy.set( | 751 globals_->trusted_spdy_proxy.set( |
| 758 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); | 752 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); |
| 759 } | 753 } |
| 760 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) | 754 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) |
| 761 net::URLFetcher::SetIgnoreCertificateRequests(true); | 755 net::URLFetcher::SetIgnoreCertificateRequests(true); |
| 762 | 756 |
| 763 if (command_line.HasSwitch(switches::kUseSpdy)) { | 757 if (command_line.HasSwitch(switches::kUseSpdy)) { |
| 764 std::string spdy_mode = | 758 std::string spdy_mode = |
| 765 command_line.GetSwitchValueASCII(switches::kUseSpdy); | 759 command_line.GetSwitchValueASCII(switches::kUseSpdy); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 776 } else { | 770 } else { |
| 777 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && | 771 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && |
| 778 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 772 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
| 779 net::HttpStreamFactory::set_spdy_enabled(false); | 773 net::HttpStreamFactory::set_spdy_enabled(false); |
| 780 } else { | 774 } else { |
| 781 // Use SPDY/3.1 by default. | 775 // Use SPDY/3.1 by default. |
| 782 globals_->next_protos = net::NextProtosSpdy31(); | 776 globals_->next_protos = net::NextProtosSpdy31(); |
| 783 globals_->use_alternate_protocols.set(true); | 777 globals_->use_alternate_protocols.set(true); |
| 784 } | 778 } |
| 785 } | 779 } |
| 780 |
| 781 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) |
| 782 globals_->enable_websocket_over_spdy.set(true); |
| 786 } | 783 } |
| 787 | 784 |
| 788 // TODO(rch): Make the client socket factory a per-network session | 785 // TODO(rch): Make the client socket factory a per-network session |
| 789 // instance, constructed from a NetworkSession::Params, to allow us | 786 // instance, constructed from a NetworkSession::Params, to allow us |
| 790 // to move this option to IOThread::Globals & | 787 // to move this option to IOThread::Globals & |
| 791 // HttpNetworkSession::Params. | 788 // HttpNetworkSession::Params. |
| 792 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) | 789 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) |
| 793 net::SetTCPFastOpenEnabled(true); | 790 net::SetTCPFastOpenEnabled(true); |
| 794 } | 791 } |
| 795 | 792 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 ¶ms->enable_quic_persist_server_info); | 961 ¶ms->enable_quic_persist_server_info); |
| 965 globals_->enable_quic_port_selection.CopyToIfSet( | 962 globals_->enable_quic_port_selection.CopyToIfSet( |
| 966 ¶ms->enable_quic_port_selection); | 963 ¶ms->enable_quic_port_selection); |
| 967 globals_->quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); | 964 globals_->quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); |
| 968 globals_->quic_supported_versions.CopyToIfSet( | 965 globals_->quic_supported_versions.CopyToIfSet( |
| 969 ¶ms->quic_supported_versions); | 966 ¶ms->quic_supported_versions); |
| 970 globals_->origin_to_force_quic_on.CopyToIfSet( | 967 globals_->origin_to_force_quic_on.CopyToIfSet( |
| 971 ¶ms->origin_to_force_quic_on); | 968 ¶ms->origin_to_force_quic_on); |
| 972 params->enable_user_alternate_protocol_ports = | 969 params->enable_user_alternate_protocol_ports = |
| 973 globals_->enable_user_alternate_protocol_ports; | 970 globals_->enable_user_alternate_protocol_ports; |
| 971 |
| 972 globals_->enable_websocket_over_spdy.CopyToIfSet( |
| 973 ¶ms->enable_websocket_over_spdy); |
| 974 } | 974 } |
| 975 | 975 |
| 976 base::TimeTicks IOThread::creation_time() const { | 976 base::TimeTicks IOThread::creation_time() const { |
| 977 return creation_time_; | 977 return creation_time_; |
| 978 } | 978 } |
| 979 | 979 |
| 980 net::SSLConfigService* IOThread::GetSSLConfigService() { | 980 net::SSLConfigService* IOThread::GetSSLConfigService() { |
| 981 return ssl_config_service_manager_->Get(); | 981 return ssl_config_service_manager_->Get(); |
| 982 } | 982 } |
| 983 | 983 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 std::string version_flag = | 1200 std::string version_flag = |
| 1201 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1201 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
| 1202 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1202 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1203 net::QuicVersion version = supported_versions[i]; | 1203 net::QuicVersion version = supported_versions[i]; |
| 1204 if (net::QuicVersionToString(version) == version_flag) { | 1204 if (net::QuicVersionToString(version) == version_flag) { |
| 1205 return version; | 1205 return version; |
| 1206 } | 1206 } |
| 1207 } | 1207 } |
| 1208 return net::QUIC_VERSION_UNSUPPORTED; | 1208 return net::QUIC_VERSION_UNSUPPORTED; |
| 1209 } | 1209 } |
| OLD | NEW |