| 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 "net/quic/core/quic_versions.h" | 5 #include "net/quic/core/quic_versions.h" |
| 6 | 6 |
| 7 #include "net/quic/core/quic_error_codes.h" | 7 #include "net/quic/core/quic_error_codes.h" |
| 8 #include "net/quic/core/quic_flags.h" | 8 #include "net/quic/core/quic_flags.h" |
| 9 #include "net/quic/core/quic_tag.h" | 9 #include "net/quic/core/quic_tag.h" |
| 10 #include "net/quic/core/quic_types.h" | 10 #include "net/quic/core/quic_types.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 QuicVersionVector CurrentSupportedVersions() { | 25 QuicVersionVector CurrentSupportedVersions() { |
| 26 return FilterSupportedVersions(AllSupportedVersions()); | 26 return FilterSupportedVersions(AllSupportedVersions()); |
| 27 } | 27 } |
| 28 | 28 |
| 29 QuicVersionVector FilterSupportedVersions(QuicVersionVector versions) { | 29 QuicVersionVector FilterSupportedVersions(QuicVersionVector versions) { |
| 30 QuicVersionVector filtered_versions(versions.size()); | 30 QuicVersionVector filtered_versions(versions.size()); |
| 31 filtered_versions.clear(); // Guaranteed by spec not to change capacity. | 31 filtered_versions.clear(); // Guaranteed by spec not to change capacity. |
| 32 for (QuicVersion version : versions) { | 32 for (QuicVersion version : versions) { |
| 33 if (version == QUIC_VERSION_38) { | 33 if (version == QUIC_VERSION_38) { |
| 34 if (FLAGS_quic_enable_version_38 && | 34 if (FLAGS_quic_reloadable_flag_quic_enable_version_38 && |
| 35 FLAGS_quic_reloadable_flag_quic_enable_version_37 && | 35 FLAGS_quic_reloadable_flag_quic_enable_version_37 && |
| 36 FLAGS_quic_reloadable_flag_quic_enable_version_36_v3) { | 36 FLAGS_quic_reloadable_flag_quic_enable_version_36_v3) { |
| 37 filtered_versions.push_back(version); | 37 filtered_versions.push_back(version); |
| 38 } | 38 } |
| 39 } else if (version == QUIC_VERSION_37) { | 39 } else if (version == QUIC_VERSION_37) { |
| 40 if (FLAGS_quic_reloadable_flag_quic_enable_version_37 && | 40 if (FLAGS_quic_reloadable_flag_quic_enable_version_37 && |
| 41 FLAGS_quic_reloadable_flag_quic_enable_version_36_v3) { | 41 FLAGS_quic_reloadable_flag_quic_enable_version_36_v3) { |
| 42 filtered_versions.push_back(version); | 42 filtered_versions.push_back(version); |
| 43 } | 43 } |
| 44 } else if (version == QUIC_VERSION_36) { | 44 } else if (version == QUIC_VERSION_36) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 for (size_t i = 0; i < versions.size(); ++i) { | 120 for (size_t i = 0; i < versions.size(); ++i) { |
| 121 if (i != 0) { | 121 if (i != 0) { |
| 122 result.append(","); | 122 result.append(","); |
| 123 } | 123 } |
| 124 result.append(QuicVersionToString(versions[i])); | 124 result.append(QuicVersionToString(versions[i])); |
| 125 } | 125 } |
| 126 return result; | 126 return result; |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace net | 129 } // namespace net |
| OLD | NEW |