diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 22:59:51 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-13 22:59:51 +0000 |
commit | 2d188d39fac27d1ac0aebcbca3a830d532015744 (patch) | |
tree | 77deafb5892357038db1c4950d023d60a40eed6f /net/quic/quic_http_stream.cc | |
parent | a455dc1cd90621fb2ab0b9d0dc43b57a801e26aa (diff) | |
download | chromium_src-2d188d39fac27d1ac0aebcbca3a830d532015744.zip chromium_src-2d188d39fac27d1ac0aebcbca3a830d532015744.tar.gz chromium_src-2d188d39fac27d1ac0aebcbca3a830d532015744.tar.bz2 |
Enhance net internals/net log output for QUIC.
Review URL: https://chromiumcodereview.appspot.com/12207020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_http_stream.cc')
-rw-r--r-- | net/quic/quic_http_stream.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc index 4439ef7..0eaf0a1 100644 --- a/net/quic/quic_http_stream.cc +++ b/net/quic/quic_http_stream.cc @@ -48,6 +48,7 @@ int QuicHttpStream::InitializeStream(const HttpRequestInfo* request_info, const CompletionCallback& callback) { CHECK(stream_); + stream_net_log_ = stream_net_log; request_info_ = request_info; return OK; @@ -72,12 +73,32 @@ int QuicHttpStream::SendRequest(const HttpRequestHeaders& request_headers, SpdyFramer::WriteHeaderBlock(&builder, 3, &headers); scoped_ptr<SpdyFrame> frame(builder.take()); request_ = std::string(frame->data(), len); + // Log the actual request with the URL Request's net log. + stream_net_log_.AddEvent( + NetLog::TYPE_HTTP_TRANSACTION_SPDY_SEND_REQUEST_HEADERS, + base::Bind(&SpdyHeaderBlockNetLogCallback, &headers)); + // Also log to the QuicSession's net log. + stream_->net_log().AddEvent( + NetLog::TYPE_QUIC_HTTP_STREAM_SEND_REQUEST_HEADERS, + base::Bind(&SpdyHeaderBlockNetLogCallback, &headers)); } else { std::string path = HttpUtil::PathForRequest(request_info_->url); std::string first_line = base::StringPrintf("%s %s HTTP/1.1\r\n", request_info_->method.c_str(), path.c_str()); request_ = first_line + request_headers.ToString(); + // Log the actual request with the URL Request's net log. + stream_net_log_.AddEvent( + NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_HEADERS, + base::Bind(&HttpRequestHeaders::NetLogCallback, + base::Unretained(&request_headers), + &first_line)); + // Also log to the QuicSession's net log. + stream_->net_log().AddEvent( + NetLog::TYPE_QUIC_HTTP_STREAM_SEND_REQUEST_HEADERS, + base::Bind(&HttpRequestHeaders::NetLogCallback, + base::Unretained(&request_headers), + &first_line)); } // Store the request body. @@ -458,6 +479,12 @@ int QuicHttpStream::ParseResponseHeaders() { BufferResponseBody(read_buf_->data(), delta); } + // The URLRequest logs these headers, so only log to the QuicSession's + // net log. + stream_->net_log().AddEvent( + NetLog::TYPE_QUIC_HTTP_STREAM_READ_RESPONSE_HEADERS, + base::Bind(&SpdyHeaderBlockNetLogCallback, &headers)); + SpdyHeadersToHttpResponse(headers, 3, response_info_); // Put the peer's IP address and port into the response. IPEndPoint address = stream_->GetPeerAddress(); @@ -487,6 +514,13 @@ int QuicHttpStream::ParseResponseHeaders() { response_info_->vary_data.Init(*request_info_, *response_info_->headers); response_headers_received_ = true; + // The URLRequest logs these headers, so only log to the QuicSession's + // net log. + stream_->net_log().AddEvent( + NetLog::TYPE_QUIC_HTTP_STREAM_READ_RESPONSE_HEADERS, + base::Bind(&HttpResponseHeaders::NetLogCallback, + response_info_->headers)); + // Save the remaining received data. int delta = read_buf_->offset() - end_offset; if (delta > 0) { |