| 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_HPACK_INPUT_STREAM_H_ | 5 #ifndef NET_SPDY_HPACK_HPACK_INPUT_STREAM_H_ |
| 6 #define NET_SPDY_HPACK_HPACK_INPUT_STREAM_H_ | 6 #define NET_SPDY_HPACK_HPACK_INPUT_STREAM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <string> | |
| 12 #include <utility> | 11 #include <utility> |
| 13 | 12 |
| 14 #include "base/macros.h" | 13 #include "base/macros.h" |
| 15 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
| 16 #include "net/spdy/hpack/hpack_constants.h" | 15 #include "net/spdy/hpack/hpack_constants.h" |
| 17 #include "net/spdy/hpack/hpack_huffman_table.h" | 16 #include "net/spdy/hpack/hpack_huffman_table.h" |
| 17 #include "net/spdy/platform/api/spdy_string.h" |
| 18 #include "net/spdy/platform/api/spdy_string_piece.h" | 18 #include "net/spdy/platform/api/spdy_string_piece.h" |
| 19 | 19 |
| 20 // All section references below are to | 20 // All section references below are to |
| 21 // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-08 | 21 // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-08 |
| 22 | 22 |
| 23 namespace net { | 23 namespace net { |
| 24 | 24 |
| 25 namespace test { | 25 namespace test { |
| 26 class HpackInputStreamPeer; | 26 class HpackInputStreamPeer; |
| 27 } // namespace test | 27 } // namespace test |
| (...skipping 14 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 // If the next bits of input match |prefix|, consumes them and returns true. | 43 // If the next bits of input match |prefix|, consumes them and returns true. |
| 44 // Otherwise, consumes nothing and returns false. | 44 // Otherwise, consumes nothing and returns false. |
| 45 bool MatchPrefixAndConsume(HpackPrefix prefix); | 45 bool MatchPrefixAndConsume(HpackPrefix prefix); |
| 46 | 46 |
| 47 // The Decode* functions return true and fill in their arguments if | 47 // The Decode* functions return true and fill in their arguments if |
| 48 // decoding was successful, or false if an error was encountered. | 48 // decoding was successful, or false if an error was encountered. |
| 49 | 49 |
| 50 bool DecodeNextUint32(uint32_t* I); | 50 bool DecodeNextUint32(uint32_t* I); |
| 51 bool DecodeNextIdentityString(SpdyStringPiece* str); | 51 bool DecodeNextIdentityString(SpdyStringPiece* str); |
| 52 bool DecodeNextHuffmanString(std::string* str); | 52 bool DecodeNextHuffmanString(SpdyString* str); |
| 53 | 53 |
| 54 // Stores input bits into the most-significant, unfilled bits of |out|. | 54 // Stores input bits into the most-significant, unfilled bits of |out|. |
| 55 // |peeked_count| is the number of filled bits in |out| which have been | 55 // |peeked_count| is the number of filled bits in |out| which have been |
| 56 // previously peeked. PeekBits() will fill some number of remaining bits, | 56 // previously peeked. PeekBits() will fill some number of remaining bits, |
| 57 // returning the new total number via |peeked_count|. Returns true if one | 57 // returning the new total number via |peeked_count|. Returns true if one |
| 58 // or more additional bits were added to |out|, and false otherwise. | 58 // or more additional bits were added to |out|, and false otherwise. |
| 59 bool PeekBits(size_t* peeked_count, uint32_t* out) const; | 59 bool PeekBits(size_t* peeked_count, uint32_t* out) const; |
| 60 | 60 |
| 61 // Similar to PeekBits, but intended to be used when starting to decode a | 61 // Similar to PeekBits, but intended to be used when starting to decode a |
| 62 // Huffman encoded string. Returns a pair containing the peeked_count and | 62 // Huffman encoded string. Returns a pair containing the peeked_count and |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 bool PeekNextOctet(uint8_t* next_octet); | 104 bool PeekNextOctet(uint8_t* next_octet); |
| 105 | 105 |
| 106 bool DecodeNextOctet(uint8_t* next_octet); | 106 bool DecodeNextOctet(uint8_t* next_octet); |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(HpackInputStream); | 108 DISALLOW_COPY_AND_ASSIGN(HpackInputStream); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace net | 111 } // namespace net |
| 112 | 112 |
| 113 #endif // NET_SPDY_HPACK_HPACK_INPUT_STREAM_H_ | 113 #endif // NET_SPDY_HPACK_HPACK_INPUT_STREAM_H_ |
| OLD | NEW |