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

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

Issue 2220333003: Add VersionOfIndex() to quic_protocol.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@129220409
Patch Set: Created 4 years, 4 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/core/quic_protocol.h ('k') | net/quic/core/quic_protocol_test.cc » ('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/core/quic_protocol.h" 5 #include "net/quic/core/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/core/quic_flags.h" 9 #include "net/quic/core/quic_flags.h"
10 #include "net/quic/core/quic_utils.h" 10 #include "net/quic/core/quic_utils.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 if (FLAGS_quic_enable_version_35 && FLAGS_quic_enable_version_36) { 191 if (FLAGS_quic_enable_version_35 && FLAGS_quic_enable_version_36) {
192 filtered_versions.push_back(version); 192 filtered_versions.push_back(version);
193 } 193 }
194 } else { 194 } else {
195 filtered_versions.push_back(version); 195 filtered_versions.push_back(version);
196 } 196 }
197 } 197 }
198 return filtered_versions; 198 return filtered_versions;
199 } 199 }
200 200
201 QuicVersionVector VersionOfIndex(const QuicVersionVector& versions, int index) {
202 QuicVersionVector version;
203 int version_count = versions.size();
204 if (index >= 0 && index < version_count) {
205 version.push_back(versions[index]);
206 } else {
207 version.push_back(QUIC_VERSION_UNSUPPORTED);
208 }
209 return version;
210 }
211
201 QuicTag QuicVersionToQuicTag(const QuicVersion version) { 212 QuicTag QuicVersionToQuicTag(const QuicVersion version) {
202 switch (version) { 213 switch (version) {
203 case QUIC_VERSION_30: 214 case QUIC_VERSION_30:
204 return MakeQuicTag('Q', '0', '3', '0'); 215 return MakeQuicTag('Q', '0', '3', '0');
205 case QUIC_VERSION_31: 216 case QUIC_VERSION_31:
206 return MakeQuicTag('Q', '0', '3', '1'); 217 return MakeQuicTag('Q', '0', '3', '1');
207 case QUIC_VERSION_32: 218 case QUIC_VERSION_32:
208 return MakeQuicTag('Q', '0', '3', '2'); 219 return MakeQuicTag('Q', '0', '3', '2');
209 case QUIC_VERSION_33: 220 case QUIC_VERSION_33:
210 return MakeQuicTag('Q', '0', '3', '3'); 221 return MakeQuicTag('Q', '0', '3', '3');
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 is_unackable(false), 916 is_unackable(false),
906 has_crypto_handshake(has_crypto_handshake), 917 has_crypto_handshake(has_crypto_handshake),
907 num_padding_bytes(num_padding_bytes), 918 num_padding_bytes(num_padding_bytes),
908 retransmission(0) {} 919 retransmission(0) {}
909 920
910 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; 921 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default;
911 922
912 TransmissionInfo::~TransmissionInfo() {} 923 TransmissionInfo::~TransmissionInfo() {}
913 924
914 } // namespace net 925 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_protocol.h ('k') | net/quic/core/quic_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698