| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
| 15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
| 16 #include "net/spdy/hpack_header_table.h" | 16 #include "net/spdy/hpack_header_table.h" |
| 17 #include "net/spdy/hpack_input_stream.h" | 17 #include "net/spdy/hpack_input_stream.h" |
| 18 #include "net/spdy/spdy_protocol.h" | 18 #include "net/spdy/spdy_protocol.h" |
| 19 | 19 |
| 20 // An HpackDecoder decodes header sets as outlined in | 20 // An HpackDecoder decodes header sets as outlined in |
| 21 // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-06 | 21 // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07 |
| 22 | 22 |
| 23 namespace net { | 23 namespace net { |
| 24 | 24 |
| 25 class HpackHuffmanTable; | 25 class HpackHuffmanTable; |
| 26 | 26 |
| 27 namespace test { | 27 namespace test { |
| 28 class HpackDecoderPeer; | 28 class HpackDecoderPeer; |
| 29 } // namespace test | 29 } // namespace test |
| 30 | 30 |
| 31 class NET_EXPORT_PRIVATE HpackDecoder { | 31 class NET_EXPORT_PRIVATE HpackDecoder { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // should have already joined and delimited these values. | 78 // should have already joined and delimited these values. |
| 79 // | 79 // |
| 80 // TODO(jgraettinger): This method will eventually emit to the | 80 // TODO(jgraettinger): This method will eventually emit to the |
| 81 // SpdyHeadersHandlerInterface visitor. | 81 // SpdyHeadersHandlerInterface visitor. |
| 82 void HandleHeaderRepresentation(base::StringPiece name, | 82 void HandleHeaderRepresentation(base::StringPiece name, |
| 83 base::StringPiece value); | 83 base::StringPiece value); |
| 84 | 84 |
| 85 const uint32 max_string_literal_size_; | 85 const uint32 max_string_literal_size_; |
| 86 HpackHeaderTable header_table_; | 86 HpackHeaderTable header_table_; |
| 87 | 87 |
| 88 // Incrementally reconstructed cookie value. Name is also kept to preserve | 88 // Incrementally reconstructed cookie value. |
| 89 // input casing. | 89 std::string cookie_value_; |
| 90 std::string cookie_value_, cookie_name_; | |
| 91 | 90 |
| 92 // TODO(jgraettinger): Buffer for headers data, and storage for the last- | 91 // TODO(jgraettinger): Buffer for headers data, and storage for the last- |
| 93 // processed headers block. Both will be removed with the switch to | 92 // processed headers block. Both will be removed with the switch to |
| 94 // SpdyHeadersHandlerInterface. | 93 // SpdyHeadersHandlerInterface. |
| 95 std::string headers_block_buffer_; | 94 std::string headers_block_buffer_; |
| 96 std::map<std::string, std::string> decoded_block_; | 95 std::map<std::string, std::string> decoded_block_; |
| 97 | 96 |
| 98 // Huffman table to be applied to decoded Huffman literals, | 97 // Huffman table to be applied to decoded Huffman literals, |
| 99 // and scratch space for storing those decoded literals. | 98 // and scratch space for storing those decoded literals. |
| 100 const HpackHuffmanTable& huffman_table_; | 99 const HpackHuffmanTable& huffman_table_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 113 bool DecodeNextStringLiteral(HpackInputStream* input_stream, | 112 bool DecodeNextStringLiteral(HpackInputStream* input_stream, |
| 114 bool is_header_key, // As distinct from a value. | 113 bool is_header_key, // As distinct from a value. |
| 115 base::StringPiece* output); | 114 base::StringPiece* output); |
| 116 | 115 |
| 117 DISALLOW_COPY_AND_ASSIGN(HpackDecoder); | 116 DISALLOW_COPY_AND_ASSIGN(HpackDecoder); |
| 118 }; | 117 }; |
| 119 | 118 |
| 120 } // namespace net | 119 } // namespace net |
| 121 | 120 |
| 122 #endif // NET_SPDY_HPACK_DECODER_H_ | 121 #endif // NET_SPDY_HPACK_DECODER_H_ |
| OLD | NEW |