OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/http2/hpack/decoder/hpack_decoder_tables.h" | 5 #include "net/http2/hpack/decoder/hpack_decoder_tables.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace net { | 9 namespace net { |
10 namespace { | 10 namespace { |
11 | 11 |
12 std::vector<HpackStringPair>* MakeStaticTable() { | 12 std::vector<HpackStringPair>* MakeStaticTable() { |
13 auto ptr = new std::vector<HpackStringPair>(); | 13 auto* ptr = new std::vector<HpackStringPair>(); |
14 ptr->reserve(kFirstDynamicTableIndex); | 14 ptr->reserve(kFirstDynamicTableIndex); |
15 ptr->emplace_back("", ""); | 15 ptr->emplace_back("", ""); |
16 | 16 |
17 #define STATIC_TABLE_ENTRY(name, value, index) \ | 17 #define STATIC_TABLE_ENTRY(name, value, index) \ |
18 DCHECK_EQ(ptr->size(), index); \ | 18 DCHECK_EQ(ptr->size(), index); \ |
19 ptr->emplace_back(name, value) | 19 ptr->emplace_back(name, value) |
20 | 20 |
21 #include "net/http2/hpack/hpack_static_table_entries.inc" | 21 #include "net/http2/hpack/hpack_static_table_entries.inc" |
22 | 22 |
23 #undef STATIC_TABLE_ENTRY | 23 #undef STATIC_TABLE_ENTRY |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 const HpackStringPair* HpackDecoderTables::Lookup(size_t index) const { | 144 const HpackStringPair* HpackDecoderTables::Lookup(size_t index) const { |
145 if (index < kFirstDynamicTableIndex) { | 145 if (index < kFirstDynamicTableIndex) { |
146 return static_table_.Lookup(index); | 146 return static_table_.Lookup(index); |
147 } else { | 147 } else { |
148 return dynamic_table_.Lookup(index - kFirstDynamicTableIndex); | 148 return dynamic_table_.Lookup(index - kFirstDynamicTableIndex); |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 } // namespace net | 152 } // namespace net |
OLD | NEW |