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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 if (command_line.HasSwitch(switches::kUseSpdy)) { | 726 if (command_line.HasSwitch(switches::kUseSpdy)) { |
727 std::string spdy_mode = | 727 std::string spdy_mode = |
728 command_line.GetSwitchValueASCII(switches::kUseSpdy); | 728 command_line.GetSwitchValueASCII(switches::kUseSpdy); |
729 EnableSpdy(spdy_mode); | 729 EnableSpdy(spdy_mode); |
730 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { | 730 } else if (command_line.HasSwitch(switches::kEnableHttp2Draft04)) { |
731 net::HttpStreamFactory::EnableNpnHttp2Draft04(); | 731 net::HttpStreamFactory::EnableNpnHttp2Draft04(); |
732 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { | 732 } else if (command_line.HasSwitch(switches::kEnableSpdy4a2)) { |
733 net::HttpStreamFactory::EnableNpnSpdy4a2(); | 733 net::HttpStreamFactory::EnableNpnSpdy4a2(); |
734 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { | 734 } else if (command_line.HasSwitch(switches::kDisableSpdy31)) { |
735 net::HttpStreamFactory::EnableNpnSpdy3(); | 735 net::HttpStreamFactory::EnableNpnSpdy3(); |
736 } else if (command_line.HasSwitch(switches::kDisableSpdy2)) { | 736 } else if (command_line.HasSwitch(switches::kEnableSpdy2)) { |
737 net::HttpStreamFactory::EnableNpnSpdy31(); | 737 net::HttpStreamFactory::EnableNpnSpdy31WithSpdy2(); |
738 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { | 738 } else if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { |
739 net::HttpStreamFactory::EnableNpnHttpOnly(); | 739 net::HttpStreamFactory::EnableNpnHttpOnly(); |
740 } else { | 740 } else { |
741 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && | 741 if (spdy_trial_group == kSpdyFieldTrialDisabledGroupName && |
742 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 742 !command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
743 net::HttpStreamFactory::set_spdy_enabled(false); | 743 net::HttpStreamFactory::set_spdy_enabled(false); |
744 } else { | 744 } else { |
745 // Use SPDY/3.1 by default. | 745 // Use SPDY/3.1 by default. |
746 // | 746 net::HttpStreamFactory::EnableNpnSpdy31(); |
747 // TODO(akalin): Turn off SPDY/2 by default | |
748 // (http://crbug.com/318651). | |
749 net::HttpStreamFactory::EnableNpnSpdy31WithSpdy2(); | |
750 } | 747 } |
751 } | 748 } |
752 } | 749 } |
753 | 750 |
754 // TODO(rch): Make the client socket factory a per-network session | 751 // TODO(rch): Make the client socket factory a per-network session |
755 // instance, constructed from a NetworkSession::Params, to allow us | 752 // instance, constructed from a NetworkSession::Params, to allow us |
756 // to move this option to IOThread::Globals & | 753 // to move this option to IOThread::Globals & |
757 // HttpNetworkSession::Params. | 754 // HttpNetworkSession::Params. |
758 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) | 755 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) |
759 net::SetTCPFastOpenEnabled(true); | 756 net::SetTCPFastOpenEnabled(true); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 if (command_line.HasSwitch(switches::kDisableQuicHttps)) | 1028 if (command_line.HasSwitch(switches::kDisableQuicHttps)) |
1032 return false; | 1029 return false; |
1033 | 1030 |
1034 if (command_line.HasSwitch(switches::kEnableQuicHttps)) | 1031 if (command_line.HasSwitch(switches::kEnableQuicHttps)) |
1035 return true; | 1032 return true; |
1036 | 1033 |
1037 // HTTPS over QUIC should only be enabled if we are in the https | 1034 // HTTPS over QUIC should only be enabled if we are in the https |
1038 // field trial group. | 1035 // field trial group. |
1039 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; | 1036 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; |
1040 } | 1037 } |
OLD | NEW |