| 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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 } | 1018 } |
| 1019 | 1019 |
| 1020 globals->next_protos.clear(); | 1020 globals->next_protos.clear(); |
| 1021 globals->next_protos.push_back(net::kProtoHTTP11); | 1021 globals->next_protos.push_back(net::kProtoHTTP11); |
| 1022 bool enable_quic = false; | 1022 bool enable_quic = false; |
| 1023 globals->enable_quic.CopyToIfSet(&enable_quic); | 1023 globals->enable_quic.CopyToIfSet(&enable_quic); |
| 1024 if (enable_quic) { | 1024 if (enable_quic) { |
| 1025 globals->next_protos.push_back(net::kProtoQUIC1SPDY3); | 1025 globals->next_protos.push_back(net::kProtoQUIC1SPDY3); |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 if (command_line.HasSwitch(switches::kEnableSpdy4)) { | |
| 1029 globals->next_protos.push_back(net::kProtoSPDY31); | |
| 1030 globals->next_protos.push_back(net::kProtoSPDY4_14); | |
| 1031 globals->next_protos.push_back(net::kProtoSPDY4); | |
| 1032 globals->use_alternate_protocols.set(true); | |
| 1033 return; | |
| 1034 } | |
| 1035 if (command_line.HasSwitch(switches::kEnableNpnHttpOnly)) { | |
| 1036 globals->use_alternate_protocols.set(false); | |
| 1037 return; | |
| 1038 } | |
| 1039 | |
| 1040 // No SPDY command-line flags have been specified. Examine trial groups. | 1028 // No SPDY command-line flags have been specified. Examine trial groups. |
| 1041 if (spdy_trial_group.starts_with(kSpdyFieldTrialHoldbackGroupNamePrefix)) { | 1029 if (spdy_trial_group.starts_with(kSpdyFieldTrialHoldbackGroupNamePrefix)) { |
| 1042 net::HttpStreamFactory::set_spdy_enabled(false); | 1030 net::HttpStreamFactory::set_spdy_enabled(false); |
| 1043 return; | 1031 return; |
| 1044 } | 1032 } |
| 1045 if (spdy_trial_group.starts_with(kSpdyFieldTrialSpdy31GroupNamePrefix)) { | 1033 if (spdy_trial_group.starts_with(kSpdyFieldTrialSpdy31GroupNamePrefix)) { |
| 1046 globals->next_protos.push_back(net::kProtoSPDY31); | 1034 globals->next_protos.push_back(net::kProtoSPDY31); |
| 1047 globals->use_alternate_protocols.set(true); | 1035 globals->use_alternate_protocols.set(true); |
| 1048 return; | 1036 return; |
| 1049 } | 1037 } |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1632 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1645 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1633 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1646 net::QuicVersion version = supported_versions[i]; | 1634 net::QuicVersion version = supported_versions[i]; |
| 1647 if (net::QuicVersionToString(version) == quic_version) { | 1635 if (net::QuicVersionToString(version) == quic_version) { |
| 1648 return version; | 1636 return version; |
| 1649 } | 1637 } |
| 1650 } | 1638 } |
| 1651 | 1639 |
| 1652 return net::QUIC_VERSION_UNSUPPORTED; | 1640 return net::QUIC_VERSION_UNSUPPORTED; |
| 1653 } | 1641 } |
| OLD | NEW |