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"
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
{
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;
32 const HpackHeaderTable::EntryTable
& GetStaticEntries() const {
33 return static_entries_
;
35 const HpackHeaderTable::OrderedEntrySet
& GetStaticIndex() const {
40 HpackHeaderTable::EntryTable static_entries_
;
41 HpackHeaderTable::OrderedEntrySet static_index_
;
46 #endif // NET_SPDY_HPACK_STATIC_TABLE_H_