Index: net/quic/core/quic_protocol.h |
diff --git a/net/quic/core/quic_protocol.h b/net/quic/core/quic_protocol.h |
index ff3ed3551a02ca358e51b56976f8a9edfe810652..7d88cad679e162dff818b651a5a77b6b9fa60365 100644 |
--- a/net/quic/core/quic_protocol.h |
+++ b/net/quic/core/quic_protocol.h |
@@ -32,6 +32,7 @@ |
#include "net/quic/core/quic_constants.h" |
#include "net/quic/core/quic_time.h" |
#include "net/quic/core/quic_types.h" |
+#include "net/quic/core/quic_versions.h" |
namespace net { |
@@ -168,76 +169,6 @@ enum QuicPacketPrivateFlags { |
PACKET_PRIVATE_FLAGS_MAX = (1 << 1) - 1 |
}; |
-// The available versions of QUIC. Guaranteed that the integer value of the enum |
-// will match the version number. |
-// When adding a new version to this enum you should add it to |
-// kSupportedQuicVersions (if appropriate), and also add a new case to the |
-// helper methods QuicVersionToQuicTag, QuicTagToQuicVersion, and |
-// QuicVersionToString. |
-enum QuicVersion { |
- // Special case to indicate unknown/unsupported QUIC version. |
- QUIC_VERSION_UNSUPPORTED = 0, |
- |
- QUIC_VERSION_32 = 32, // FEC related fields are removed from wire format. |
- QUIC_VERSION_33 = 33, // Adds diversification nonces. |
- QUIC_VERSION_34 = 34, // Deprecates entropy, removes private flag from packet |
- // header, uses new ack and stop waiting wire format. |
- QUIC_VERSION_35 = 35, // Allows endpoints to independently set stream limit. |
- QUIC_VERSION_36 = 36, // Add support to force HOL blocking. |
- |
- // IMPORTANT: if you are adding to this std::list, follow the instructions at |
- // http://sites/quic/adding-and-removing-versions |
-}; |
- |
-// This vector contains QUIC versions which we currently support. |
-// This should be ordered such that the highest supported version is the first |
-// element, with subsequent elements in descending order (versions can be |
-// skipped as necessary). |
-// |
-// IMPORTANT: if you are adding to this list, follow the instructions at |
-// http://sites/quic/adding-and-removing-versions |
-static const QuicVersion kSupportedQuicVersions[] = { |
- QUIC_VERSION_36, QUIC_VERSION_35, QUIC_VERSION_34, QUIC_VERSION_33, |
- QUIC_VERSION_32}; |
- |
-typedef std::vector<QuicVersion> QuicVersionVector; |
- |
-// Returns a vector of QUIC versions in kSupportedQuicVersions. |
-NET_EXPORT_PRIVATE QuicVersionVector AllSupportedVersions(); |
- |
-// Returns a vector of QUIC versions from kSupportedQuicVersions which exclude |
-// any versions which are disabled by flags. |
-NET_EXPORT_PRIVATE QuicVersionVector CurrentSupportedVersions(); |
- |
-// Returns a vector of QUIC versions from |versions| which exclude any versions |
-// which are disabled by flags. |
-NET_EXPORT_PRIVATE QuicVersionVector |
-FilterSupportedVersions(QuicVersionVector versions); |
- |
-// Returns QUIC version of |index| in result of |versions|. Returns |
-// QUIC_VERSION_UNSUPPORTED if |index| is out of bounds. |
-NET_EXPORT_PRIVATE QuicVersionVector |
-VersionOfIndex(const QuicVersionVector& versions, int index); |
- |
-// QuicTag is written to and read from the wire, but we prefer to use |
-// the more readable QuicVersion at other levels. |
-// Helper function which translates from a QuicVersion to a QuicTag. Returns 0 |
-// if QuicVersion is unsupported. |
-NET_EXPORT_PRIVATE QuicTag QuicVersionToQuicTag(const QuicVersion version); |
- |
-// Returns appropriate QuicVersion from a QuicTag. |
-// Returns QUIC_VERSION_UNSUPPORTED if version_tag cannot be understood. |
-NET_EXPORT_PRIVATE QuicVersion QuicTagToQuicVersion(const QuicTag version_tag); |
- |
-// Helper function which translates from a QuicVersion to a string. |
-// Returns strings corresponding to enum names (e.g. QUIC_VERSION_6). |
-NET_EXPORT_PRIVATE std::string QuicVersionToString(const QuicVersion version); |
- |
-// Returns comma separated list of string representations of QuicVersion enum |
-// values in the supplied |versions| vector. |
-NET_EXPORT_PRIVATE std::string QuicVersionVectorToString( |
- const QuicVersionVector& versions); |
- |
// Version and Crypto tags are written to the wire with a big-endian |
// representation of the name of the tag. For example |
// the client hello tag (CHLO) will be written as the |