1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_SPDY_HPACK_CONSTANTS_H_
6 #define NET_SPDY_HPACK_CONSTANTS_H_
10 #include "base/basictypes.h"
11 #include "net/base/net_export.h"
13 // All section references below are to
14 // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-06
18 // An HpackPrefix signifies |bits| stored in the top |bit_size| bits
25 // Represents a symbol and its Huffman code (stored in most-significant bits).
26 struct HpackHuffmanSymbol
{
32 // The marker for a string literal that is stored unmodified (i.e.,
33 // without Huffman encoding) (from 4.1.2).
34 const HpackPrefix kStringLiteralIdentityEncoded
= { 0x0, 1 };
36 // The marker for a string literal that is stored with Huffman
37 // encoding (from 4.1.2).
38 const HpackPrefix kStringLiteralHuffmanEncoded
= { 0x1, 1 };
40 // The opcode for an indexed header field (from 4.2).
41 const HpackPrefix kIndexedOpcode
= { 0x1, 1 };
43 // The opcode for a literal header field without indexing (from
45 const HpackPrefix kLiteralNoIndexOpcode
= { 0x01, 2 };
47 // The opcode for a literal header field with incremental indexing
49 const HpackPrefix kLiteralIncrementalIndexOpcode
= { 0x00, 2 };
51 // Returns symbol code table from "Appendix C. Huffman Codes".
52 NET_EXPORT_PRIVATE
std::vector
<HpackHuffmanSymbol
> HpackHuffmanCode();
56 #endif // NET_SPDY_HPACK_CONSTANTS_H_