| 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_tag.h" | 8 #include "net/quic/core/quic_tag.h" |
| 9 #include "net/quic/core/quic_types.h" | 9 #include "net/quic/core/quic_types.h" |
| 10 #include "net/quic/platform/api/quic_flags.h" | 10 #include "net/quic/platform/api/quic_flags.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_39) { | 33 if (version == QUIC_VERSION_39) { |
| 34 if (GetQuicFlag(FLAGS_quic_enable_version_39) && | 34 if (FLAGS_quic_enable_version_39 && |
| 35 FLAGS_quic_reloadable_flag_quic_enable_version_38) { | 35 FLAGS_quic_reloadable_flag_quic_enable_version_38) { |
| 36 filtered_versions.push_back(version); | 36 filtered_versions.push_back(version); |
| 37 } | 37 } |
| 38 } else if (version == QUIC_VERSION_38) { | 38 } else if (version == QUIC_VERSION_38) { |
| 39 if (FLAGS_quic_reloadable_flag_quic_enable_version_38) { | 39 if (FLAGS_quic_reloadable_flag_quic_enable_version_38) { |
| 40 filtered_versions.push_back(version); | 40 filtered_versions.push_back(version); |
| 41 } | 41 } |
| 42 } else { | 42 } else { |
| 43 filtered_versions.push_back(version); | 43 filtered_versions.push_back(version); |
| 44 } | 44 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 for (size_t i = 0; i < versions.size(); ++i) { | 110 for (size_t i = 0; i < versions.size(); ++i) { |
| 111 if (i != 0) { | 111 if (i != 0) { |
| 112 result.append(","); | 112 result.append(","); |
| 113 } | 113 } |
| 114 result.append(QuicVersionToString(versions[i])); | 114 result.append(QuicVersionToString(versions[i])); |
| 115 } | 115 } |
| 116 return result; | 116 return result; |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace net | 119 } // namespace net |
| OLD | NEW |