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

Unified Diff: net/tools/transport_security_state_generator/huffman/huffman_builder.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/huffman/huffman_builder.h
diff --git a/net/tools/transport_security_state_generator/huffman/huffman_builder.h b/net/tools/transport_security_state_generator/huffman/huffman_builder.h
index 5368970eaaa630210510d6143f1a7c450d935ce3..5e66ae4b8afa8d2d96f775d18cc4e2d693a3af44 100644
--- a/net/tools/transport_security_state_generator/huffman/huffman_builder.h
+++ b/net/tools/transport_security_state_generator/huffman/huffman_builder.h
@@ -39,7 +39,7 @@ class HuffmanBuilder {
~HuffmanBuilder();
// Will increase the count for |character| by one, indicating it has been
- // used.
+ // used. |character| must be in the range 0-127.
void RecordUsage(uint8_t character);
// Returns a HuffmanRepresentationTable based on the usage data collected
@@ -69,7 +69,8 @@ class HuffmanBuilder {
// See ToVector() for more information on the format.
uint32_t WriteToVector(HuffmanNode* node, std::vector<uint8_t>* vector);
- // Constructs a Huffman tree based on |counts_|.
+ // Constructs a Huffman tree based on |counts_|. Appends additional nodes to
+ // the tree until it contains at least 2 leafs.
std::unique_ptr<HuffmanNode> BuildTree();
// Holds usage information for the tracked characters. Maps the character to

Powered by Google App Engine
This is Rietveld 408576698