Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / net / spdy / hpack_static_table.h
blobeb343ba578329be0140a5a909d797416e1166feb
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.
5 #ifndef NET_SPDY_HPACK_STATIC_TABLE_H_
6 #define NET_SPDY_HPACK_STATIC_TABLE_H_
8 #include "net/spdy/hpack_header_table.h"
10 namespace net {
12 struct HpackStaticEntry;
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();
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);
28 // Returns whether Initialize() has been called.
29 bool IsInitialized() const;
31 // Accessors.
32 const HpackHeaderTable::EntryTable& GetStaticEntries() const {
33 return static_entries_;
35 const HpackHeaderTable::OrderedEntrySet& GetStaticIndex() const {
36 return static_index_;
39 private:
40 HpackHeaderTable::EntryTable static_entries_;
41 HpackHeaderTable::OrderedEntrySet static_index_;
44 } // namespace net
46 #endif // NET_SPDY_HPACK_STATIC_TABLE_H_