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

Unified Diff: net/spdy/hpack_huffman_table.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/spdy/hpack_huffman_table.cc
diff --git a/net/spdy/hpack_huffman_table.cc b/net/spdy/hpack_huffman_table.cc
index 9e8f6a1f7830f020d203add1d7b6e10f968bde60..7c60e880a0c3cc9f256820bb2122c0e3a9dff35b 100644
--- a/net/spdy/hpack_huffman_table.cc
+++ b/net/spdy/hpack_huffman_table.cc
@@ -30,28 +30,29 @@ bool SymbolLengthAndIdCompare(const HpackHuffmanSymbol& a,
}
return a.length < b.length;
}
-bool SymbolIdCompare(const HpackHuffmanSymbol& a,
- const HpackHuffmanSymbol& b) {
+bool SymbolIdCompare(const HpackHuffmanSymbol& a, const HpackHuffmanSymbol& b) {
return a.id < b.id;
}
} // namespace
HpackHuffmanTable::DecodeEntry::DecodeEntry()
- : next_table_index(0), length(0), symbol_id(0) {
+ : next_table_index(0), length(0), symbol_id(0) {
}
HpackHuffmanTable::DecodeEntry::DecodeEntry(uint8 next_table_index,
uint8 length,
uint16 symbol_id)
- : next_table_index(next_table_index), length(length), symbol_id(symbol_id) {
+ : next_table_index(next_table_index), length(length), symbol_id(symbol_id) {
}
size_t HpackHuffmanTable::DecodeTable::size() const {
return size_t(1) << indexed_length;
}
-HpackHuffmanTable::HpackHuffmanTable() {}
+HpackHuffmanTable::HpackHuffmanTable() {
+}
-HpackHuffmanTable::~HpackHuffmanTable() {}
+HpackHuffmanTable::~HpackHuffmanTable() {
+}
bool HpackHuffmanTable::Initialize(const HpackHuffmanSymbol* input_symbols,
size_t symbol_count) {
@@ -73,14 +74,14 @@ bool HpackHuffmanTable::Initialize(const HpackHuffmanSymbol* input_symbols,
return false;
}
for (size_t i = 1; i != symbols.size(); i++) {
- unsigned code_shift = 32 - symbols[i-1].length;
- uint32 code = symbols[i-1].code + (1 << code_shift);
+ unsigned code_shift = 32 - symbols[i - 1].length;
+ uint32 code = symbols[i - 1].code + (1 << code_shift);
if (code != symbols[i].code) {
failed_symbol_id_ = symbols[i].id;
return false;
}
- if (code < symbols[i-1].code) {
+ if (code < symbols[i - 1].code) {
// An integer overflow occurred. This implies the input
// lengths do not represent a valid Huffman code.
failed_symbol_id_ = symbols[i].id;
@@ -120,7 +121,8 @@ void HpackHuffmanTable::BuildDecodeTables(const std::vector<Symbol>& symbols) {
// entry first, and that the child can therefore be minimally sized to hold
// that entry without fear of introducing unneccesary branches later.
for (std::vector<Symbol>::const_reverse_iterator it = symbols.rbegin();
- it != symbols.rend(); ++it) {
+ it != symbols.rend();
+ ++it) {
uint8 table_index = 0;
while (true) {
const DecodeTable table = decode_tables_[table_index];
@@ -146,10 +148,10 @@ void HpackHuffmanTable::BuildDecodeTables(const std::vector<Symbol>& symbols) {
// First visit to this placeholder. We need to create a new table.
CHECK_EQ(entry.next_table_index, 0);
entry.length = it->length;
- entry.next_table_index = AddDecodeTable(
- total_indexed, // Becomes the new table prefix.
- std::min<uint8>(kDecodeTableBranchBits,
- entry.length - total_indexed));
+ entry.next_table_index =
+ AddDecodeTable(total_indexed, // Becomes the new table prefix.
+ std::min<uint8>(kDecodeTableBranchBits,
+ entry.length - total_indexed));
SetEntry(table, index, entry);
}
CHECK_NE(entry.next_table_index, table_index);

Powered by Google App Engine
This is Rietveld 408576698