Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / net / spdy / hpack_constants.h
index d413f64..79aa06b 100644 (file)
@@ -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