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

Side by Side Diff: net/spdy/hpack/hpack_huffman_table.cc

Issue 2663203002: Fix uninitialized fields in hpack code. (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 unified diff | Download patch
« no previous file with comments | « net/spdy/hpack/hpack_entry.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/hpack/hpack_huffman_table.h" 5 #include "net/spdy/hpack/hpack_huffman_table.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 HpackHuffmanTable::DecodeEntry::DecodeEntry(uint8_t next_table_index, 43 HpackHuffmanTable::DecodeEntry::DecodeEntry(uint8_t next_table_index,
44 uint8_t length, 44 uint8_t length,
45 uint16_t symbol_id) 45 uint16_t symbol_id)
46 : next_table_index(next_table_index), 46 : next_table_index(next_table_index),
47 length(length), 47 length(length),
48 symbol_id(symbol_id) {} 48 symbol_id(symbol_id) {}
49 size_t HpackHuffmanTable::DecodeTable::size() const { 49 size_t HpackHuffmanTable::DecodeTable::size() const {
50 return size_t(1) << indexed_length; 50 return size_t(1) << indexed_length;
51 } 51 }
52 52
53 HpackHuffmanTable::HpackHuffmanTable() {} 53 HpackHuffmanTable::HpackHuffmanTable() : pad_bits_(0), failed_symbol_id_(0) {}
54 54
55 HpackHuffmanTable::~HpackHuffmanTable() {} 55 HpackHuffmanTable::~HpackHuffmanTable() {}
56 56
57 bool HpackHuffmanTable::Initialize(const HpackHuffmanSymbol* input_symbols, 57 bool HpackHuffmanTable::Initialize(const HpackHuffmanSymbol* input_symbols,
58 size_t symbol_count) { 58 size_t symbol_count) {
59 CHECK(!IsInitialized()); 59 CHECK(!IsInitialized());
60 DCHECK(base::IsValueInRangeForNumericType<uint16_t>(symbol_count)); 60 DCHECK(base::IsValueInRangeForNumericType<uint16_t>(symbol_count));
61 61
62 std::vector<Symbol> symbols(symbol_count); 62 std::vector<Symbol> symbols(symbol_count);
63 // Validate symbol id sequence, and copy into |symbols|. 63 // Validate symbol id sequence, and copy into |symbols|.
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 bits = bits << entry.length; 312 bits = bits << entry.length;
313 bits_available -= entry.length; 313 bits_available -= entry.length;
314 } 314 }
315 peeked_success = in->PeekBits(&bits_available, &bits); 315 peeked_success = in->PeekBits(&bits_available, &bits);
316 } 316 }
317 NOTREACHED(); 317 NOTREACHED();
318 return false; 318 return false;
319 } 319 }
320 320
321 } // namespace net 321 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack/hpack_entry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698