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

Unified Diff: net/spdy/spdy_framer.h

Issue 12224019: Add SpdyFramerDebugVisitorInterface for later usage in stats collecting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile failure Created 7 years, 10 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 | « no previous file | net/spdy/spdy_framer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.h
diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h
index 80ff71c17bfc7566995cb8f5a4dbc7a5c0b185c2..375aa8b86bcb098ade838d2e59628e219e252aa2 100644
--- a/net/spdy/spdy_framer.h
+++ b/net/spdy/spdy_framer.h
@@ -214,6 +214,22 @@ class NET_EXPORT_PRIVATE SpdyFramerVisitorInterface {
const SpdyControlFrame& compressed_frame) = 0;
};
+// Optionally, and in addition to SpdyFramerVisitorInterface, a class supporting
+// SpdyFramerDebugVisitorInterface may be used in conjunction with SpdyFramer in
+// order to extract debug/internal information about the SpdyFramer as it
+// operates.
+//
+// Most SPDY implementations need not bother with this interface at all.
+class SpdyFramerDebugVisitorInterface {
+ public:
+ virtual ~SpdyFramerDebugVisitorInterface() {}
+
+ // Called after compressing header blocks.
+ // Provides decompressed and compressed sizes.
+ virtual void OnCompressedHeaderBlock(size_t decompressed_len,
+ size_t compressed_len) {}
+};
+
class NET_EXPORT_PRIVATE SpdyFramer {
public:
// SPDY states.
@@ -284,6 +300,13 @@ class NET_EXPORT_PRIVATE SpdyFramer {
visitor_ = visitor;
}
+ // Set debug callbacks to be called from the framer. The debug visitor is
+ // completely optional and need not be set in order for normal operation.
+ // If this is called multiple times, only the last visitor will be used.
+ void set_debug_visitor(SpdyFramerDebugVisitorInterface* debug_visitor) {
+ debug_visitor_ = debug_visitor;
+ }
+
// Pass data into the framer for parsing.
// Returns the number of bytes consumed. It is safe to pass more bytes in
// than may be consumed.
@@ -579,6 +602,7 @@ class NET_EXPORT_PRIVATE SpdyFramer {
scoped_ptr<z_stream> header_decompressor_;
SpdyFramerVisitorInterface* visitor_;
+ SpdyFramerDebugVisitorInterface* debug_visitor_;
std::string display_protocol_;
« no previous file with comments | « no previous file | net/spdy/spdy_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698