Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: net/quic/quic_protocol.cc

Issue 2104633002: Landing recent QUIC changes until 6/24/2016 14:00 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { 176 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) {
177 supported_versions.push_back(kSupportedQuicVersions[i]); 177 supported_versions.push_back(kSupportedQuicVersions[i]);
178 } 178 }
179 return supported_versions; 179 return supported_versions;
180 } 180 }
181 181
182 QuicVersionVector FilterSupportedVersions(QuicVersionVector versions) { 182 QuicVersionVector FilterSupportedVersions(QuicVersionVector versions) {
183 QuicVersionVector filtered_versions(versions.size()); 183 QuicVersionVector filtered_versions(versions.size());
184 filtered_versions.clear(); // Guaranteed by spec not to change capacity. 184 filtered_versions.clear(); // Guaranteed by spec not to change capacity.
185 for (QuicVersion version : versions) { 185 for (QuicVersion version : versions) {
186 if (!FLAGS_quic_disable_pre_30 || version >= QUIC_VERSION_30) { 186 if (version < QUIC_VERSION_30) {
187 filtered_versions.push_back(version); 187 if (!FLAGS_quic_disable_pre_30) {
188 filtered_versions.push_back(version);
189 }
190 } else {
191 if (version == QUIC_VERSION_35) {
192 if (FLAGS_quic_enable_version_35) {
193 filtered_versions.push_back(version);
194 }
195 } else {
196 filtered_versions.push_back(version);
197 }
188 } 198 }
189 } 199 }
190 return filtered_versions; 200 return filtered_versions;
191 } 201 }
192 202
193 QuicTag QuicVersionToQuicTag(const QuicVersion version) { 203 QuicTag QuicVersionToQuicTag(const QuicVersion version) {
194 switch (version) { 204 switch (version) {
195 case QUIC_VERSION_25: 205 case QUIC_VERSION_25:
196 return MakeQuicTag('Q', '0', '2', '5'); 206 return MakeQuicTag('Q', '0', '2', '5');
197 case QUIC_VERSION_26: 207 case QUIC_VERSION_26:
198 return MakeQuicTag('Q', '0', '2', '6'); 208 return MakeQuicTag('Q', '0', '2', '6');
199 case QUIC_VERSION_27: 209 case QUIC_VERSION_27:
200 return MakeQuicTag('Q', '0', '2', '7'); 210 return MakeQuicTag('Q', '0', '2', '7');
201 case QUIC_VERSION_28: 211 case QUIC_VERSION_28:
202 return MakeQuicTag('Q', '0', '2', '8'); 212 return MakeQuicTag('Q', '0', '2', '8');
203 case QUIC_VERSION_29: 213 case QUIC_VERSION_29:
204 return MakeQuicTag('Q', '0', '2', '9'); 214 return MakeQuicTag('Q', '0', '2', '9');
205 case QUIC_VERSION_30: 215 case QUIC_VERSION_30:
206 return MakeQuicTag('Q', '0', '3', '0'); 216 return MakeQuicTag('Q', '0', '3', '0');
207 case QUIC_VERSION_31: 217 case QUIC_VERSION_31:
208 return MakeQuicTag('Q', '0', '3', '1'); 218 return MakeQuicTag('Q', '0', '3', '1');
209 case QUIC_VERSION_32: 219 case QUIC_VERSION_32:
210 return MakeQuicTag('Q', '0', '3', '2'); 220 return MakeQuicTag('Q', '0', '3', '2');
211 case QUIC_VERSION_33: 221 case QUIC_VERSION_33:
212 return MakeQuicTag('Q', '0', '3', '3'); 222 return MakeQuicTag('Q', '0', '3', '3');
213 case QUIC_VERSION_34: 223 case QUIC_VERSION_34:
214 return MakeQuicTag('Q', '0', '3', '4'); 224 return MakeQuicTag('Q', '0', '3', '4');
225 case QUIC_VERSION_35:
226 return MakeQuicTag('Q', '0', '3', '5');
215 default: 227 default:
216 // This shold be an ERROR because we should never attempt to convert an 228 // This shold be an ERROR because we should never attempt to convert an
217 // invalid QuicVersion to be written to the wire. 229 // invalid QuicVersion to be written to the wire.
218 LOG(ERROR) << "Unsupported QuicVersion: " << version; 230 LOG(ERROR) << "Unsupported QuicVersion: " << version;
219 return 0; 231 return 0;
220 } 232 }
221 } 233 }
222 234
223 QuicVersion QuicTagToQuicVersion(const QuicTag version_tag) { 235 QuicVersion QuicTagToQuicVersion(const QuicTag version_tag) {
224 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) { 236 for (size_t i = 0; i < arraysize(kSupportedQuicVersions); ++i) {
(...skipping 16 matching lines...) Expand all
241 RETURN_STRING_LITERAL(QUIC_VERSION_25); 253 RETURN_STRING_LITERAL(QUIC_VERSION_25);
242 RETURN_STRING_LITERAL(QUIC_VERSION_26); 254 RETURN_STRING_LITERAL(QUIC_VERSION_26);
243 RETURN_STRING_LITERAL(QUIC_VERSION_27); 255 RETURN_STRING_LITERAL(QUIC_VERSION_27);
244 RETURN_STRING_LITERAL(QUIC_VERSION_28); 256 RETURN_STRING_LITERAL(QUIC_VERSION_28);
245 RETURN_STRING_LITERAL(QUIC_VERSION_29); 257 RETURN_STRING_LITERAL(QUIC_VERSION_29);
246 RETURN_STRING_LITERAL(QUIC_VERSION_30); 258 RETURN_STRING_LITERAL(QUIC_VERSION_30);
247 RETURN_STRING_LITERAL(QUIC_VERSION_31); 259 RETURN_STRING_LITERAL(QUIC_VERSION_31);
248 RETURN_STRING_LITERAL(QUIC_VERSION_32); 260 RETURN_STRING_LITERAL(QUIC_VERSION_32);
249 RETURN_STRING_LITERAL(QUIC_VERSION_33); 261 RETURN_STRING_LITERAL(QUIC_VERSION_33);
250 RETURN_STRING_LITERAL(QUIC_VERSION_34); 262 RETURN_STRING_LITERAL(QUIC_VERSION_34);
263 RETURN_STRING_LITERAL(QUIC_VERSION_35);
251 default: 264 default:
252 return "QUIC_VERSION_UNSUPPORTED"; 265 return "QUIC_VERSION_UNSUPPORTED";
253 } 266 }
254 } 267 }
255 268
256 string QuicVersionVectorToString(const QuicVersionVector& versions) { 269 string QuicVersionVectorToString(const QuicVersionVector& versions) {
257 string result = ""; 270 string result = "";
258 for (size_t i = 0; i < versions.size(); ++i) { 271 for (size_t i = 0; i < versions.size(); ++i) {
259 if (i != 0) { 272 if (i != 0) {
260 result.append(","); 273 result.append(",");
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 is_unackable(false), 872 is_unackable(false),
860 has_crypto_handshake(has_crypto_handshake), 873 has_crypto_handshake(has_crypto_handshake),
861 num_padding_bytes(num_padding_bytes), 874 num_padding_bytes(num_padding_bytes),
862 retransmission(0) {} 875 retransmission(0) {}
863 876
864 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; 877 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default;
865 878
866 TransmissionInfo::~TransmissionInfo() {} 879 TransmissionInfo::~TransmissionInfo() {}
867 880
868 } // namespace net 881 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698