Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / net / spdy / hpack_output_stream.h
index 6ed38ec..7ad13e6 100644 (file)
 #include "base/macros.h"
 #include "base/strings/string_piece.h"
 #include "net/base/net_export.h"
+#include "net/spdy/hpack_constants.h"  // For HpackPrefix.
 #include "net/spdy/hpack_encoding_context.h"
 
 // All section references below are to
-// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-04
+// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05
 // .
 
 namespace net {
@@ -29,6 +30,9 @@ class NET_EXPORT_PRIVATE HpackOutputStream {
   explicit HpackOutputStream(uint32 max_string_literal_size);
   ~HpackOutputStream();
 
+  // Corresponds to 4.2.
+  void AppendIndexedHeader(uint32 index_or_zero);
+
   // Corresponds to 4.3.1 (second form). Returns whether or not the
   // append was successful; if the append was unsuccessful, no other
   // member function may be called.
@@ -54,11 +58,14 @@ class NET_EXPORT_PRIVATE HpackOutputStream {
   }
 
  private:
-  // Appends the lower |size| bits of |bits| to the internal buffer.
+  // Appends the lower |bit_size| bits of |bits| to the internal buffer.
   //
-  // |size| must be > 0 and <= 8. |bits| must not have any bits set
-  // |other than the lower |size| bits.
-  void AppendBits(uint8 bits, size_t size);
+  // |bit_size| must be > 0 and <= 8. |bits| must not have any bits
+  // set other than the lower |bit_size| bits.
+  void AppendBits(uint8 bits, size_t bit_size);
+
+  // Simply forwards to AppendBits(prefix.bits, prefix.bit-size).
+  void AppendPrefix(HpackPrefix prefix);
 
   // Appends the given integer using the representation described in
   // 4.1.1. If the internal buffer ends on a byte boundary, the prefix