X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fnet%2Fspdy%2Fhpack_constants.h;h=79aa06b54a8f5a300e918a9b0593966eaacfe519;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=d413f64593ed9927aec2bb2965f28fbf03ec13d4;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/net/spdy/hpack_constants.h b/src/net/spdy/hpack_constants.h index d413f64..79aa06b 100644 --- a/src/net/spdy/hpack_constants.h +++ b/src/net/spdy/hpack_constants.h @@ -8,20 +8,32 @@ #include "base/basictypes.h" // All section references below are to -// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-04 +// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05 // . namespace net { +// An HpackPrefix signifies |bits| stored in the top |bit_size| bits +// of an octet. +struct HpackPrefix { + uint8 bits; + size_t bit_size; +}; + // The marker for a string literal that is stored unmodified (i.e., // without Huffman encoding) (from 4.1.2). -const uint8 kStringLiteralIdentityEncoded = 0x0; -const uint8 kStringLiteralIdentityEncodedSize = 1; +const HpackPrefix kStringLiteralIdentityEncoded = { 0x0, 1 }; + +// The opcode for an indexed header field (from 4.2). +const HpackPrefix kIndexedOpcode = { 0x1, 1 }; // The opcode for a literal header field without indexing (from // 4.3.1). -const uint8 kLiteralNoIndexOpcode = 0x01; -const uint8 kLiteralNoIndexOpcodeSize = 2; +const HpackPrefix kLiteralNoIndexOpcode = { 0x01, 2 }; + +// The opcode for a literal header field with incremental indexing +// (from 4.3.2). +const HpackPrefix kLiteralIncrementalIndexOpcode = { 0x00, 2 }; } // namespace net