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

Unified Diff: net/tools/domain_security_preload_generator/huffman/huffman_node.h

Issue 2551153003: Add static domain security state generator tool. (Closed)
Patch Set: fix base64 issue and accidental replace. Created 4 years 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/domain_security_preload_generator/huffman/huffman_node.h
diff --git a/net/tools/domain_security_preload_generator/huffman/huffman_node.h b/net/tools/domain_security_preload_generator/huffman/huffman_node.h
new file mode 100644
index 0000000000000000000000000000000000000000..be3d9aaf6a9d08ef1d09d6b679611251225a818f
--- /dev/null
+++ b/net/tools/domain_security_preload_generator/huffman/huffman_node.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_HUFFMAN_HUFFMAN_NODE_H_
+#define NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_HUFFMAN_HUFFMAN_NODE_H_
+
+#include <stdint.h>
+
+#include <memory>
+
+namespace net {
+
+class HuffmanNode {
+ public:
+ HuffmanNode(uint8_t value,
+ int count,
agl 2016/12/06 18:51:36 counts have been uint32_t's prior to this. Types s
martijnc 2016/12/07 22:37:54 Done.
+ std::unique_ptr<HuffmanNode> left,
+ std::unique_ptr<HuffmanNode> right);
+ ~HuffmanNode();
+
+ bool IsLeaf() const;
+
+ uint8_t value() const { return value_; }
+ int count() const { return count_; }
+ const std::unique_ptr<HuffmanNode>& left() const { return left_; }
+ const std::unique_ptr<HuffmanNode>& right() const { return right_; }
+
+ private:
+ uint8_t value_;
+ int count_;
+ std::unique_ptr<HuffmanNode> left_;
+ std::unique_ptr<HuffmanNode> right_;
+};
+
+} // namespace net
+
+#endif // NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_HUFFMAN_HUFFMAN_NODE_H_

Powered by Google App Engine
This is Rietveld 408576698