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

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

Issue 2832973003: Split net/spdy into core and chromium subdirectories. (Closed)
Patch Set: Fix some more build rules. Created 3 years, 8 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_round_trip_test.cc ('k') | net/spdy/hpack/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_HPACK_STATIC_TABLE_H_
6 #define NET_SPDY_HPACK_HPACK_STATIC_TABLE_H_
7
8 #include <stddef.h>
9
10 #include "net/base/net_export.h"
11 #include "net/spdy/hpack/hpack_header_table.h"
12
13 namespace net {
14
15 struct HpackStaticEntry;
16
17 // HpackStaticTable provides |static_entries_| and |static_index_| for HPACK
18 // encoding and decoding contexts. Once initialized, an instance is read only
19 // and may be accessed only through its const interface. Such an instance may
20 // be shared accross multiple HPACK contexts.
21 class NET_EXPORT_PRIVATE HpackStaticTable {
22 public:
23 HpackStaticTable();
24 ~HpackStaticTable();
25
26 // Prepares HpackStaticTable by filling up static_entries_ and static_index_
27 // from an array of struct HpackStaticEntry. Must be called exactly once.
28 void Initialize(const HpackStaticEntry* static_entry_table,
29 size_t static_entry_count);
30
31 // Returns whether Initialize() has been called.
32 bool IsInitialized() const;
33
34 // Accessors.
35 const HpackHeaderTable::EntryTable& GetStaticEntries() const {
36 return static_entries_;
37 }
38 const HpackHeaderTable::UnorderedEntrySet& GetStaticIndex() const {
39 return static_index_;
40 }
41 const HpackHeaderTable::NameToEntryMap& GetStaticNameIndex() const {
42 return static_name_index_;
43 }
44
45 // Returns the estimate of dynamically allocated memory in bytes.
46 size_t EstimateMemoryUsage() const;
47
48 private:
49 HpackHeaderTable::EntryTable static_entries_;
50 HpackHeaderTable::UnorderedEntrySet static_index_;
51 HpackHeaderTable::NameToEntryMap static_name_index_;
52 };
53
54 } // namespace net
55
56 #endif // NET_SPDY_HPACK_HPACK_STATIC_TABLE_H_
OLDNEW
« no previous file with comments | « net/spdy/hpack/hpack_round_trip_test.cc ('k') | net/spdy/hpack/hpack_static_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698