| 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_flags.h" | 8 #include "net/quic/quic_flags.h" |
| 9 #include "net/quic/quic_utils.h" | 9 #include "net/quic/quic_utils.h" |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 QuicTag QuicVersionToQuicTag(const QuicVersion version) { | 131 QuicTag QuicVersionToQuicTag(const QuicVersion version) { |
| 132 switch (version) { | 132 switch (version) { |
| 133 case QUIC_VERSION_24: | 133 case QUIC_VERSION_24: |
| 134 return MakeQuicTag('Q', '0', '2', '4'); | 134 return MakeQuicTag('Q', '0', '2', '4'); |
| 135 case QUIC_VERSION_25: | 135 case QUIC_VERSION_25: |
| 136 return MakeQuicTag('Q', '0', '2', '5'); | 136 return MakeQuicTag('Q', '0', '2', '5'); |
| 137 case QUIC_VERSION_26: | 137 case QUIC_VERSION_26: |
| 138 return MakeQuicTag('Q', '0', '2', '6'); | 138 return MakeQuicTag('Q', '0', '2', '6'); |
| 139 case QUIC_VERSION_27: | 139 case QUIC_VERSION_27: |
| 140 return MakeQuicTag('Q', '0', '2', '7'); | 140 return MakeQuicTag('Q', '0', '2', '7'); |
| 141 case QUIC_VERSION_28: |
| 142 return MakeQuicTag('Q', '0', '2', '8'); |
| 141 default: | 143 default: |
| 142 // This shold be an ERROR because we should never attempt to convert an | 144 // This shold be an ERROR because we should never attempt to convert an |
| 143 // invalid QuicVersion to be written to the wire. | 145 // invalid QuicVersion to be written to the wire. |
| 144 LOG(ERROR) << "Unsupported QuicVersion: " << version; | 146 LOG(ERROR) << "Unsupported QuicVersion: " << version; |
| 145 return 0; | 147 return 0; |
| 146 } | 148 } |
| 147 } | 149 } |
| 148 | 150 |
| 149 QuicVersion QuicTagToQuicVersion(const QuicTag version_tag) { | 151 QuicVersion QuicTagToQuicVersion(const QuicTag version_tag) { |
| 150 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { | 152 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 161 #define RETURN_STRING_LITERAL(x) \ | 163 #define RETURN_STRING_LITERAL(x) \ |
| 162 case x: \ | 164 case x: \ |
| 163 return #x | 165 return #x |
| 164 | 166 |
| 165 string QuicVersionToString(const QuicVersion version) { | 167 string QuicVersionToString(const QuicVersion version) { |
| 166 switch (version) { | 168 switch (version) { |
| 167 RETURN_STRING_LITERAL(QUIC_VERSION_24); | 169 RETURN_STRING_LITERAL(QUIC_VERSION_24); |
| 168 RETURN_STRING_LITERAL(QUIC_VERSION_25); | 170 RETURN_STRING_LITERAL(QUIC_VERSION_25); |
| 169 RETURN_STRING_LITERAL(QUIC_VERSION_26); | 171 RETURN_STRING_LITERAL(QUIC_VERSION_26); |
| 170 RETURN_STRING_LITERAL(QUIC_VERSION_27); | 172 RETURN_STRING_LITERAL(QUIC_VERSION_27); |
| 173 RETURN_STRING_LITERAL(QUIC_VERSION_28); |
| 171 default: | 174 default: |
| 172 return "QUIC_VERSION_UNSUPPORTED"; | 175 return "QUIC_VERSION_UNSUPPORTED"; |
| 173 } | 176 } |
| 174 } | 177 } |
| 175 | 178 |
| 176 string QuicVersionVectorToString(const QuicVersionVector& versions) { | 179 string QuicVersionVectorToString(const QuicVersionVector& versions) { |
| 177 string result = ""; | 180 string result = ""; |
| 178 for (size_t i = 0; i < versions.size(); ++i) { | 181 for (size_t i = 0; i < versions.size(); ++i) { |
| 179 if (i != 0) { | 182 if (i != 0) { |
| 180 result.append(","); | 183 result.append(","); |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 sent_time(sent_time), | 911 sent_time(sent_time), |
| 909 bytes_sent(bytes_sent), | 912 bytes_sent(bytes_sent), |
| 910 nack_count(0), | 913 nack_count(0), |
| 911 transmission_type(transmission_type), | 914 transmission_type(transmission_type), |
| 912 all_transmissions(nullptr), | 915 all_transmissions(nullptr), |
| 913 in_flight(false), | 916 in_flight(false), |
| 914 is_unackable(false), | 917 is_unackable(false), |
| 915 is_fec_packet(is_fec_packet) {} | 918 is_fec_packet(is_fec_packet) {} |
| 916 | 919 |
| 917 } // namespace net | 920 } // namespace net |
| OLD | NEW |