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

Unified Diff: net/spdy/spdy_protocol.h

Issue 247243003: SPDY: Use SpdyMajorVersion rather than ints for SPDY version number. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Also include cr/64899106 Created 6 years, 8 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/spdy/spdy_framer_test.cc ('k') | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_protocol.h
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h
index 4f84ee9321d8cdc6d5d4fbd323897d15d5ebcbf4..236836a84b4f0ebf9b63a9b8187e6179d3ceb695 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -28,14 +28,15 @@ namespace net {
// The major versions of SPDY. Major version differences indicate
// framer-layer incompatibility, as opposed to minor version numbers
-// which indicate application-layer incompatibility. It is guaranteed
-// that the enum value SPDYn maps to the integer n.
+// which indicate application-layer incompatibility. Do not rely on
+// the mapping from enum value SPDYn to the integer n.
enum SpdyMajorVersion {
SPDY2 = 2,
SPDY_MIN_VERSION = SPDY2,
SPDY3 = 3,
SPDY4 = 4,
- SPDY_MAX_VERSION = SPDY4
+ SPDY5 = 5,
+ SPDY_MAX_VERSION = SPDY5
};
// A SPDY stream id is a 31 bit entity.
@@ -490,6 +491,12 @@ class NET_EXPORT_PRIVATE SpdyConstants {
static size_t GetPrefixLength(SpdyFrameType type, SpdyMajorVersion version);
static size_t GetFrameMaximumSize(SpdyMajorVersion version);
+
+ static SpdyMajorVersion ParseMajorVersion(int version_number);
+
+ static int SerializeMajorVersion(SpdyMajorVersion version);
+
+ static std::string GetVersionString(SpdyMajorVersion version);
};
class SpdyFrame;
« no previous file with comments | « net/spdy/spdy_framer_test.cc ('k') | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698