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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 // Only handle use-spdy command line flags if "spdy.disabled" preference is | 769 // Only handle use-spdy command line flags if "spdy.disabled" preference is |
770 // not disabled via policy. | 770 // not disabled via policy. |
771 if (is_spdy_disabled_by_policy_) { | 771 if (is_spdy_disabled_by_policy_) { |
772 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); | 772 base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); |
773 if (trial) | 773 if (trial) |
774 trial->Disable(); | 774 trial->Disable(); |
775 } else { | 775 } else { |
776 std::string spdy_trial_group = | 776 std::string spdy_trial_group = |
777 base::FieldTrialList::FindFullName(kSpdyFieldTrialName); | 777 base::FieldTrialList::FindFullName(kSpdyFieldTrialName); |
778 | 778 |
779 if (command_line.HasSwitch(switches::kEnableIPPooling)) | |
780 globals_->enable_spdy_ip_pooling.set(true); | |
781 | |
782 if (command_line.HasSwitch(switches::kDisableIPPooling)) | |
783 globals_->enable_spdy_ip_pooling.set(false); | |
784 | |
785 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 779 if (command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
786 // Enable WebSocket over SPDY. | 780 // Enable WebSocket over SPDY. |
787 net::WebSocketJob::set_websocket_over_spdy_enabled(true); | 781 net::WebSocketJob::set_websocket_over_spdy_enabled(true); |
788 } | 782 } |
789 | 783 |
790 if (command_line.HasSwitch(switches::kMaxSpdyConcurrentStreams)) { | |
791 globals_->max_spdy_concurrent_streams_limit.set( | |
792 GetSwitchValueAsInt(command_line, | |
793 switches::kMaxSpdyConcurrentStreams)); | |
794 } | |
795 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { | 784 if (command_line.HasSwitch(switches::kTrustedSpdyProxy)) { |
796 globals_->trusted_spdy_proxy.set( | 785 globals_->trusted_spdy_proxy.set( |
797 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); | 786 command_line.GetSwitchValueASCII(switches::kTrustedSpdyProxy)); |
798 } | 787 } |
799 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) | 788 if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) |
800 net::URLFetcher::SetIgnoreCertificateRequests(true); | 789 net::URLFetcher::SetIgnoreCertificateRequests(true); |
801 | 790 |
802 if (command_line.HasSwitch(switches::kUseSpdy)) { | 791 if (command_line.HasSwitch(switches::kUseSpdy)) { |
803 std::string spdy_mode = | 792 std::string spdy_mode = |
804 command_line.GetSwitchValueASCII(switches::kUseSpdy); | 793 command_line.GetSwitchValueASCII(switches::kUseSpdy); |
805 EnableSpdy(spdy_mode); | 794 EnableSpdy(spdy_mode); |
806 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { | 795 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { |
807 net::HttpStreamFactory::EnableNpnHttp2Draft04(); | 796 net::HttpStreamFactory::EnableNpnHttp2Draft04(); |
808 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { | 797 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { |
809 net::HttpStreamFactory::EnableNpnSpdy4a2(); | 798 net::HttpStreamFactory::EnableNpnSpdy4a2(); |
810 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { | 799 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { |
811 net::HttpStreamFactory::EnableNpnSpdy3(); | 800 net::HttpStreamFactory::EnableNpnSpdy3(); |
812 } else if (command_line.HasSwitch(switches::kEnableSpdy2)) { | |
813 net::HttpStreamFactory::EnableNpnSpdy31WithSpdy2(); | |
814 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { | 801 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { |
815 net::HttpStreamFactory::EnableNpnHttpOnly(); | 802 net::HttpStreamFactory::EnableNpnHttpOnly(); |
816 } else { | 803 } else { |
817 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && | 804 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && |
818 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 805 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
819 net::HttpStreamFactory::set_spdy_enabled(false); | 806 net::HttpStreamFactory::set_spdy_enabled(false); |
820 } else { | 807 } else { |
821 // Use SPDY/3.1 by default. | 808 // Use SPDY/3.1 by default. |
822 net::HttpStreamFactory::EnableNpnSpdy31(); | 809 net::HttpStreamFactory::EnableNpnSpdy31(); |
823 } | 810 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 globals_->http_server_properties->GetWeakPtr(); | 978 globals_->http_server_properties->GetWeakPtr(); |
992 params->network_delegate = globals_->system_network_delegate.get(); | 979 params->network_delegate = globals_->system_network_delegate.get(); |
993 params->host_mapping_rules = globals_->host_mapping_rules.get(); | 980 params->host_mapping_rules = globals_->host_mapping_rules.get(); |
994 params->ignore_certificate_errors = globals_->ignore_certificate_errors; | 981 params->ignore_certificate_errors = globals_->ignore_certificate_errors; |
995 params->http_pipelining_enabled = globals_->http_pipelining_enabled; | 982 params->http_pipelining_enabled = globals_->http_pipelining_enabled; |
996 params->testing_fixed_http_port = globals_->testing_fixed_http_port; | 983 params->testing_fixed_http_port = globals_->testing_fixed_http_port; |
997 params->testing_fixed_https_port = globals_->testing_fixed_https_port; | 984 params->testing_fixed_https_port = globals_->testing_fixed_https_port; |
998 | 985 |
999 globals_->initial_max_spdy_concurrent_streams.CopyToIfSet( | 986 globals_->initial_max_spdy_concurrent_streams.CopyToIfSet( |
1000 ¶ms->spdy_initial_max_concurrent_streams); | 987 ¶ms->spdy_initial_max_concurrent_streams); |
1001 globals_->max_spdy_concurrent_streams_limit.CopyToIfSet( | |
1002 ¶ms->spdy_max_concurrent_streams_limit); | |
1003 globals_->force_spdy_single_domain.CopyToIfSet( | 988 globals_->force_spdy_single_domain.CopyToIfSet( |
1004 ¶ms->force_spdy_single_domain); | 989 ¶ms->force_spdy_single_domain); |
1005 globals_->enable_spdy_ip_pooling.CopyToIfSet( | |
1006 ¶ms->enable_spdy_ip_pooling); | |
1007 globals_->enable_spdy_compression.CopyToIfSet( | 990 globals_->enable_spdy_compression.CopyToIfSet( |
1008 ¶ms->enable_spdy_compression); | 991 ¶ms->enable_spdy_compression); |
1009 globals_->enable_spdy_ping_based_connection_checking.CopyToIfSet( | 992 globals_->enable_spdy_ping_based_connection_checking.CopyToIfSet( |
1010 ¶ms->enable_spdy_ping_based_connection_checking); | 993 ¶ms->enable_spdy_ping_based_connection_checking); |
1011 globals_->spdy_default_protocol.CopyToIfSet( | 994 globals_->spdy_default_protocol.CopyToIfSet( |
1012 ¶ms->spdy_default_protocol); | 995 ¶ms->spdy_default_protocol); |
1013 globals_->trusted_spdy_proxy.CopyToIfSet( | 996 globals_->trusted_spdy_proxy.CopyToIfSet( |
1014 ¶ms->trusted_spdy_proxy); | 997 ¶ms->trusted_spdy_proxy); |
1015 globals_->enable_quic.CopyToIfSet(¶ms->enable_quic); | 998 globals_->enable_quic.CopyToIfSet(¶ms->enable_quic); |
1016 globals_->enable_quic_https.CopyToIfSet(¶ms->enable_quic_https); | 999 globals_->enable_quic_https.CopyToIfSet(¶ms->enable_quic_https); |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 std::string version_flag = | 1220 std::string version_flag = |
1238 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1221 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
1239 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1222 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1240 net::QuicVersion version = supported_versions[i]; | 1223 net::QuicVersion version = supported_versions[i]; |
1241 if (net::QuicVersionToString(version) == version_flag) { | 1224 if (net::QuicVersionToString(version) == version_flag) { |
1242 return version; | 1225 return version; |
1243 } | 1226 } |
1244 } | 1227 } |
1245 return net::QUIC_VERSION_UNSUPPORTED; | 1228 return net::QUIC_VERSION_UNSUPPORTED; |
1246 } | 1229 } |
OLD | NEW |