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

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

Issue 2681733008: Improve error handling of the transport security state generator. (Closed)
Patch Set: 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_writer.h
diff --git a/net/tools/transport_security_state_generator/trie/trie_writer.h b/net/tools/transport_security_state_generator/trie/trie_writer.h
index 93fce3624f7193f8c5f281aaf643981d1b8372c3..e95baa0d89d68c80331fe466607b6e76200baacf 100644
--- a/net/tools/transport_security_state_generator/trie/trie_writer.h
+++ b/net/tools/transport_security_state_generator/trie/trie_writer.h
@@ -40,7 +40,8 @@ class TrieWriter {
// Constructs a trie containing all |entries|. The output is written to
// |buffer_|. Returns the position of the trie root.
Ryan Sleevi 2017/02/14 20:53:17 Out of date comment
martijnc 2017/02/15 22:07:59 Updated.
- uint32_t WriteEntries(const TransportSecurityStateEntries& entries);
+ bool WriteEntries(const TransportSecurityStateEntries& entries,
+ uint32_t* position);
// Returns the position |buffer_| is currently at. The returned value
// represents the number of bits.
@@ -54,11 +55,12 @@ class TrieWriter {
const std::vector<uint8_t>& bytes() const { return buffer_.bytes(); }
private:
- uint32_t WriteDispatchTables(ReversedEntries::iterator start,
- ReversedEntries::iterator end);
+ bool WriteDispatchTables(ReversedEntries::iterator start,
+ ReversedEntries::iterator end,
+ uint32_t* position);
// Serializes |*entry| and writes it to |*writer|.
- void WriteEntry(const TransportSecurityStateEntry* entry,
+ bool WriteEntry(const TransportSecurityStateEntry* entry,
TrieBitBuffer* writer);
// Removes the first |length| characters from all entries between |start| and
@@ -69,8 +71,9 @@ class TrieWriter {
// Searches for the longest common prefix for all entries between |start| and
// |end|.
- std::vector<uint8_t> LongestCommonPrefix(ReversedEntries::iterator start,
- ReversedEntries::iterator end) const;
+ std::vector<uint8_t> LongestCommonPrefix(
+ ReversedEntries::const_iterator start,
+ ReversedEntries::const_iterator end) const;
// Returns the reversed |hostname| as a vector of bytes. The reversed hostname
// will be terminated by |kTerminalValue|.

Powered by Google App Engine
This is Rietveld 408576698