| Index: net/spdy/http2_compressor.h
|
| diff --git a/net/spdy/http2_compressor.h b/net/spdy/http2_compressor.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..229d122deb5a0e3481673b11ec8ae104b7c06914
|
| --- /dev/null
|
| +++ b/net/spdy/http2_compressor.h
|
| @@ -0,0 +1,75 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef NET_SPDY_HTTP2_COMPRESSOR_H_
|
| +#define NET_SPDY_HTTP2_COMPRESSOR_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/strings/string_piece.h"
|
| +#include "net/base/net_export.h"
|
| +#include "net/spdy/http2_encoding_context.h"
|
| +#include "net/spdy/spdy_protocol.h"
|
| +
|
| +namespace net {
|
| +
|
| +class Http2Encoder {
|
| + public:
|
| + Http2Encoder();
|
| +
|
| + void EncodeOctet(uint8 octet);
|
| +
|
| + void EncodeInteger(uint8 op_code, uint8 N, uint32 I);
|
| +
|
| + void EncodeOctetSequence(base::StringPiece str);
|
| +
|
| + void EncodeIndexedHeader(uint32 index);
|
| +
|
| + void EncodeLiteralHeaderNoIndexingWithIndex(uint32 index,
|
| + base::StringPiece value);
|
| +
|
| + void EncodeLiteralHeaderNoIndexingWithName(base::StringPiece name,
|
| + base::StringPiece value);
|
| +
|
| + void EncodeLiteralHeaderWithIncrementalIndexingWithIndex(
|
| + uint32 index,
|
| + base::StringPiece value);
|
| +
|
| + void EncodeLiteralHeaderWithIncrementalIndexingWithName(
|
| + base::StringPiece name,
|
| + base::StringPiece value);
|
| +
|
| + void EncodeLiteralHeaderWithSubstitutionIndexingWithIndex(
|
| + uint32 index,
|
| + base::StringPiece value);
|
| +
|
| + void EncodeLiteralHeaderWithSubstitutionIndexingWithName(
|
| + base::StringPiece name,
|
| + base::StringPiece value);
|
| +
|
| + std::string Flush();
|
| +
|
| + private:
|
| + std::string buffer_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(Http2Encoder);
|
| +};
|
| +
|
| +class NET_EXPORT_PRIVATE Http2Compressor {
|
| + public:
|
| + Http2Compressor();
|
| + ~Http2Compressor();
|
| +
|
| + std::string EncodeNameValueBlock(const SpdyNameValueBlock& name_value_block);
|
| +
|
| + private:
|
| + EncodingContext encoding_context_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(Http2Compressor);
|
| +};
|
| +
|
| +} // namespace net
|
| +
|
| +#endif // NET_SPDY_HTTP2_COMPRESSOR_H_
|
|
|