| 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 "net/quic/quic_utils.h" | 8 #include "net/quic/quic_utils.h" |
| 9 | 9 |
| 10 using base::StringPiece; | 10 using base::StringPiece; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 QuicVersionVector QuicSupportedVersions() { | 152 QuicVersionVector QuicSupportedVersions() { |
| 153 QuicVersionVector supported_versions; | 153 QuicVersionVector supported_versions; |
| 154 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { | 154 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { |
| 155 supported_versions.push_back(kSupportedQuicVersions[i]); | 155 supported_versions.push_back(kSupportedQuicVersions[i]); |
| 156 } | 156 } |
| 157 return supported_versions; | 157 return supported_versions; |
| 158 } | 158 } |
| 159 | 159 |
| 160 QuicTag QuicVersionToQuicTag(const QuicVersion version) { | 160 QuicTag QuicVersionToQuicTag(const QuicVersion version) { |
| 161 switch (version) { | 161 switch (version) { |
| 162 case QUIC_VERSION_16: | |
| 163 return MakeQuicTag('Q', '0', '1', '6'); | |
| 164 case QUIC_VERSION_18: | 162 case QUIC_VERSION_18: |
| 165 return MakeQuicTag('Q', '0', '1', '8'); | 163 return MakeQuicTag('Q', '0', '1', '8'); |
| 166 case QUIC_VERSION_19: | 164 case QUIC_VERSION_19: |
| 167 return MakeQuicTag('Q', '0', '1', '9'); | 165 return MakeQuicTag('Q', '0', '1', '9'); |
| 168 case QUIC_VERSION_21: | 166 case QUIC_VERSION_21: |
| 169 return MakeQuicTag('Q', '0', '2', '1'); | 167 return MakeQuicTag('Q', '0', '2', '1'); |
| 170 case QUIC_VERSION_22: | 168 case QUIC_VERSION_22: |
| 171 return MakeQuicTag('Q', '0', '2', '2'); | 169 return MakeQuicTag('Q', '0', '2', '2'); |
| 172 case QUIC_VERSION_23: | 170 case QUIC_VERSION_23: |
| 173 return MakeQuicTag('Q', '0', '2', '3'); | 171 return MakeQuicTag('Q', '0', '2', '3'); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 190 << QuicUtils::TagToString(version_tag); | 188 << QuicUtils::TagToString(version_tag); |
| 191 return QUIC_VERSION_UNSUPPORTED; | 189 return QUIC_VERSION_UNSUPPORTED; |
| 192 } | 190 } |
| 193 | 191 |
| 194 #define RETURN_STRING_LITERAL(x) \ | 192 #define RETURN_STRING_LITERAL(x) \ |
| 195 case x: \ | 193 case x: \ |
| 196 return #x | 194 return #x |
| 197 | 195 |
| 198 string QuicVersionToString(const QuicVersion version) { | 196 string QuicVersionToString(const QuicVersion version) { |
| 199 switch (version) { | 197 switch (version) { |
| 200 RETURN_STRING_LITERAL(QUIC_VERSION_16); | |
| 201 RETURN_STRING_LITERAL(QUIC_VERSION_18); | 198 RETURN_STRING_LITERAL(QUIC_VERSION_18); |
| 202 RETURN_STRING_LITERAL(QUIC_VERSION_19); | 199 RETURN_STRING_LITERAL(QUIC_VERSION_19); |
| 203 RETURN_STRING_LITERAL(QUIC_VERSION_21); | 200 RETURN_STRING_LITERAL(QUIC_VERSION_21); |
| 204 RETURN_STRING_LITERAL(QUIC_VERSION_22); | 201 RETURN_STRING_LITERAL(QUIC_VERSION_22); |
| 205 RETURN_STRING_LITERAL(QUIC_VERSION_23); | 202 RETURN_STRING_LITERAL(QUIC_VERSION_23); |
| 206 default: | 203 default: |
| 207 return "QUIC_VERSION_UNSUPPORTED"; | 204 return "QUIC_VERSION_UNSUPPORTED"; |
| 208 } | 205 } |
| 209 } | 206 } |
| 210 | 207 |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 sequence_number_length(sequence_number_length), | 741 sequence_number_length(sequence_number_length), |
| 745 sent_time(QuicTime::Zero()), | 742 sent_time(QuicTime::Zero()), |
| 746 bytes_sent(0), | 743 bytes_sent(0), |
| 747 nack_count(0), | 744 nack_count(0), |
| 748 transmission_type(transmission_type), | 745 transmission_type(transmission_type), |
| 749 all_transmissions(all_transmissions), | 746 all_transmissions(all_transmissions), |
| 750 in_flight(false), | 747 in_flight(false), |
| 751 is_unackable(false) {} | 748 is_unackable(false) {} |
| 752 | 749 |
| 753 } // namespace net | 750 } // namespace net |
| OLD | NEW |