| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_ | 5 #ifndef NET_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_ |
| 6 #define NET_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_ | 6 #define NET_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "net/base/net_export.h" | 13 #include "net/spdy/platform/api/spdy_export.h" |
| 14 | 14 |
| 15 // All section references below are to | 15 // All section references below are to |
| 16 // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-08 | 16 // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-08 |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 // An HpackPrefix signifies |bits| stored in the top |bit_size| bits | 20 // An HpackPrefix signifies |bits| stored in the top |bit_size| bits |
| 21 // of an octet. | 21 // of an octet. |
| 22 struct HpackPrefix { | 22 struct HpackPrefix { |
| 23 uint8_t bits; | 23 uint8_t bits; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 const HpackPrefix kLiteralNoIndexOpcode = {0x0, 4}; | 63 const HpackPrefix kLiteralNoIndexOpcode = {0x0, 4}; |
| 64 | 64 |
| 65 // 7.2.3: Opcode for a literal header field which is never indexed. | 65 // 7.2.3: Opcode for a literal header field which is never indexed. |
| 66 const HpackPrefix kLiteralNeverIndexOpcode = {0x1, 4}; | 66 const HpackPrefix kLiteralNeverIndexOpcode = {0x1, 4}; |
| 67 | 67 |
| 68 // 7.3: Opcode for maximum header table size update. Begins a varint-encoded | 68 // 7.3: Opcode for maximum header table size update. Begins a varint-encoded |
| 69 // table size with a 5-bit prefix. | 69 // table size with a 5-bit prefix. |
| 70 const HpackPrefix kHeaderTableSizeUpdateOpcode = {0x1, 3}; | 70 const HpackPrefix kHeaderTableSizeUpdateOpcode = {0x1, 3}; |
| 71 | 71 |
| 72 // Returns symbol code table from "Appendix C. Huffman Code". | 72 // Returns symbol code table from "Appendix C. Huffman Code". |
| 73 NET_EXPORT_PRIVATE std::vector<HpackHuffmanSymbol> HpackHuffmanCode(); | 73 SPDY_EXPORT_PRIVATE std::vector<HpackHuffmanSymbol> HpackHuffmanCode(); |
| 74 | 74 |
| 75 // Returns static table from "Appendix B. Static Table Definition". | 75 // Returns static table from "Appendix B. Static Table Definition". |
| 76 NET_EXPORT_PRIVATE std::vector<HpackStaticEntry> HpackStaticTableVector(); | 76 SPDY_EXPORT_PRIVATE std::vector<HpackStaticEntry> HpackStaticTableVector(); |
| 77 | 77 |
| 78 // Returns a HpackHuffmanTable instance initialized with |kHpackHuffmanCode|. | 78 // Returns a HpackHuffmanTable instance initialized with |kHpackHuffmanCode|. |
| 79 // The instance is read-only, has static lifetime, and is safe to share amoung | 79 // The instance is read-only, has static lifetime, and is safe to share amoung |
| 80 // threads. This function is thread-safe. | 80 // threads. This function is thread-safe. |
| 81 NET_EXPORT_PRIVATE const HpackHuffmanTable& ObtainHpackHuffmanTable(); | 81 SPDY_EXPORT_PRIVATE const HpackHuffmanTable& ObtainHpackHuffmanTable(); |
| 82 | 82 |
| 83 // Returns a HpackStaticTable instance initialized with |kHpackStaticTable|. | 83 // Returns a HpackStaticTable instance initialized with |kHpackStaticTable|. |
| 84 // The instance is read-only, has static lifetime, and is safe to share amoung | 84 // The instance is read-only, has static lifetime, and is safe to share amoung |
| 85 // threads. This function is thread-safe. | 85 // threads. This function is thread-safe. |
| 86 NET_EXPORT_PRIVATE const HpackStaticTable& ObtainHpackStaticTable(); | 86 SPDY_EXPORT_PRIVATE const HpackStaticTable& ObtainHpackStaticTable(); |
| 87 | 87 |
| 88 // Pseudo-headers start with a colon. (HTTP2 8.1.2.1., HPACK 3.1.) | 88 // Pseudo-headers start with a colon. (HTTP2 8.1.2.1., HPACK 3.1.) |
| 89 const char kPseudoHeaderPrefix = ':'; | 89 const char kPseudoHeaderPrefix = ':'; |
| 90 | 90 |
| 91 } // namespace net | 91 } // namespace net |
| 92 | 92 |
| 93 #endif // NET_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_ | 93 #endif // NET_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_ |
| OLD | NEW |