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

Unified Diff: net/spdy/hpack_encoder.h

Issue 243153003: HPACK optimal Huffman code instrumentation and UMA collection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review feedback & missing license header. Created 6 years, 8 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.gypi ('k') | net/spdy/hpack_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack_encoder.h
diff --git a/net/spdy/hpack_encoder.h b/net/spdy/hpack_encoder.h
index df504f50f83e52c39e1a53ae2fe074a10cc02f5b..ec03af0a5bec0c6578c9ef05c375116674a5a19a 100644
--- a/net/spdy/hpack_encoder.h
+++ b/net/spdy/hpack_encoder.h
@@ -56,6 +56,11 @@ class NET_EXPORT_PRIVATE HpackEncoder {
header_table_.SetSettingsHeaderTableSize(size_setting);
}
+ // Sets externally-owned storage for aggregating character counts of emitted
+ // literal representations.
+ void SetCharCountsStorage(std::vector<size_t>* char_counts,
+ size_t* total_char_counts);
+
private:
typedef std::pair<base::StringPiece, base::StringPiece> Representation;
typedef std::vector<Representation> Representations;
@@ -72,6 +77,8 @@ class NET_EXPORT_PRIVATE HpackEncoder {
// Emits a Huffman or identity string (whichever is smaller).
void EmitString(base::StringPiece str);
+ void UpdateCharacterCounts(base::StringPiece str);
+
// Determines the representation delta required to encode |header_set| in
// the current header table context. Entries in the reference set are
// enumerated and marked with membership in the current |header_set|.
@@ -88,6 +95,10 @@ class NET_EXPORT_PRIVATE HpackEncoder {
bool allow_huffman_compression_;
const HpackHuffmanTable& huffman_table_;
+ // Externally-owned, nullable storage for character counts of literals.
+ std::vector<size_t>* char_counts_;
+ size_t* total_char_counts_;
+
DISALLOW_COPY_AND_ASSIGN(HpackEncoder);
};
« no previous file with comments | « net/net.gypi ('k') | net/spdy/hpack_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698