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

Unified Diff: net/tools/transport_security_state_generator/bit_writer.cc

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/bit_writer.cc
diff --git a/net/tools/transport_security_state_generator/bit_writer.cc b/net/tools/transport_security_state_generator/bit_writer.cc
index b10316d241c5b394682d391b8f5cc9d1fee89fe0..82da76a65d43bf9cb0dcd5903fa3d3c2e131dc70 100644
--- a/net/tools/transport_security_state_generator/bit_writer.cc
+++ b/net/tools/transport_security_state_generator/bit_writer.cc
@@ -33,21 +33,13 @@ void BitWriter::WriteBit(uint8_t bit) {
}
void BitWriter::Flush() {
+ position_ += (8 - used_);
bytes_.push_back(current_byte_);
used_ = 0;
current_byte_ = 0;
}
-uint8_t BitWriter::BitLength(uint32_t input) const {
- uint8_t number_of_bits = 0;
- while (input != 0) {
- number_of_bits++;
- input >>= 1;
- }
- return number_of_bits;
-}
-
} // namespace transport_security_state
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698