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

Unified Diff: net/spdy/spdy_protocol.h

Issue 288373004: Add handling + parsing for HTTP/2 ALTSVC frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Non-static initializer fixes. Created 6 years, 7 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 fbd922475b1348e37e5068b82ecde21ea0f57154..a2f4832665cdf58df7270ac3a44b73b25073e3c0 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -287,12 +287,13 @@ enum SpdyFrameType {
BLOCKED,
PUSH_PROMISE,
CONTINUATION,
- LAST_CONTROL_TYPE = CONTINUATION
+ ALTSVC,
+ LAST_CONTROL_TYPE = ALTSVC
};
// Flags on data packets.
enum SpdyDataFlags {
-DATA_FLAG_NONE = 0x00,
+ DATA_FLAG_NONE = 0x00,
DATA_FLAG_FIN = 0x01,
DATA_FLAG_END_SEGMENT = 0x02,
DATA_FLAG_PAD_LOW = 0x10,
@@ -408,6 +409,8 @@ typedef std::map<std::string, std::string> SpdyNameValueBlock;
typedef uint64 SpdyPingId;
+typedef std::string SpdyProtocolId;
+
// TODO(hkhalil): Add direct testing for this? It won't increase coverage any,
// but is good to do anyway.
class NET_EXPORT_PRIVATE SpdyConstants {
@@ -915,6 +918,41 @@ class NET_EXPORT_PRIVATE SpdyContinuationIR
DISALLOW_COPY_AND_ASSIGN(SpdyContinuationIR);
};
+class NET_EXPORT_PRIVATE SpdyAltSvcIR : public SpdyFrameWithStreamIdIR {
+ public:
+ explicit SpdyAltSvcIR(SpdyStreamId stream_id);
+
+ uint32 max_age() const { return max_age_; }
+ uint16 port() const { return port_; }
+ SpdyProtocolId protocol_id() const {
+ return protocol_id_;
+ }
+ std::string host() const { return host_; }
+ std::string origin() const { return origin_; }
+
+ void set_max_age(uint32 max_age) { max_age_ = max_age; }
+ void set_port(uint16 port) { port_ = port; }
+ void set_protocol_id(SpdyProtocolId protocol_id) {
+ protocol_id_ = protocol_id;
+ }
+ void set_host(std::string host) {
+ host_ = host;
+ }
+ void set_origin(std::string origin) {
+ origin_ = origin;
+ }
+
+ virtual void Visit(SpdyFrameVisitor* visitor) const OVERRIDE;
+
+ private:
+ uint32 max_age_;
+ uint16 port_;
+ SpdyProtocolId protocol_id_;
+ std::string host_;
+ std::string origin_;
+ DISALLOW_COPY_AND_ASSIGN(SpdyAltSvcIR);
+};
+
// -------------------------------------------------------------------------
// Wrapper classes for various SPDY frames.
@@ -975,6 +1013,7 @@ class SpdyFrameVisitor {
virtual void VisitBlocked(const SpdyBlockedIR& blocked) = 0;
virtual void VisitPushPromise(const SpdyPushPromiseIR& push_promise) = 0;
virtual void VisitContinuation(const SpdyContinuationIR& continuation) = 0;
+ virtual void VisitAltSvc(const SpdyAltSvcIR& altsvc) = 0;
virtual void VisitData(const SpdyDataIR& data) = 0;
protected:
« 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