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

Unified Diff: net/http/bidirectional_stream.cc

Issue 2044583002: Improve NetLog logging in net::BidirectionalStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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 | « no previous file | net/http/bidirectional_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/bidirectional_stream.cc
diff --git a/net/http/bidirectional_stream.cc b/net/http/bidirectional_stream.cc
index 12aa0f63fe1587411d9efff1680c93d38588cc1e..1d8cbe93757e948df884a04ae1f1408c5cc0468e 100644
--- a/net/http/bidirectional_stream.cc
+++ b/net/http/bidirectional_stream.cc
@@ -213,6 +213,11 @@ int64_t BidirectionalStream::GetTotalSentBytes() const {
void BidirectionalStream::OnStreamReady(bool request_headers_sent) {
request_headers_sent_ = request_headers_sent;
+ if (net_log_.IsCapturing()) {
+ net_log_.AddEvent(
+ NetLog::TYPE_BIDIRECTIONAL_STREAM_READY,
+ NetLog::BoolCallback("request_headers_sent", request_headers_sent));
+ }
delegate_->OnStreamReady(request_headers_sent);
}
@@ -251,11 +256,20 @@ void BidirectionalStream::OnDataSent() {
DCHECK_EQ(write_buffer_list_.size(), write_buffer_len_list_.size());
if (net_log_.IsCapturing()) {
+ if (write_buffer_list_.size() > 1) {
+ net_log_.BeginEvent(
+ NetLog::TYPE_BIDIRECTIONAL_STREAM_BYTES_SENT_COALESCED,
+ NetLog::IntCallback("num_buffers_coalesced",
+ write_buffer_list_.size()));
+ }
for (size_t i = 0; i < write_buffer_list_.size(); ++i) {
net_log_.AddByteTransferEvent(
NetLog::TYPE_BIDIRECTIONAL_STREAM_BYTES_SENT,
write_buffer_len_list_[i], write_buffer_list_[i]->data());
}
+ if (write_buffer_list_.size() > 1) {
+ net_log_.EndEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_BYTES_SENT_COALESCED);
+ }
}
write_buffer_list_.clear();
write_buffer_len_list_.clear();
@@ -271,6 +285,10 @@ void BidirectionalStream::OnTrailersReceived(const SpdyHeaderBlock& trailers) {
}
void BidirectionalStream::OnFailed(int status) {
+ if (net_log_.IsCapturing()) {
+ net_log_.AddEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_FAILED,
+ NetLog::IntCallback("net_error", status));
+ }
NotifyFailed(status);
}
« no previous file with comments | « no previous file | net/http/bidirectional_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698