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/quic_protocol.h" | 5 #include "net/quic/quic_protocol.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "net/quic/quic_flags.h" | 9 #include "net/quic/quic_flags.h" |
10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 for (QuicVersion version : versions) { | 185 for (QuicVersion version : versions) { |
186 if (version < QUIC_VERSION_30) { | 186 if (version < QUIC_VERSION_30) { |
187 if (!FLAGS_quic_disable_pre_30) { | 187 if (!FLAGS_quic_disable_pre_30) { |
188 filtered_versions.push_back(version); | 188 filtered_versions.push_back(version); |
189 } | 189 } |
190 } else { | 190 } else { |
191 if (version == QUIC_VERSION_35) { | 191 if (version == QUIC_VERSION_35) { |
192 if (FLAGS_quic_enable_version_35) { | 192 if (FLAGS_quic_enable_version_35) { |
193 filtered_versions.push_back(version); | 193 filtered_versions.push_back(version); |
194 } | 194 } |
| 195 } else if (version == QUIC_VERSION_36) { |
| 196 if (FLAGS_quic_enable_version_35 && FLAGS_quic_enable_version_36) { |
| 197 filtered_versions.push_back(version); |
| 198 } |
195 } else { | 199 } else { |
196 filtered_versions.push_back(version); | 200 filtered_versions.push_back(version); |
197 } | 201 } |
198 } | 202 } |
199 } | 203 } |
200 return filtered_versions; | 204 return filtered_versions; |
201 } | 205 } |
202 | 206 |
203 QuicTag QuicVersionToQuicTag(const QuicVersion version) { | 207 QuicTag QuicVersionToQuicTag(const QuicVersion version) { |
204 switch (version) { | 208 switch (version) { |
(...skipping 12 matching lines...) Expand all Loading... |
217 case QUIC_VERSION_31: | 221 case QUIC_VERSION_31: |
218 return MakeQuicTag('Q', '0', '3', '1'); | 222 return MakeQuicTag('Q', '0', '3', '1'); |
219 case QUIC_VERSION_32: | 223 case QUIC_VERSION_32: |
220 return MakeQuicTag('Q', '0', '3', '2'); | 224 return MakeQuicTag('Q', '0', '3', '2'); |
221 case QUIC_VERSION_33: | 225 case QUIC_VERSION_33: |
222 return MakeQuicTag('Q', '0', '3', '3'); | 226 return MakeQuicTag('Q', '0', '3', '3'); |
223 case QUIC_VERSION_34: | 227 case QUIC_VERSION_34: |
224 return MakeQuicTag('Q', '0', '3', '4'); | 228 return MakeQuicTag('Q', '0', '3', '4'); |
225 case QUIC_VERSION_35: | 229 case QUIC_VERSION_35: |
226 return MakeQuicTag('Q', '0', '3', '5'); | 230 return MakeQuicTag('Q', '0', '3', '5'); |
| 231 case QUIC_VERSION_36: |
| 232 return MakeQuicTag('Q', '0', '3', '6'); |
227 default: | 233 default: |
228 // This shold be an ERROR because we should never attempt to convert an | 234 // This shold be an ERROR because we should never attempt to convert an |
229 // invalid QuicVersion to be written to the wire. | 235 // invalid QuicVersion to be written to the wire. |
230 LOG(ERROR) << "Unsupported QuicVersion: " << version; | 236 LOG(ERROR) << "Unsupported QuicVersion: " << version; |
231 return 0; | 237 return 0; |
232 } | 238 } |
233 } | 239 } |
234 | 240 |
235 QuicVersion QuicTagToQuicVersion(const QuicTag version_tag) { | 241 QuicVersion QuicTagToQuicVersion(const QuicTag version_tag) { |
236 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { | 242 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { |
(...skipping 17 matching lines...) Expand all Loading... |
254 RETURN_STRING_LITERAL(QUIC_VERSION_26); | 260 RETURN_STRING_LITERAL(QUIC_VERSION_26); |
255 RETURN_STRING_LITERAL(QUIC_VERSION_27); | 261 RETURN_STRING_LITERAL(QUIC_VERSION_27); |
256 RETURN_STRING_LITERAL(QUIC_VERSION_28); | 262 RETURN_STRING_LITERAL(QUIC_VERSION_28); |
257 RETURN_STRING_LITERAL(QUIC_VERSION_29); | 263 RETURN_STRING_LITERAL(QUIC_VERSION_29); |
258 RETURN_STRING_LITERAL(QUIC_VERSION_30); | 264 RETURN_STRING_LITERAL(QUIC_VERSION_30); |
259 RETURN_STRING_LITERAL(QUIC_VERSION_31); | 265 RETURN_STRING_LITERAL(QUIC_VERSION_31); |
260 RETURN_STRING_LITERAL(QUIC_VERSION_32); | 266 RETURN_STRING_LITERAL(QUIC_VERSION_32); |
261 RETURN_STRING_LITERAL(QUIC_VERSION_33); | 267 RETURN_STRING_LITERAL(QUIC_VERSION_33); |
262 RETURN_STRING_LITERAL(QUIC_VERSION_34); | 268 RETURN_STRING_LITERAL(QUIC_VERSION_34); |
263 RETURN_STRING_LITERAL(QUIC_VERSION_35); | 269 RETURN_STRING_LITERAL(QUIC_VERSION_35); |
| 270 RETURN_STRING_LITERAL(QUIC_VERSION_36); |
264 default: | 271 default: |
265 return "QUIC_VERSION_UNSUPPORTED"; | 272 return "QUIC_VERSION_UNSUPPORTED"; |
266 } | 273 } |
267 } | 274 } |
268 | 275 |
269 string QuicVersionVectorToString(const QuicVersionVector& versions) { | 276 string QuicVersionVectorToString(const QuicVersionVector& versions) { |
270 string result = ""; | 277 string result = ""; |
271 for (size_t i = 0; i < versions.size(); ++i) { | 278 for (size_t i = 0; i < versions.size(); ++i) { |
272 if (i != 0) { | 279 if (i != 0) { |
273 result.append(","); | 280 result.append(","); |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 is_unackable(false), | 879 is_unackable(false), |
873 has_crypto_handshake(has_crypto_handshake), | 880 has_crypto_handshake(has_crypto_handshake), |
874 num_padding_bytes(num_padding_bytes), | 881 num_padding_bytes(num_padding_bytes), |
875 retransmission(0) {} | 882 retransmission(0) {} |
876 | 883 |
877 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; | 884 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; |
878 | 885 |
879 TransmissionInfo::~TransmissionInfo() {} | 886 TransmissionInfo::~TransmissionInfo() {} |
880 | 887 |
881 } // namespace net | 888 } // namespace net |
OLD | NEW |