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

Unified Diff: net/quic/quic_chromium_client_stream.cc

Issue 1824403002: Add logging for headers sent and received in BidirectionalStreamQuicImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: net/quic/quic_chromium_client_stream.cc
diff --git a/net/quic/quic_chromium_client_stream.cc b/net/quic/quic_chromium_client_stream.cc
index ef71bf17c8f73f93dddb0e7120e3f1d22294c1a4..e8d3ec2f618998f65ee4068acd1cb4840f45b0e3 100644
--- a/net/quic/quic_chromium_client_stream.cc
+++ b/net/quic/quic_chromium_client_stream.cc
@@ -10,6 +10,7 @@
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/quic/quic_chromium_client_session.h"
+#include "net/quic/quic_http_utils.h"
#include "net/quic/quic_spdy_session.h"
#include "net/quic/quic_write_blocked_list.h"
#include "net/quic/spdy_utils.h"
@@ -104,6 +105,18 @@ void QuicChromiumClientStream::OnCanWrite() {
}
}
+size_t QuicChromiumClientStream::WriteHeaders(
+ const SpdyHeaderBlock& header_block,
+ bool fin,
+ QuicAckListenerInterface* ack_notifier_delegate) {
+ // Log request headers to the QuicSession's net log.
mmenke 2016/03/23 20:32:21 Think these comments are confusing - we're logging
xunjieli 2016/03/23 22:19:23 Done.
+ net_log_.AddEvent(
+ NetLog::TYPE_QUIC_CHROMIUM_CLIENT_STREAM_SEND_REQUEST_HEADERS,
+ base::Bind(&QuicRequestNetLogCallback, id(), &header_block,
+ QuicSpdyStream::priority()));
+ return QuicSpdyStream::WriteHeaders(header_block, fin, ack_notifier_delegate);
+}
+
SpdyPriority QuicChromiumClientStream::priority() const {
if (delegate_ && delegate_->HasSendHeadersComplete()) {
return QuicSpdyStream::priority();
@@ -187,10 +200,20 @@ void QuicChromiumClientStream::NotifyDelegateOfHeadersComplete(
if (!delegate_)
return;
// Only mark trailers consumed when we are about to notify delegate.
- if (headers_delivered_)
+ if (headers_delivered_) {
MarkTrailersConsumed(decompressed_trailers().length());
+ // Log response trailers to the QuicSession's net log.
+ net_log_.AddEvent(
+ NetLog::TYPE_QUIC_CHROMIUM_CLIENT_STREAM_READ_RESPONSE_TRAILERS,
+ base::Bind(&SpdyHeaderBlockNetLogCallback, &headers));
+ } else {
+ headers_delivered_ = true;
+ // Log response headers to the QuicSession's net log.
+ net_log_.AddEvent(
+ NetLog::TYPE_QUIC_CHROMIUM_CLIENT_STREAM_READ_RESPONSE_HEADERS,
+ base::Bind(&SpdyHeaderBlockNetLogCallback, &headers));
+ }
- headers_delivered_ = true;
delegate_->OnHeadersAvailable(headers, frame_len);
}

Powered by Google App Engine
This is Rietveld 408576698