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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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: | 162 case QUIC_VERSION_16: |
163 return MakeQuicTag('Q', '0', '1', '6'); | 163 return MakeQuicTag('Q', '0', '1', '6'); |
164 case QUIC_VERSION_18: | 164 case QUIC_VERSION_18: |
165 return MakeQuicTag('Q', '0', '1', '8'); | 165 return MakeQuicTag('Q', '0', '1', '8'); |
166 case QUIC_VERSION_19: | 166 case QUIC_VERSION_19: |
167 return MakeQuicTag('Q', '0', '1', '9'); | 167 return MakeQuicTag('Q', '0', '1', '9'); |
168 case QUIC_VERSION_20: | |
169 return MakeQuicTag('Q', '0', '2', '0'); | |
170 case QUIC_VERSION_21: | 168 case QUIC_VERSION_21: |
171 return MakeQuicTag('Q', '0', '2', '1'); | 169 return MakeQuicTag('Q', '0', '2', '1'); |
172 case QUIC_VERSION_22: | 170 case QUIC_VERSION_22: |
173 return MakeQuicTag('Q', '0', '2', '2'); | 171 return MakeQuicTag('Q', '0', '2', '2'); |
174 case QUIC_VERSION_23: | 172 case QUIC_VERSION_23: |
175 return MakeQuicTag('Q', '0', '2', '3'); | 173 return MakeQuicTag('Q', '0', '2', '3'); |
176 default: | 174 default: |
177 // This shold be an ERROR because we should never attempt to convert an | 175 // This shold be an ERROR because we should never attempt to convert an |
178 // invalid QuicVersion to be written to the wire. | 176 // invalid QuicVersion to be written to the wire. |
179 LOG(ERROR) << "Unsupported QuicVersion: " << version; | 177 LOG(ERROR) << "Unsupported QuicVersion: " << version; |
(...skipping 15 matching lines...) Expand all Loading... |
195 | 193 |
196 #define RETURN_STRING_LITERAL(x) \ | 194 #define RETURN_STRING_LITERAL(x) \ |
197 case x: \ | 195 case x: \ |
198 return #x | 196 return #x |
199 | 197 |
200 string QuicVersionToString(const QuicVersion version) { | 198 string QuicVersionToString(const QuicVersion version) { |
201 switch (version) { | 199 switch (version) { |
202 RETURN_STRING_LITERAL(QUIC_VERSION_16); | 200 RETURN_STRING_LITERAL(QUIC_VERSION_16); |
203 RETURN_STRING_LITERAL(QUIC_VERSION_18); | 201 RETURN_STRING_LITERAL(QUIC_VERSION_18); |
204 RETURN_STRING_LITERAL(QUIC_VERSION_19); | 202 RETURN_STRING_LITERAL(QUIC_VERSION_19); |
205 RETURN_STRING_LITERAL(QUIC_VERSION_20); | |
206 RETURN_STRING_LITERAL(QUIC_VERSION_21); | 203 RETURN_STRING_LITERAL(QUIC_VERSION_21); |
207 RETURN_STRING_LITERAL(QUIC_VERSION_22); | 204 RETURN_STRING_LITERAL(QUIC_VERSION_22); |
208 RETURN_STRING_LITERAL(QUIC_VERSION_23); | 205 RETURN_STRING_LITERAL(QUIC_VERSION_23); |
209 default: | 206 default: |
210 return "QUIC_VERSION_UNSUPPORTED"; | 207 return "QUIC_VERSION_UNSUPPORTED"; |
211 } | 208 } |
212 } | 209 } |
213 | 210 |
214 string QuicVersionVectorToString(const QuicVersionVector& versions) { | 211 string QuicVersionVectorToString(const QuicVersionVector& versions) { |
215 string result = ""; | 212 string result = ""; |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 : retransmittable_frames(retransmittable_frames), | 741 : retransmittable_frames(retransmittable_frames), |
745 sequence_number_length(sequence_number_length), | 742 sequence_number_length(sequence_number_length), |
746 sent_time(QuicTime::Zero()), | 743 sent_time(QuicTime::Zero()), |
747 bytes_sent(0), | 744 bytes_sent(0), |
748 nack_count(0), | 745 nack_count(0), |
749 transmission_type(transmission_type), | 746 transmission_type(transmission_type), |
750 all_transmissions(all_transmissions), | 747 all_transmissions(all_transmissions), |
751 in_flight(false) {} | 748 in_flight(false) {} |
752 | 749 |
753 } // namespace net | 750 } // namespace net |
OLD | NEW |