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

Unified Diff: net/spdy/hpack/hpack_header_table.h

Issue 1989003002: QUIC - add instrumentation to HPACK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase-update Created 4 years, 7 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/spdy/hpack/hpack_entry.h ('k') | net/spdy/hpack/hpack_header_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack/hpack_header_table.h
diff --git a/net/spdy/hpack/hpack_header_table.h b/net/spdy/hpack/hpack_header_table.h
index 02b9e27d7458c3e8756415cf32ce2d86b2df593c..3fb8036a9e5217cc3d10b6da2568b1e6f67d3733 100644
--- a/net/spdy/hpack/hpack_header_table.h
+++ b/net/spdy/hpack/hpack_header_table.h
@@ -7,6 +7,7 @@
#include <cstddef>
#include <deque>
+#include <memory>
#include <unordered_map>
#include <unordered_set>
@@ -28,6 +29,28 @@ class NET_EXPORT_PRIVATE HpackHeaderTable {
public:
friend class test::HpackHeaderTablePeer;
+ // Debug visitor my be used to extract debug/internal information
+ // about the HpackHeaderTable as it operates.
+ //
+ // Most HpackHeaderTable implementations do not need to bother with
+ // this interface at all.
+ class DebugVisitorInterface {
+ public:
+ virtual ~DebugVisitorInterface() {}
+
+ // |OnNewEntry()| and |OnUseEntry()| can be used together to
+ // gather data about the distribution of time intervals between
+ // creation and reference of entries in the dynamic table. The
+ // data is desired to sanity check a proposed extension to HPACK
+ // for QUIC that would eliminate inter-stream head of line
+ // blocking (due to standard HPACK). The visitor should return
+ // the current time from |OnNewEntry()|, which will be passed
+ // to |OnUseEntry()| each time that particular entry is used to
+ // emit an indexed representation.
+ virtual int64_t OnNewEntry(const HpackEntry& entry) = 0;
+ virtual void OnUseEntry(const HpackEntry& entry) = 0;
+ };
+
// HpackHeaderTable takes advantage of the deque property that references
// remain valid, so long as insertions & deletions are at the head & tail.
// If this changes (eg we start to drop entries from the middle of the table),
@@ -98,6 +121,10 @@ class NET_EXPORT_PRIVATE HpackHeaderTable {
void DebugLogTableState() const;
+ void set_debug_visitor(std::unique_ptr<DebugVisitorInterface> visitor) {
+ debug_visitor_ = std::move(visitor);
+ }
+
private:
// Returns number of evictions required to enter |name| & |value|.
size_t EvictionCountForEntry(base::StringPiece name,
@@ -139,6 +166,8 @@ class NET_EXPORT_PRIVATE HpackHeaderTable {
// IndexOf() for determination of an HpackEntry's table index.
size_t total_insertions_;
+ std::unique_ptr<DebugVisitorInterface> debug_visitor_;
+
DISALLOW_COPY_AND_ASSIGN(HpackHeaderTable);
};
« no previous file with comments | « net/spdy/hpack/hpack_entry.h ('k') | net/spdy/hpack/hpack_header_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698