Index: net/http2/hpack/hpack_string.h |
diff --git a/net/http2/hpack/hpack_string.h b/net/http2/hpack/hpack_string.h |
index aeb0c96ca24c95aa2d3fdcc6f58575ad67671ad4..5a7b693e4a466ab8831f34afe654778f28da773c 100644 |
--- a/net/http2/hpack/hpack_string.h |
+++ b/net/http2/hpack/hpack_string.h |
@@ -30,6 +30,8 @@ class NET_EXPORT_PRIVATE HpackString { |
// Not sure yet whether this move ctor is required/sensible. |
HpackString(HpackString&& other) = default; |
+ HpackString& operator=(const HpackString& other) = default; |
+ |
~HpackString(); |
size_t size() const { return str_.size(); } |
@@ -51,6 +53,24 @@ NET_EXPORT_PRIVATE bool operator!=(const HpackString& a, base::StringPiece b); |
NET_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& out, |
const HpackString& v); |
+struct NET_EXPORT_PRIVATE HpackStringPair { |
+ HpackStringPair(const HpackString& name, const HpackString& value); |
+ HpackStringPair(base::StringPiece name, base::StringPiece value); |
+ ~HpackStringPair(); |
+ |
+ // Returns the size of a header entry with this name and value, per the RFC: |
+ // http://httpwg.org/specs/rfc7541.html#calculating.table.size |
+ size_t size() const { return 32 + name.size() + value.size(); } |
+ |
+ std::string DebugString() const; |
+ |
+ HpackString name; |
+ HpackString value; |
+}; |
+ |
+NET_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os, |
+ const HpackStringPair& p); |
+ |
} // namespace net |
#endif // NET_HTTP2_HPACK_HPACK_STRING_H_ |