Cast: Skip receiver log messages with time delta that can't be encoded.
[chromium-blink-merge.git] / net / spdy / hpack_constants.h
blobecae49ea6ec7ddd7459beae9338177aab41aa4e8
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_
8 #include <vector>
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
16 namespace net {
18 // An HpackPrefix signifies |bits| stored in the top |bit_size| bits
19 // of an octet.
20 struct HpackPrefix {
21 uint8 bits;
22 size_t bit_size;
25 // Represents a symbol and its Huffman code (stored in most-significant bits).
26 struct HpackHuffmanSymbol {
27 uint32 code;
28 uint8 length;
29 uint16 id;
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
44 // 4.3.1).
45 const HpackPrefix kLiteralNoIndexOpcode = { 0x01, 2 };
47 // The opcode for a literal header field with incremental indexing
48 // (from 4.3.2).
49 const HpackPrefix kLiteralIncrementalIndexOpcode = { 0x00, 2 };
51 // Returns symbol code table from "Appendix C. Huffman Codes".
52 NET_EXPORT_PRIVATE std::vector<HpackHuffmanSymbol> HpackHuffmanCode();
54 } // namespace net
56 #endif // NET_SPDY_HPACK_CONSTANTS_H_