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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 // Only handle use-spdy command line flags if "spdy.disabled" preference is | 755 // Only handle use-spdy command line flags if "spdy.disabled" preference is |
756 // not disabled via policy. | 756 // not disabled via policy. |
757 if (is_spdy_disabled_by_policy_) { | 757 if (is_spdy_disabled_by_policy_) { |
758 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); | 758 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); |
759 if (trial) | 759 if (trial) |
760 trial->Disable(); | 760 trial->Disable(); |
761 } else { | 761 } else { |
762 std::string spdy_trial_group = | 762 std::string spdy_trial_group = |
763 base::FieldTrialList::FindFullName(kSpdyFieldTrialName); | 763 base::FieldTrialList::FindFullName(kSpdyFieldTrialName); |
764 | 764 |
765 if (command_line.HasSwitch(switches::kEnableIPPooling)) | |
766 globals_->enable_spdy_ip_pooling.set(true); | |
767 | |
768 if (command_line.HasSwitch(switches::kDisableIPPooling)) | |
769 globals_->enable_spdy_ip_pooling.set(false); | |
770 | |
771 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 765 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
772 // Enable WebSocket over SPDY. | 766 // Enable WebSocket over SPDY. |
773 net::WebSocketJob::set_websocket_over_spdy_enabled(true); | 767 net::WebSocketJob::set_websocket_over_spdy_enabled(true); |
774 } | 768 } |
775 | 769 |
776 if (command_line.HasSwitch(switches::kMaxSpdyConcurrentStreams)) { | |
777 globals_->max_spdy_concurrent_streams_limit.set( | |
778 GetSwitchValueAsInt(command_line, | |
779 switches::kMaxSpdyConcurrentStreams)); | |
780 } | |
781 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { | 770 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { |
782 globals_->trusted_spdy_proxy.set( | 771 globals_->trusted_spdy_proxy.set( |
783 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); | 772 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); |
784 } | 773 } |
785 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) | 774 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) |
786 net::URLFetcher::SetIgnoreCertificateRequests(true); | 775 net::URLFetcher::SetIgnoreCertificateRequests(true); |
787 | 776 |
788 if (command_line.HasSwitch(switches::kUseSpdy)) { | 777 if (command_line.HasSwitch(switches::kUseSpdy)) { |
789 std::string spdy_mode = | 778 std::string spdy_mode = |
790 command_line.GetSwitchValueASCII(switches::kUseSpdy); | 779 command_line.GetSwitchValueASCII(switches::kUseSpdy); |
791 EnableSpdy(spdy_mode); | 780 EnableSpdy(spdy_mode); |
792 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { | 781 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { |
793 net::HttpStreamFactory::EnableNpnHttp2Draft04(); | 782 net::HttpStreamFactory::EnableNpnHttp2Draft04(); |
794 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { | 783 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { |
795 net::HttpStreamFactory::EnableNpnSpdy4a2(); | 784 net::HttpStreamFactory::EnableNpnSpdy4a2(); |
796 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { | 785 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { |
797 net::HttpStreamFactory::EnableNpnSpdy3(); | 786 net::HttpStreamFactory::EnableNpnSpdy3(); |
798 } else if (command_line.HasSwitch(switches::kEnableSpdy2)) { | |
799 net::HttpStreamFactory::EnableNpnSpdy31WithSpdy2(); | |
800 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { | 787 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { |
801 net::HttpStreamFactory::EnableNpnHttpOnly(); | 788 net::HttpStreamFactory::EnableNpnHttpOnly(); |
802 } else { | 789 } else { |
803 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && | 790 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && |
804 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 791 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
805 net::HttpStreamFactory::set_spdy_enabled(false); | 792 net::HttpStreamFactory::set_spdy_enabled(false); |
806 } else { | 793 } else { |
807 // Use SPDY/3.1 by default. | 794 // Use SPDY/3.1 by default. |
808 net::HttpStreamFactory::EnableNpnSpdy31(); | 795 net::HttpStreamFactory::EnableNpnSpdy31(); |
809 } | 796 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 globals_->http_server_properties->GetWeakPtr(); | 964 globals_->http_server_properties->GetWeakPtr(); |
978 params->network_delegate = globals_->system_network_delegate.get(); | 965 params->network_delegate = globals_->system_network_delegate.get(); |
979 params->host_mapping_rules = globals_->host_mapping_rules.get(); | 966 params->host_mapping_rules = globals_->host_mapping_rules.get(); |
980 params->ignore_certificate_errors = globals_->ignore_certificate_errors; | 967 params->ignore_certificate_errors = globals_->ignore_certificate_errors; |
981 params->http_pipelining_enabled = globals_->http_pipelining_enabled; | 968 params->http_pipelining_enabled = globals_->http_pipelining_enabled; |
982 params->testing_fixed_http_port = globals_->testing_fixed_http_port; | 969 params->testing_fixed_http_port = globals_->testing_fixed_http_port; |
983 params->testing_fixed_https_port = globals_->testing_fixed_https_port; | 970 params->testing_fixed_https_port = globals_->testing_fixed_https_port; |
984 | 971 |
985 globals_->initial_max_spdy_concurrent_streams.CopyToIfSet( | 972 globals_->initial_max_spdy_concurrent_streams.CopyToIfSet( |
986 ¶ms->spdy_initial_max_concurrent_streams); | 973 ¶ms->spdy_initial_max_concurrent_streams); |
987 globals_->max_spdy_concurrent_streams_limit.CopyToIfSet( | |
988 ¶ms->spdy_max_concurrent_streams_limit); | |
989 globals_->force_spdy_single_domain.CopyToIfSet( | 974 globals_->force_spdy_single_domain.CopyToIfSet( |
990 ¶ms->force_spdy_single_domain); | 975 ¶ms->force_spdy_single_domain); |
991 globals_->enable_spdy_ip_pooling.CopyToIfSet( | |
992 ¶ms->enable_spdy_ip_pooling); | |
993 globals_->enable_spdy_compression.CopyToIfSet( | 976 globals_->enable_spdy_compression.CopyToIfSet( |
994 ¶ms->enable_spdy_compression); | 977 ¶ms->enable_spdy_compression); |
995 globals_->enable_spdy_ping_based_connection_checking.CopyToIfSet( | 978 globals_->enable_spdy_ping_based_connection_checking.CopyToIfSet( |
996 ¶ms->enable_spdy_ping_based_connection_checking); | 979 ¶ms->enable_spdy_ping_based_connection_checking); |
997 globals_->spdy_default_protocol.CopyToIfSet( | 980 globals_->spdy_default_protocol.CopyToIfSet( |
998 ¶ms->spdy_default_protocol); | 981 ¶ms->spdy_default_protocol); |
999 globals_->trusted_spdy_proxy.CopyToIfSet( | 982 globals_->trusted_spdy_proxy.CopyToIfSet( |
1000 ¶ms->trusted_spdy_proxy); | 983 ¶ms->trusted_spdy_proxy); |
1001 globals_->enable_quic.CopyToIfSet(¶ms->enable_quic); | 984 globals_->enable_quic.CopyToIfSet(¶ms->enable_quic); |
1002 globals_->enable_quic_https.CopyToIfSet(¶ms->enable_quic_https); | 985 globals_->enable_quic_https.CopyToIfSet(¶ms->enable_quic_https); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 std::string version_flag = | 1191 std::string version_flag = |
1209 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1192 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
1210 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1193 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1211 net::QuicVersion version = supported_versions[i]; | 1194 net::QuicVersion version = supported_versions[i]; |
1212 if (net::QuicVersionToString(version) == version_flag) { | 1195 if (net::QuicVersionToString(version) == version_flag) { |
1213 return version; | 1196 return version; |
1214 } | 1197 } |
1215 } | 1198 } |
1216 return net::QUIC_VERSION_UNSUPPORTED; | 1199 return net::QUIC_VERSION_UNSUPPORTED; |
1217 } | 1200 } |
OLD | NEW |