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

Unified Diff: net/spdy/http2_compressor.h

Issue 22074002: DO NOT COMMIT: Implement HPACK (draft 03) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update for httpbis-draft-06 / hpack-draft-03 Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/net.gyp ('k') | net/spdy/http2_compressor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « net/net.gyp ('k') | net/spdy/http2_compressor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698