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

Unified Diff: net/quic/quic_connection.h

Issue 12254037: Add a DebugVisitor to QuicConnection to facilitate logging the activity on a QUIC connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/quic/quic_connection.cc » ('j') | net/quic/quic_connection.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.h
diff --git a/net/quic/quic_connection.h b/net/quic/quic_connection.h
index b28727ebdfaa8737e579e0bfa46f6b6f1dd181cd..bd878b71d77316e189b05ff327bad5665bdabd62 100644
--- a/net/quic/quic_connection.h
+++ b/net/quic/quic_connection.h
@@ -73,6 +73,48 @@ class NET_EXPORT_PRIVATE QuicConnectionVisitorInterface {
virtual bool OnCanWrite() = 0;
};
+// Interface which gets callbacks from the QuicConnection at interesting
+// points. Implementations must not mutate the state of the connection
+// as a result of these callbacks.
+class QuicConnectionDebugVisitorInterface {
+ public:
+ virtual ~QuicConnectionDebugVisitorInterface() {}
+
+ // Called when a packet has been received, but before it is
+ // validated or parsed.
+ virtual void OnPacketReceived(const IPEndPoint& self_address,
+ const IPEndPoint& peer_address,
+ const QuicEncryptedPacket& packet) = 0;
+
+ // Called when the header of a packet has been parsed.
+ virtual void OnPacketHeader(const QuicPacketHeader& header) = 0;
+
+ // Called when a StreamFrame has been parsed.
+ virtual void OnStreamFrame(const QuicStreamFrame& frame) = 0;
+
+ // Called when a AckFrame has been parsed.
+ virtual void OnAckFrame(const QuicAckFrame& frame) = 0;
+
+ // Called when a CongestionFeedbackFrame has been parsed.
+ virtual void OnCongestionFeedbackFrame(
+ const QuicCongestionFeedbackFrame& frame) = 0;
+
+ // Called when a RstStreamFrame has been parsed.
+ virtual void OnRstStreamFrame(const QuicRstStreamFrame& frame) = 0;
+
+ // Called when a ConnectionCloseFrame has been parsed.
+ virtual void OnConnectionCloseFrame(
+ const QuicConnectionCloseFrame& frame) = 0;
+
+ // Called when a public reset packet has been received.
+ virtual void OnPublicResetPacket(const QuicPublicResetPacket& packet) = 0;
+
+ // Called after a packet has been successfully parsed which results
+ // in the revival of a packet via FEC.
+ virtual void OnRevivedPacket(const QuicPacketHeader& revived_header,
+ base::StringPiece payload) = 0;
+};
+
class NET_EXPORT_PRIVATE QuicConnectionHelperInterface {
public:
virtual ~QuicConnectionHelperInterface() {}
@@ -195,6 +237,9 @@ class NET_EXPORT_PRIVATE QuicConnection : public QuicFramerVisitorInterface,
void set_visitor(QuicConnectionVisitorInterface* visitor) {
visitor_ = visitor;
}
+ void set_debug_visitor(QuicConnectionDebugVisitorInterface* debug_visitor) {
+ debug_visitor_ = debug_visitor;
+ }
const IPEndPoint& self_address() const { return self_address_; }
const IPEndPoint& peer_address() const { return peer_address_; }
QuicGuid guid() const { return guid_; }
@@ -440,6 +485,7 @@ class NET_EXPORT_PRIVATE QuicConnection : public QuicFramerVisitorInterface,
FecGroupMap group_map_;
QuicConnectionVisitorInterface* visitor_;
+ QuicConnectionDebugVisitorInterface* debug_visitor_;
QuicPacketCreator packet_creator_;
// Network idle time before we kill of this connection.
« no previous file with comments | « no previous file | net/quic/quic_connection.cc » ('j') | net/quic/quic_connection.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698