OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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. |
| 4 |
| 5 #ifndef NET_HTTP2_HPACK_HTTP2_HPACK_CONSTANTS_H_ |
| 6 #define NET_HTTP2_HPACK_HTTP2_HPACK_CONSTANTS_H_ |
| 7 |
| 8 // Enum HpackEntryType identifies the 5 basic types of HPACK Block Entries. |
| 9 // |
| 10 // See the spec for details: |
| 11 // https://http2.github.io/http2-spec/compression.html#rfc.section.6 |
| 12 |
| 13 #include <ostream> |
| 14 #include <string> |
| 15 |
| 16 #include "net/base/net_export.h" |
| 17 |
| 18 namespace net { |
| 19 |
| 20 enum class HpackEntryType { |
| 21 // Entry is an index into the static or dynamic table. Decoding it has no |
| 22 // effect on the dynamic table. |
| 23 kIndexedHeader, |
| 24 |
| 25 // The entry contains a literal value. The name may be either a literal or a |
| 26 // reference to an entry in the static or dynamic table. |
| 27 // The entry is added to the dynamic table after decoding. |
| 28 kIndexedLiteralHeader, |
| 29 |
| 30 // The entry contains a literal value. The name may be either a literal or a |
| 31 // reference to an entry in the static or dynamic table. |
| 32 // The entry is not added to the dynamic table after decoding, but a proxy |
| 33 // may choose to insert the entry into its dynamic table when forwarding |
| 34 // to another endpoint. |
| 35 kUnindexedLiteralHeader, |
| 36 |
| 37 // The entry contains a literal value. The name may be either a literal or a |
| 38 // reference to an entry in the static or dynamic table. |
| 39 // The entry is not added to the dynamic table after decoding, and a proxy |
| 40 // must NOT insert the entry into its dynamic table when forwarding to another |
| 41 // endpoint. |
| 42 kNeverIndexedLiteralHeader, |
| 43 |
| 44 // Entry conveys the size limit of the dynamic table of the encoder to |
| 45 // the decoder. May be used to flush the table by sending a zero and then |
| 46 // resetting the size back up to the maximum that the encoder will use |
| 47 // (within the limits of SETTINGS_HEADER_TABLE_SIZE sent by the |
| 48 // decoder to the encoder, with the default of 4096 assumed). |
| 49 kDynamicTableSizeUpdate, |
| 50 }; |
| 51 |
| 52 // Returns the name of the enum member. |
| 53 NET_EXPORT_PRIVATE std::string HpackEntryTypeToString(HpackEntryType v); |
| 54 |
| 55 // Inserts the name of the enum member into |out|. |
| 56 NET_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& out, |
| 57 HpackEntryType v); |
| 58 |
| 59 } // namespace net |
| 60 |
| 61 #endif // NET_HTTP2_HPACK_HTTP2_HPACK_CONSTANTS_H_ |
OLD | NEW |