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_HPACK_DECODER_H_ | 5 #ifndef NET_SPDY_HPACK_DECODER_H_ |
6 #define NET_SPDY_HPACK_DECODER_H_ | 6 #define NET_SPDY_HPACK_DECODER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 std::string headers_block_buffer_; | 104 std::string headers_block_buffer_; |
105 SpdyHeaderBlock decoded_block_; | 105 SpdyHeaderBlock decoded_block_; |
106 | 106 |
107 // Scratch space for storing decoded literals. | 107 // Scratch space for storing decoded literals. |
108 std::string key_buffer_, value_buffer_; | 108 std::string key_buffer_, value_buffer_; |
109 | 109 |
110 // If non-NULL, handles decoded headers. | 110 // If non-NULL, handles decoded headers. |
111 SpdyHeadersHandlerInterface* handler_; | 111 SpdyHeadersHandlerInterface* handler_; |
112 size_t total_header_bytes_; | 112 size_t total_header_bytes_; |
113 | 113 |
114 // Flag to keep track of having seen a regular header field. | |
115 bool regular_header_seen_; | |
116 | |
117 // Flag to keep track of having seen the header block start. | 114 // Flag to keep track of having seen the header block start. |
118 bool header_block_started_; | 115 bool header_block_started_; |
119 | 116 |
120 // Total bytes have been removed from headers_block_buffer_. | 117 // Total bytes have been removed from headers_block_buffer_. |
121 // Its value is updated during incremental decoding. | 118 // Its value is updated during incremental decoding. |
122 uint32_t total_parsed_bytes_; | 119 uint32_t total_parsed_bytes_; |
123 | 120 |
124 // Handlers for decoding HPACK opcodes and header representations | 121 // Handlers for decoding HPACK opcodes and header representations |
125 // (or parts thereof). These methods return true on success and | 122 // (or parts thereof). These methods return true on success and |
126 // false on error. | 123 // false on error. |
127 bool DecodeNextOpcodeWrapper(HpackInputStream* input_stream); | 124 bool DecodeNextOpcodeWrapper(HpackInputStream* input_stream); |
128 bool DecodeNextOpcode(HpackInputStream* input_stream); | 125 bool DecodeNextOpcode(HpackInputStream* input_stream); |
129 bool DecodeAtMostTwoHeaderTableSizeUpdates(HpackInputStream* input_stream); | 126 bool DecodeAtMostTwoHeaderTableSizeUpdates(HpackInputStream* input_stream); |
130 bool DecodeNextHeaderTableSizeUpdate(HpackInputStream* input_stream); | 127 bool DecodeNextHeaderTableSizeUpdate(HpackInputStream* input_stream); |
131 bool DecodeNextIndexedHeader(HpackInputStream* input_stream); | 128 bool DecodeNextIndexedHeader(HpackInputStream* input_stream); |
132 bool DecodeNextLiteralHeader(HpackInputStream* input_stream, | 129 bool DecodeNextLiteralHeader(HpackInputStream* input_stream, |
133 bool should_index); | 130 bool should_index); |
134 bool DecodeNextName(HpackInputStream* input_stream, | 131 bool DecodeNextName(HpackInputStream* input_stream, |
135 base::StringPiece* next_name); | 132 base::StringPiece* next_name); |
136 bool DecodeNextStringLiteral(HpackInputStream* input_stream, | 133 bool DecodeNextStringLiteral(HpackInputStream* input_stream, |
137 bool is_header_key, // As distinct from a value. | 134 bool is_header_key, // As distinct from a value. |
138 base::StringPiece* output); | 135 base::StringPiece* output); |
139 | 136 |
140 DISALLOW_COPY_AND_ASSIGN(HpackDecoder); | 137 DISALLOW_COPY_AND_ASSIGN(HpackDecoder); |
141 }; | 138 }; |
142 | 139 |
143 } // namespace net | 140 } // namespace net |
144 | 141 |
145 #endif // NET_SPDY_HPACK_DECODER_H_ | 142 #endif // NET_SPDY_HPACK_DECODER_H_ |
OLD | NEW |