Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/browser/io_thread.cc

Issue 25977005: [SPDY] Do not advertise SPDY/2 by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 if (command_line.HasSwitch(switches::kUseSpdy)) { 727 if (command_line.HasSwitch(switches::kUseSpdy)) {
728 std::string spdy_mode = 728 std::string spdy_mode =
729 command_line.GetSwitchValueASCII(switches::kUseSpdy); 729 command_line.GetSwitchValueASCII(switches::kUseSpdy);
730 EnableSpdy(spdy_mode); 730 EnableSpdy(spdy_mode);
731 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { 731 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) {
732 net::HttpStreamFactory::EnableNpnHttp2Draft04(); 732 net::HttpStreamFactory::EnableNpnHttp2Draft04();
733 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { 733 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) {
734 net::HttpStreamFactory::EnableNpnSpdy4a2(); 734 net::HttpStreamFactory::EnableNpnSpdy4a2();
735 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { 735 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) {
736 net::HttpStreamFactory::EnableNpnSpdy3(); 736 net::HttpStreamFactory::EnableNpnSpdy3();
737 } else if (command_line.HasSwitch(switches::kEnableNpn)) { 737 } else if (command_line.HasSwitch(switches::kEnableSpdy2)) {
738 net::HttpStreamFactory::EnableNpnSpdy(); 738 net::HttpStreamFactory::EnableNpnSpdy31WithSpdy2();
739 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { 739 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) {
740 net::HttpStreamFactory::EnableNpnHttpOnly(); 740 net::HttpStreamFactory::EnableNpnHttpOnly();
741 } else { 741 } else {
742 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && 742 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName &&
743 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { 743 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) {
744 net::HttpStreamFactory::set_spdy_enabled(false); 744 net::HttpStreamFactory::set_spdy_enabled(false);
745 } else { 745 } else {
746 // Use SPDY/3.1 by default. 746 // Use SPDY/3.1 by default.
747 net::HttpStreamFactory::EnableNpnSpdy31(); 747 net::HttpStreamFactory::EnableNpnSpdy31();
748 } 748 }
(...skipping 30 matching lines...) Expand all
779 std::vector<std::string> name_value; 779 std::vector<std::string> name_value;
780 base::SplitString(element, '=', &name_value); 780 base::SplitString(element, '=', &name_value);
781 const std::string& option = 781 const std::string& option =
782 name_value.size() > 0 ? name_value[0] : std::string(); 782 name_value.size() > 0 ? name_value[0] : std::string();
783 const std::string value = 783 const std::string value =
784 name_value.size() > 1 ? name_value[1] : std::string(); 784 name_value.size() > 1 ? name_value[1] : std::string();
785 785
786 if (option == kOff) { 786 if (option == kOff) {
787 net::HttpStreamFactory::set_spdy_enabled(false); 787 net::HttpStreamFactory::set_spdy_enabled(false);
788 } else if (option == kDisableSSL) { 788 } else if (option == kDisableSSL) {
789 globals_->spdy_default_protocol.set(net::kProtoSPDY2); 789 globals_->spdy_default_protocol.set(net::kProtoSPDY3);
790 net::HttpStreamFactory::set_force_spdy_over_ssl(false); 790 net::HttpStreamFactory::set_force_spdy_over_ssl(false);
791 net::HttpStreamFactory::set_force_spdy_always(true); 791 net::HttpStreamFactory::set_force_spdy_always(true);
792 } else if (option == kSSL) { 792 } else if (option == kSSL) {
793 globals_->spdy_default_protocol.set(net::kProtoSPDY2); 793 globals_->spdy_default_protocol.set(net::kProtoSPDY3);
794 net::HttpStreamFactory::set_force_spdy_over_ssl(true); 794 net::HttpStreamFactory::set_force_spdy_over_ssl(true);
795 net::HttpStreamFactory::set_force_spdy_always(true); 795 net::HttpStreamFactory::set_force_spdy_always(true);
796 } else if (option == kDisablePing) { 796 } else if (option == kDisablePing) {
797 globals_->enable_spdy_ping_based_connection_checking.set(false); 797 globals_->enable_spdy_ping_based_connection_checking.set(false);
798 } else if (option == kExclude) { 798 } else if (option == kExclude) {
799 net::HttpStreamFactory::add_forced_spdy_exclusion(value); 799 net::HttpStreamFactory::add_forced_spdy_exclusion(value);
800 } else if (option == kDisableCompression) { 800 } else if (option == kDisableCompression) {
801 globals_->enable_spdy_compression.set(false); 801 globals_->enable_spdy_compression.set(false);
802 } else if (option == kDisableAltProtocols) { 802 } else if (option == kDisableAltProtocols) {
803 net::HttpStreamFactory::set_use_alternate_protocols(false); 803 net::HttpStreamFactory::set_use_alternate_protocols(false);
804 } else if (option == kForceAltProtocols) { 804 } else if (option == kForceAltProtocols) {
805 net::PortAlternateProtocolPair pair; 805 net::PortAlternateProtocolPair pair;
806 pair.port = 443; 806 pair.port = 443;
807 pair.protocol = net::NPN_SPDY_2; 807 pair.protocol = net::NPN_SPDY_3;
808 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair); 808 net::HttpServerPropertiesImpl::ForceAlternateProtocol(pair);
809 } else if (option == kSingleDomain) { 809 } else if (option == kSingleDomain) {
810 DLOG(INFO) << "FORCING SINGLE DOMAIN"; 810 DLOG(INFO) << "FORCING SINGLE DOMAIN";
811 globals_->force_spdy_single_domain.set(true); 811 globals_->force_spdy_single_domain.set(true);
812 } else if (option == kInitialMaxConcurrentStreams) { 812 } else if (option == kInitialMaxConcurrentStreams) {
813 int streams; 813 int streams;
814 if (base::StringToInt(value, &streams)) 814 if (base::StringToInt(value, &streams))
815 globals_->initial_max_spdy_concurrent_streams.set(streams); 815 globals_->initial_max_spdy_concurrent_streams.set(streams);
816 } else if (option.empty() && it == spdy_options.begin()) { 816 } else if (option.empty() && it == spdy_options.begin()) {
817 continue; 817 continue;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 if (command_line.HasSwitch(switches::kDisableQuicHttps)) 1037 if (command_line.HasSwitch(switches::kDisableQuicHttps))
1038 return false; 1038 return false;
1039 1039
1040 if (command_line.HasSwitch(switches::kEnableQuicHttps)) 1040 if (command_line.HasSwitch(switches::kEnableQuicHttps))
1041 return true; 1041 return true;
1042 1042
1043 // HTTPS over QUIC should only be enabled if we are in the https 1043 // HTTPS over QUIC should only be enabled if we are in the https
1044 // field trial group. 1044 // field trial group.
1045 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; 1045 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName;
1046 } 1046 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/net/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698