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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "net/spdy/spdy_session.h" | 70 #include "net/spdy/spdy_session.h" |
71 #include "net/ssl/default_server_bound_cert_store.h" | 71 #include "net/ssl/default_server_bound_cert_store.h" |
72 #include "net/ssl/server_bound_cert_service.h" | 72 #include "net/ssl/server_bound_cert_service.h" |
73 #include "net/url_request/data_protocol_handler.h" | 73 #include "net/url_request/data_protocol_handler.h" |
74 #include "net/url_request/file_protocol_handler.h" | 74 #include "net/url_request/file_protocol_handler.h" |
75 #include "net/url_request/ftp_protocol_handler.h" | 75 #include "net/url_request/ftp_protocol_handler.h" |
76 #include "net/url_request/static_http_user_agent_settings.h" | 76 #include "net/url_request/static_http_user_agent_settings.h" |
77 #include "net/url_request/url_fetcher.h" | 77 #include "net/url_request/url_fetcher.h" |
78 #include "net/url_request/url_request_job_factory_impl.h" | 78 #include "net/url_request/url_request_job_factory_impl.h" |
79 #include "net/url_request/url_request_throttler_manager.h" | 79 #include "net/url_request/url_request_throttler_manager.h" |
80 #include "net/websockets/websocket_job.h" | |
81 #include "url/url_constants.h" | 80 #include "url/url_constants.h" |
82 | 81 |
83 #if defined(ENABLE_CONFIGURATION_POLICY) | 82 #if defined(ENABLE_CONFIGURATION_POLICY) |
84 #include "policy/policy_constants.h" | 83 #include "policy/policy_constants.h" |
85 #endif | 84 #endif |
86 | 85 |
87 #if !defined(USE_OPENSSL) | 86 #if !defined(USE_OPENSSL) |
88 #include "net/cert/ct_log_verifier.h" | 87 #include "net/cert/ct_log_verifier.h" |
89 #include "net/cert/multi_log_ct_verifier.h" | 88 #include "net/cert/multi_log_ct_verifier.h" |
90 #endif | 89 #endif |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 // Only handle use-spdy command line flags if "spdy.disabled" preference is | 748 // Only handle use-spdy command line flags if "spdy.disabled" preference is |
750 // not disabled via policy. | 749 // not disabled via policy. |
751 if (is_spdy_disabled_by_policy_) { | 750 if (is_spdy_disabled_by_policy_) { |
752 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); | 751 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); |
753 if (trial) | 752 if (trial) |
754 trial->Disable(); | 753 trial->Disable(); |
755 } else { | 754 } else { |
756 std::string spdy_trial_group = | 755 std::string spdy_trial_group = |
757 base::FieldTrialList::FindFullName(kSpdyFieldTrialName); | 756 base::FieldTrialList::FindFullName(kSpdyFieldTrialName); |
758 | 757 |
759 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | |
760 // Enable WebSocket over SPDY. | |
761 net::WebSocketJob::set_websocket_over_spdy_enabled(true); | |
762 } | |
763 | |
764 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { | 758 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { |
765 globals_->trusted_spdy_proxy.set( | 759 globals_->trusted_spdy_proxy.set( |
766 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); | 760 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); |
767 } | 761 } |
768 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) | 762 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) |
769 net::URLFetcher::SetIgnoreCertificateRequests(true); | 763 net::URLFetcher::SetIgnoreCertificateRequests(true); |
770 | 764 |
771 if (command_line.HasSwitch(switches::kUseSpdy)) { | 765 if (command_line.HasSwitch(switches::kUseSpdy)) { |
772 std::string spdy_mode = | 766 std::string spdy_mode = |
773 command_line.GetSwitchValueASCII(switches::kUseSpdy); | 767 command_line.GetSwitchValueASCII(switches::kUseSpdy); |
(...skipping 10 matching lines...) Expand all Loading... |
784 } else { | 778 } else { |
785 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && | 779 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && |
786 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 780 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
787 net::HttpStreamFactory::set_spdy_enabled(false); | 781 net::HttpStreamFactory::set_spdy_enabled(false); |
788 } else { | 782 } else { |
789 // Use SPDY/3.1 by default. | 783 // Use SPDY/3.1 by default. |
790 globals_->next_protos = net::NextProtosSpdy31(); | 784 globals_->next_protos = net::NextProtosSpdy31(); |
791 globals_->use_alternate_protocols.set(true); | 785 globals_->use_alternate_protocols.set(true); |
792 } | 786 } |
793 } | 787 } |
| 788 |
| 789 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) |
| 790 globals_->enable_websocket_over_spdy.set(true); |
794 } | 791 } |
795 | 792 |
796 // TODO(rch): Make the client socket factory a per-network session | 793 // TODO(rch): Make the client socket factory a per-network session |
797 // instance, constructed from a NetworkSession::Params, to allow us | 794 // instance, constructed from a NetworkSession::Params, to allow us |
798 // to move this option to IOThread::Globals & | 795 // to move this option to IOThread::Globals & |
799 // HttpNetworkSession::Params. | 796 // HttpNetworkSession::Params. |
800 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) | 797 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) |
801 net::SetTCPFastOpenEnabled(true); | 798 net::SetTCPFastOpenEnabled(true); |
802 } | 799 } |
803 | 800 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 ¶ms->enable_spdy_ping_based_connection_checking); | 955 ¶ms->enable_spdy_ping_based_connection_checking); |
959 globals_->spdy_default_protocol.CopyToIfSet( | 956 globals_->spdy_default_protocol.CopyToIfSet( |
960 ¶ms->spdy_default_protocol); | 957 ¶ms->spdy_default_protocol); |
961 params->next_protos = globals_->next_protos; | 958 params->next_protos = globals_->next_protos; |
962 globals_->trusted_spdy_proxy.CopyToIfSet(¶ms->trusted_spdy_proxy); | 959 globals_->trusted_spdy_proxy.CopyToIfSet(¶ms->trusted_spdy_proxy); |
963 globals_->force_spdy_over_ssl.CopyToIfSet(¶ms->force_spdy_over_ssl); | 960 globals_->force_spdy_over_ssl.CopyToIfSet(¶ms->force_spdy_over_ssl); |
964 globals_->force_spdy_always.CopyToIfSet(¶ms->force_spdy_always); | 961 globals_->force_spdy_always.CopyToIfSet(¶ms->force_spdy_always); |
965 globals_->forced_spdy_exclusions = params->forced_spdy_exclusions; | 962 globals_->forced_spdy_exclusions = params->forced_spdy_exclusions; |
966 globals_->use_alternate_protocols.CopyToIfSet( | 963 globals_->use_alternate_protocols.CopyToIfSet( |
967 ¶ms->use_alternate_protocols); | 964 ¶ms->use_alternate_protocols); |
| 965 globals_->enable_websocket_over_spdy.CopyToIfSet( |
| 966 ¶ms->enable_websocket_over_spdy); |
968 | 967 |
969 globals_->enable_quic.CopyToIfSet(¶ms->enable_quic); | 968 globals_->enable_quic.CopyToIfSet(¶ms->enable_quic); |
970 globals_->enable_quic_https.CopyToIfSet(¶ms->enable_quic_https); | 969 globals_->enable_quic_https.CopyToIfSet(¶ms->enable_quic_https); |
971 globals_->enable_quic_pacing.CopyToIfSet( | 970 globals_->enable_quic_pacing.CopyToIfSet( |
972 ¶ms->enable_quic_pacing); | 971 ¶ms->enable_quic_pacing); |
973 globals_->enable_quic_time_based_loss_detection.CopyToIfSet( | 972 globals_->enable_quic_time_based_loss_detection.CopyToIfSet( |
974 ¶ms->enable_quic_time_based_loss_detection); | 973 ¶ms->enable_quic_time_based_loss_detection); |
975 globals_->enable_quic_persist_server_info.CopyToIfSet( | 974 globals_->enable_quic_persist_server_info.CopyToIfSet( |
976 ¶ms->enable_quic_persist_server_info); | 975 ¶ms->enable_quic_persist_server_info); |
977 globals_->enable_quic_port_selection.CopyToIfSet( | 976 globals_->enable_quic_port_selection.CopyToIfSet( |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 std::string version_flag = | 1204 std::string version_flag = |
1206 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1205 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
1207 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1206 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1208 net::QuicVersion version = supported_versions[i]; | 1207 net::QuicVersion version = supported_versions[i]; |
1209 if (net::QuicVersionToString(version) == version_flag) { | 1208 if (net::QuicVersionToString(version) == version_flag) { |
1210 return version; | 1209 return version; |
1211 } | 1210 } |
1212 } | 1211 } |
1213 return net::QUIC_VERSION_UNSUPPORTED; | 1212 return net::QUIC_VERSION_UNSUPPORTED; |
1214 } | 1213 } |
OLD | NEW |