Chromium Code Reviews| Index: net/tools/transport_security_state_generator/trie/trie_bit_buffer.h |
| diff --git a/net/tools/transport_security_state_generator/trie/trie_bit_buffer.h b/net/tools/transport_security_state_generator/trie/trie_bit_buffer.h |
| index f49ffb116bb72431c840a0cd14a9d4d23679f078..0debacbd7881ea2f21704ba7e4dfaab9e6814cc1 100644 |
| --- a/net/tools/transport_security_state_generator/trie/trie_bit_buffer.h |
| +++ b/net/tools/transport_security_state_generator/trie/trie_bit_buffer.h |
| @@ -9,6 +9,7 @@ |
| #include <vector> |
| +#include "base/macros.h" |
| #include "net/tools/transport_security_state_generator/huffman/huffman_builder.h" |
| namespace net { |
| @@ -40,8 +41,8 @@ class TrieBitBuffer { |
| // Writes the character in |byte| to the buffer using its Huffman |
| // representation in |table|. Optionally tracks usage of the character in |
| - // |*huffman_builder|. |
| - void WriteChar(uint8_t byte, |
| + // |*huffman_builder|. Returns false when |byte| is not found in |table|. |
| + bool WriteChar(uint8_t byte, |
| const HuffmanRepresentationTable& table, |
| HuffmanBuilder* huffman_builder); |
| @@ -49,8 +50,8 @@ class TrieBitBuffer { |
| // at before the buffer was written to it. |
| uint32_t WriteToBitWriter(BitWriter* writer); |
| - // Appends the buffered bits in |current_byte_| to |elements_|. Empty bits |
| - // are filled with zero's. |
| + // Appends the buffered bits in |current_byte_| to |elements_|. No padding |
| + // will occur. |
|
Ryan Sleevi
2017/02/14 20:53:17
Why this semantic change of the API?
martijnc
2017/02/15 22:07:59
The old comment was incorrect. The API already beh
|
| void Flush(); |
| private: |
| @@ -76,6 +77,8 @@ class TrieBitBuffer { |
| uint32_t used_ = 0; |
| std::vector<BitsOrPosition> elements_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TrieBitBuffer); |
| }; |
| } // namespace transport_security_state |