Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: net/tools/transport_security_state_generator/trie/trie_bit_buffer.h

Issue 2660793002: Add transport security state generator tests. (Closed)
Patch Set: export method for tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
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

Powered by Google App Engine
This is Rietveld 408576698