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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_protocol.cc
diff --git a/net/quic/core/quic_protocol.cc b/net/quic/core/quic_protocol.cc
index 6b87945897085e047f28d136d11da8e21ca96c29..20e64fafd3276c4819b53ce549d10c196954a5ed 100644
--- a/net/quic/core/quic_protocol.cc
+++ b/net/quic/core/quic_protocol.cc
@@ -198,6 +198,17 @@ QuicVersionVector FilterSupportedVersions(QuicVersionVector versions) {
return filtered_versions;
}
+QuicVersionVector VersionOfIndex(const QuicVersionVector& versions, int index) {
+ QuicVersionVector version;
+ int version_count = versions.size();
+ if (index >= 0 && index < version_count) {
+ version.push_back(versions[index]);
+ } else {
+ version.push_back(QUIC_VERSION_UNSUPPORTED);
+ }
+ return version;
+}
+
QuicTag QuicVersionToQuicTag(const QuicVersion version) {
switch (version) {
case QUIC_VERSION_30:
« 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