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

Side by Side Diff: net/spdy/hpack_static_table.h

Issue 549583003: Make HPACK static table static and immutable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_header_table_test.cc ('k') | net/spdy/hpack_static_table.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_SPDY_HPACK_STATIC_TABLE_H_
6 #define NET_SPDY_HPACK_STATIC_TABLE_H_
7
8 #include "net/spdy/hpack_header_table.h"
9
10 namespace net {
11
12 struct HpackStaticEntry;
13
14 // HpackStaticTable provides |static_entries_| and |static_index_| for HPACK
15 // encoding and decoding contexts. Once initialized, an instance is read only
16 // and may be accessed only through its const interface. Such an instance may
17 // be shared accross multiple HPACK contexts.
18 class NET_EXPORT_PRIVATE HpackStaticTable {
19 public:
20 HpackStaticTable();
21 ~HpackStaticTable();
22
23 // Prepares HpackStaticTable by filling up static_entries_ and static_index_
24 // from an array of struct HpackStaticEntry. Must be called exactly once.
25 void Initialize(const HpackStaticEntry* static_entry_table,
26 size_t static_entry_count);
27
28 // Returns whether Initialize() has been called.
29 bool IsInitialized() const;
30
31 // Accessors.
32 const HpackHeaderTable::EntryTable& GetStaticEntries() const {
33 return static_entries_;
34 }
35 const HpackHeaderTable::OrderedEntrySet& GetStaticIndex() const {
36 return static_index_;
37 }
38
39 private:
40 HpackHeaderTable::EntryTable static_entries_;
41 HpackHeaderTable::OrderedEntrySet static_index_;
42 };
43
44 } // namespace net
45
46 #endif // NET_SPDY_HPACK_STATIC_TABLE_H_
OLDNEW
« no previous file with comments | « net/spdy/hpack_header_table_test.cc ('k') | net/spdy/hpack_static_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698