Commit 1df596f9 authored by David Schinazi's avatar David Schinazi Committed by Commit Bot

Display QUIC+TLS transport parameters in netlog

This CL adds new events to record transport parameters,
and implements the right QuicConnectionDebugVisitor calls
to access the transport parameters. I've confirmed that
they show up in netlog locally.

R=nharper@chromium.org

Change-Id: I297c57c594eea349b46e40654063e8c9140e39f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210783
Auto-Submit: David Schinazi <dschinazi@chromium.org>
Commit-Queue: Nick Harper <nharper@chromium.org>
Reviewed-by: default avatarNick Harper <nharper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770813}
parent 874446e3
......@@ -2004,6 +2004,20 @@ EVENT_TYPE(QUIC_SESSION_CRYPTO_HANDSHAKE_MESSAGE_RECEIVED)
// }
EVENT_TYPE(QUIC_SESSION_CRYPTO_HANDSHAKE_MESSAGE_SENT)
// A QUIC connection received transport parameters.
// {
// "quic_transport_parameters": <Human readable view of the transport
// parameters>
// }
EVENT_TYPE(QUIC_SESSION_TRANSPORT_PARAMETERS_RECEIVED)
// A QUIC connection sent transport parameters.
// {
// "quic_transport_parameters": <Human readable view of the transport
// parameters>
// }
EVENT_TYPE(QUIC_SESSION_TRANSPORT_PARAMETERS_SENT)
// A QUIC connection received a PUSH_PROMISE frame. The following
// parameters are attached:
// {
......
......@@ -227,6 +227,14 @@ base::Value NetLogQuicCryptoHandshakeMessageParams(
return dict;
}
base::Value NetLogQuicTransportParametersParams(
const quic::TransportParameters& transport_parameters) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("quic_transport_parameters",
transport_parameters.ToString());
return dict;
}
base::Value NetLogQuicOnConnectionClosedParams(
quic::QuicErrorCode error,
string error_details,
......@@ -1142,6 +1150,26 @@ void QuicConnectionLogger::OnRttChanged(quic::QuicTime::Delta rtt) const {
}
}
void QuicConnectionLogger::OnTransportParametersSent(
const quic::TransportParameters& transport_parameters) {
if (!net_log_.IsCapturing())
return;
net_log_.AddEvent(
NetLogEventType::QUIC_SESSION_TRANSPORT_PARAMETERS_SENT, [&] {
return NetLogQuicTransportParametersParams(transport_parameters);
});
}
void QuicConnectionLogger::OnTransportParametersReceived(
const quic::TransportParameters& transport_parameters) {
if (!net_log_.IsCapturing())
return;
net_log_.AddEvent(
NetLogEventType::QUIC_SESSION_TRANSPORT_PARAMETERS_RECEIVED, [&] {
return NetLogQuicTransportParametersParams(transport_parameters);
});
}
void QuicConnectionLogger::RecordAggregatePacketLossRate() const {
// For short connections under 22 packets in length, we'll rely on the
// Net.QuicSession.21CumulativePacketsReceived_* histogram to indicate packet
......
......@@ -109,6 +109,10 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
void OnSuccessfulVersionNegotiation(
const quic::ParsedQuicVersion& version) override;
void OnRttChanged(quic::QuicTime::Delta rtt) const override;
void OnTransportParametersSent(
const quic::TransportParameters& transport_parameters) override;
void OnTransportParametersReceived(
const quic::TransportParameters& transport_parameters) override;
void OnCryptoHandshakeMessageReceived(
const quic::CryptoHandshakeMessage& message);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment