| 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::kEnableSpdy2)) { | 736 } else if (command_line.HasSwitch(switches::kDisableSpdy2)) { |
| 737 net::HttpStreamFactory::EnableNpnSpdy31WithSpdy2(); | 737 net::HttpStreamFactory::EnableNpnSpdy31(); |
| 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 net::HttpStreamFactory::EnableNpnSpdy31(); | 746 // |
| 747 // TODO(akalin): Turn off SPDY/2 by default |
| 748 // (http://crbug.com/318651). |
| 749 net::HttpStreamFactory::EnableNpnSpdy31WithSpdy2(); |
| 747 } | 750 } |
| 748 } | 751 } |
| 749 } | 752 } |
| 750 | 753 |
| 751 // TODO(rch): Make the client socket factory a per-network session | 754 // TODO(rch): Make the client socket factory a per-network session |
| 752 // instance, constructed from a NetworkSession::Params, to allow us | 755 // instance, constructed from a NetworkSession::Params, to allow us |
| 753 // to move this option to IOThread::Globals & | 756 // to move this option to IOThread::Globals & |
| 754 // HttpNetworkSession::Params. | 757 // HttpNetworkSession::Params. |
| 755 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) | 758 if (command_line.HasSwitch(switches::kEnableTcpFastOpen)) |
| 756 net::SetTCPFastOpenEnabled(true); | 759 net::SetTCPFastOpenEnabled(true); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 if (command_line.HasSwitch(switches::kDisableQuicHttps)) | 1031 if (command_line.HasSwitch(switches::kDisableQuicHttps)) |
| 1029 return false; | 1032 return false; |
| 1030 | 1033 |
| 1031 if (command_line.HasSwitch(switches::kEnableQuicHttps)) | 1034 if (command_line.HasSwitch(switches::kEnableQuicHttps)) |
| 1032 return true; | 1035 return true; |
| 1033 | 1036 |
| 1034 // HTTPS over QUIC should only be enabled if we are in the https | 1037 // HTTPS over QUIC should only be enabled if we are in the https |
| 1035 // field trial group. | 1038 // field trial group. |
| 1036 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; | 1039 return quic_trial_group == kQuicFieldTrialHttpsEnabledGroupName; |
| 1037 } | 1040 } |
| OLD | NEW |