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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 if (command_line.HasSwitch(switches::kUseSpdy)) { | 725 if (command_line.HasSwitch(switches::kUseSpdy)) { |
726 std::string spdy_mode = | 726 std::string spdy_mode = |
727 command_line.GetSwitchValueASCII(switches::kUseSpdy); | 727 command_line.GetSwitchValueASCII(switches::kUseSpdy); |
728 EnableSpdy(spdy_mode); | 728 EnableSpdy(spdy_mode); |
729 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { | 729 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { |
730 net::HttpStreamFactory::EnableNpnHttp2Draft04(); | 730 net::HttpStreamFactory::EnableNpnHttp2Draft04(); |
731 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { | 731 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { |
732 net::HttpStreamFactory::EnableNpnSpdy4a2(); | 732 net::HttpStreamFactory::EnableNpnSpdy4a2(); |
733 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { | 733 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { |
734 net::HttpStreamFactory::EnableNpnSpdy3(); | 734 net::HttpStreamFactory::EnableNpnSpdy3(); |
735 } else if (command_line.HasSwitch(switches::kEnableNpn)) { | 735 } else if (command_line.HasSwitch(switches::kEnableSpdy2)) { |
736 net::HttpStreamFactory::EnableNpnSpdy(); | 736 net::HttpStreamFactory::EnableNpnSpdy31WithSpdy2(); |
737 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { | 737 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { |
738 net::HttpStreamFactory::EnableNpnHttpOnly(); | 738 net::HttpStreamFactory::EnableNpnHttpOnly(); |
739 } else { | 739 } else { |
740 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && | 740 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && |
741 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 741 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
742 net::HttpStreamFactory::set_spdy_enabled(false); | 742 net::HttpStreamFactory::set_spdy_enabled(false); |
743 } else { | 743 } else { |
744 // Use SPDY/3.1 by default. | 744 // Use SPDY/3.1 by default. |
745 net::HttpStreamFactory::EnableNpnSpdy31(); | 745 net::HttpStreamFactory::EnableNpnSpdy31(); |
746 } | 746 } |
(...skipping 30 matching lines...) Expand all Loading... |
777 std::vector<std::string> name_value; | 777 std::vector<std::string> name_value; |
778 base::SplitString(element, '=', &name_value); | 778 base::SplitString(element, '=', &name_value); |
779 const std::string& option = | 779 const std::string& option = |
780 name_value.size() > 0 ? name_value[0] : std::string(); | 780 name_value.size() > 0 ? name_value[0] : std::string(); |
781 const std::string value = | 781 const std::string value = |
782 name_value.size() > 1 ? name_value[1] : std::string(); | 782 name_value.size() > 1 ? name_value[1] : std::string(); |
783 | 783 |
784 if (option == kOff) { | 784 if (option == kOff) { |
785 net::HttpStreamFactory::set_spdy_enabled(false); | 785 net::HttpStreamFactory::set_spdy_enabled(false); |
786 } else if (option == kDisableSSL) { | 786 } else if (option == kDisableSSL) { |
787 globals_->spdy_default_protocol.set(net::kProtoSPDY2); | 787 globals_->spdy_default_protocol.set(net::kProtoSPDY3); |
788 net::HttpStreamFactory::set_force_spdy_over_ssl(false); | 788 net::HttpStreamFactory::set_force_spdy_over_ssl(false); |
789 net::HttpStreamFactory::set_force_spdy_always(true); | 789 net::HttpStreamFactory::set_force_spdy_always(true); |
790 } else if (option == kSSL) { | 790 } else if (option == kSSL) { |
791 globals_->spdy_default_protocol.set(net::kProtoSPDY2); | 791 globals_->spdy_default_protocol.set(net::kProtoSPDY3); |
792 net::HttpStreamFactory::set_force_spdy_over_ssl(true); | 792 net::HttpStreamFactory::set_force_spdy_over_ssl(true); |
793 net::HttpStreamFactory::set_force_spdy_always(true); | 793 net::HttpStreamFactory::set_force_spdy_always(true); |
794 } else if (option == kDisablePing) { | 794 } else if (option == kDisablePing) { |
795 globals_->enable_spdy_ping_based_connection_checking.set(false); | 795 globals_->enable_spdy_ping_based_connection_checking.set(false); |
796 } else if (option == kExclude) { | 796 } else if (option == kExclude) { |
797 net::HttpStreamFactory::add_forced_spdy_exclusion(value); | 797 net::HttpStreamFactory::add_forced_spdy_exclusion(value); |
798 } else if (option == kDisableCompression) { | 798 } else if (option == kDisableCompression) { |
799 globals_->enable_spdy_compression.set(false); | 799 globals_->enable_spdy_compression.set(false); |
800 } else if (option == kDisableAltProtocols) { | 800 } else if (option == kDisableAltProtocols) { |
801 net::HttpStreamFactory::set_use_alternate_protocols(false); | 801 net::HttpStreamFactory::set_use_alternate_protocols(false); |
802 } else if (option == kForceAltProtocols) { | 802 } else if (option == kForceAltProtocols) { |
803 net::PortAlternateProtocolPair pair; | 803 net::PortAlternateProtocolPair pair; |
804 pair.port = 443; | 804 pair.port = 443; |
805 pair.protocol = net::NPN_SPDY_2; | 805 pair.protocol = net::NPN_SPDY_3; |
806 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair); | 806 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair); |
807 } else if (option == kSingleDomain) { | 807 } else if (option == kSingleDomain) { |
808 DLOG(INFO) << "FORCING SINGLE DOMAIN"; | 808 DLOG(INFO) << "FORCING SINGLE DOMAIN"; |
809 globals_->force_spdy_single_domain.set(true); | 809 globals_->force_spdy_single_domain.set(true); |
810 } else if (option == kInitialMaxConcurrentStreams) { | 810 } else if (option == kInitialMaxConcurrentStreams) { |
811 int streams; | 811 int streams; |
812 if (base::StringToInt(value, &streams)) | 812 if (base::StringToInt(value, &streams)) |
813 globals_->initial_max_spdy_concurrent_streams.set(streams); | 813 globals_->initial_max_spdy_concurrent_streams.set(streams); |
814 } else if (option.empty() && it == spdy_options.begin()) { | 814 } else if (option.empty() && it == spdy_options.begin()) { |
815 continue; | 815 continue; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 if (command_line.HasSwitch(switches::kDisableQuicHttps)) | 1035 if (command_line.HasSwitch(switches::kDisableQuicHttps)) |
1036 return false; | 1036 return false; |
1037 | 1037 |
1038 if (command_line.HasSwitch(switches::kEnableQuicHttps)) | 1038 if (command_line.HasSwitch(switches::kEnableQuicHttps)) |
1039 return true; | 1039 return true; |
1040 | 1040 |
1041 // HTTPS over QUIC should only be enabled if we are in the https | 1041 // HTTPS over QUIC should only be enabled if we are in the https |
1042 // field trial group. | 1042 // field trial group. |
1043 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; | 1043 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; |
1044 } | 1044 } |
OLD | NEW |