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

Unified Diff: net/quic/quic_connection_logger.cc

Issue 338933003: Log QuicGoAwayFrames and QuicPingFrames, sent and received, in net log. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Documented GOAWAY fields Created 6 years, 6 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/quic/quic_connection_logger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_logger.cc
diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc
index bee8b5ccf4359af8767cbcf76514e72c50c6aed8..86f9c6a11737e7cd9e08999109f339ba881fd0f4 100644
--- a/net/quic/quic_connection_logger.cc
+++ b/net/quic/quic_connection_logger.cc
@@ -195,6 +195,16 @@ base::Value* NetLogQuicBlockedFrameCallback(
return dict;
}
+base::Value* NetLogQuicGoAwayFrameCallback(
+ const QuicGoAwayFrame* frame,
+ NetLog::LogLevel /* log_level */) {
+ base::DictionaryValue* dict = new base::DictionaryValue();
+ dict->SetInteger("quic_error", frame->error_code);
+ dict->SetInteger("last_good_stream_id", frame->last_good_stream_id);
+ dict->SetString("reason_phrase", frame->reason_phrase);
+ return dict;
+}
+
base::Value* NetLogQuicStopWaitingFrameCallback(
const QuicStopWaitingFrame* frame,
NetLog::LogLevel /* log_level */) {
@@ -386,6 +396,10 @@ void QuicConnectionLogger::OnFrameAddedToPacket(const QuicFrame& frame) {
frame.connection_close_frame));
break;
case GOAWAY_FRAME:
+ net_log_.AddEvent(
+ NetLog::TYPE_QUIC_SESSION_GOAWAY_FRAME_SENT,
+ base::Bind(&NetLogQuicGoAwayFrameCallback,
+ frame.goaway_frame));
break;
case WINDOW_UPDATE_FRAME:
net_log_.AddEvent(
@@ -405,6 +419,10 @@ void QuicConnectionLogger::OnFrameAddedToPacket(const QuicFrame& frame) {
base::Bind(&NetLogQuicStopWaitingFrameCallback,
frame.stop_waiting_frame));
break;
+ case PING_FRAME:
+ // PingFrame has no contents to log, so just record that it was sent.
+ net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PING_FRAME_SENT);
+ break;
default:
DCHECK(false) << "Illegal frame type: " << frame.type;
}
@@ -578,6 +596,17 @@ void QuicConnectionLogger::OnBlockedFrame(const QuicBlockedFrame& frame) {
base::Bind(&NetLogQuicBlockedFrameCallback, &frame));
}
+void QuicConnectionLogger::OnGoAwayFrame(const QuicGoAwayFrame& frame) {
+ net_log_.AddEvent(
+ NetLog::TYPE_QUIC_SESSION_GOAWAY_FRAME_RECEIVED,
+ base::Bind(&NetLogQuicGoAwayFrameCallback, &frame));
+}
+
+void QuicConnectionLogger::OnPingFrame(const QuicPingFrame& frame) {
+ // PingFrame has no contents to log, so just record that it was received.
+ net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PING_FRAME_RECEIVED);
+}
+
void QuicConnectionLogger::OnPublicResetPacket(
const QuicPublicResetPacket& packet) {
net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PUBLIC_RESET_PACKET_RECEIVED);
« no previous file with comments | « net/quic/quic_connection_logger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698