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_ENCODER_H_
6 #define NET_SPDY_HPACK_ENCODER_H_
11 #include "base/basictypes.h"
12 #include "base/macros.h"
13 #include "net/base/net_export.h"
14 #include "net/spdy/hpack_encoding_context.h"
18 // An HpackEncoder encodes header sets as outlined in
19 // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05
21 class NET_EXPORT_PRIVATE HpackEncoder {
23 explicit HpackEncoder(uint32 max_string_literal_size);
26 // Encodes the given header set into the given string. Returns
27 // whether or not the encoding was successful.
28 bool EncodeHeaderSet(const std::map<std::string, std::string>& header_set,
32 const uint32 max_string_literal_size_;
33 HpackEncodingContext context_;
35 DISALLOW_COPY_AND_ASSIGN(HpackEncoder);
40 #endif // NET_SPDY_HPACK_ENCODER_H_