Index: net/http/bidirectional_stream.cc |
diff --git a/net/http/bidirectional_stream.cc b/net/http/bidirectional_stream.cc |
index d7a4a2ea6eebef7da97a03fd3b23aca1705c010d..1d3af661cfda74a0e9792896f767049859f7d721 100644 |
--- a/net/http/bidirectional_stream.cc |
+++ b/net/http/bidirectional_stream.cc |
@@ -23,6 +23,8 @@ |
#include "net/http/http_response_headers.h" |
#include "net/http/http_stream.h" |
#include "net/log/net_log_capture_mode.h" |
+#include "net/log/net_log_event_type.h" |
+#include "net/log/net_log_source_type.h" |
#include "net/spdy/spdy_header_block.h" |
#include "net/spdy/spdy_http_utils.h" |
#include "net/ssl/ssl_cert_request_info.h" |
@@ -80,7 +82,7 @@ BidirectionalStream::BidirectionalStream( |
std::unique_ptr<base::Timer> timer) |
: request_info_(std::move(request_info)), |
net_log_(BoundNetLog::Make(session->net_log(), |
- NetLog::SOURCE_BIDIRECTIONAL_STREAM)), |
+ NetLogSourceType::BIDIRECTIONAL_STREAM)), |
session_(session), |
send_request_headers_automatically_(send_request_headers_automatically), |
request_headers_sent_(false), |
@@ -92,7 +94,7 @@ BidirectionalStream::BidirectionalStream( |
if (net_log_.IsCapturing()) { |
net_log_.BeginEvent( |
- NetLog::TYPE_BIDIRECTIONAL_STREAM_ALIVE, |
+ NetLogEventType::BIDIRECTIONAL_STREAM_ALIVE, |
base::Bind(&NetLogCallback, &request_info_->url, &request_info_->method, |
base::Unretained(&request_info_->extra_headers))); |
} |
@@ -128,7 +130,7 @@ BidirectionalStream::BidirectionalStream( |
BidirectionalStream::~BidirectionalStream() { |
UpdateHistograms(); |
if (net_log_.IsCapturing()) { |
- net_log_.EndEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_ALIVE); |
+ net_log_.EndEvent(NetLogEventType::BIDIRECTIONAL_STREAM_ALIVE); |
} |
} |
@@ -147,13 +149,13 @@ int BidirectionalStream::ReadData(IOBuffer* buf, int buf_len) { |
if (rv > 0) { |
read_end_time_ = base::TimeTicks::Now(); |
net_log_.AddByteTransferEvent( |
- NetLog::TYPE_BIDIRECTIONAL_STREAM_BYTES_RECEIVED, rv, buf->data()); |
+ NetLogEventType::BIDIRECTIONAL_STREAM_BYTES_RECEIVED, rv, buf->data()); |
} else if (rv == ERR_IO_PENDING) { |
read_buffer_ = buf; |
// Bytes will be logged in OnDataRead(). |
} |
if (net_log_.IsCapturing()) { |
- net_log_.AddEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_READ_DATA, |
+ net_log_.AddEvent(NetLogEventType::BIDIRECTIONAL_STREAM_READ_DATA, |
NetLog::IntCallback("rv", rv)); |
} |
return rv; |
@@ -167,7 +169,7 @@ void BidirectionalStream::SendData(const scoped_refptr<IOBuffer>& data, |
DCHECK(write_buffer_len_list_.empty()); |
if (net_log_.IsCapturing()) { |
- net_log_.AddEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_SEND_DATA); |
+ net_log_.AddEvent(NetLogEventType::BIDIRECTIONAL_STREAM_SEND_DATA); |
} |
stream_impl_->SendData(data, length, end_stream); |
write_buffer_list_.push_back(data); |
@@ -184,7 +186,7 @@ void BidirectionalStream::SendvData( |
DCHECK(write_buffer_len_list_.empty()); |
if (net_log_.IsCapturing()) { |
- net_log_.AddEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_SENDV_DATA, |
+ net_log_.AddEvent(NetLogEventType::BIDIRECTIONAL_STREAM_SENDV_DATA, |
NetLog::IntCallback("num_buffers", buffers.size())); |
} |
stream_impl_->SendvData(buffers, lengths, end_stream); |
@@ -219,7 +221,7 @@ 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, |
+ NetLogEventType::BIDIRECTIONAL_STREAM_READY, |
NetLog::BoolCallback("request_headers_sent", request_headers_sent)); |
} |
send_start_time_ = base::TimeTicks::Now(); |
@@ -236,7 +238,7 @@ void BidirectionalStream::OnHeadersReceived( |
return; |
} |
if (net_log_.IsCapturing()) { |
- net_log_.AddEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_HEADERS, |
+ net_log_.AddEvent(NetLogEventType::BIDIRECTIONAL_STREAM_RECV_HEADERS, |
base::Bind(&NetLogHeadersCallback, &response_headers)); |
} |
read_start_time_ = base::TimeTicks::Now(); |
@@ -252,7 +254,7 @@ void BidirectionalStream::OnDataRead(int bytes_read) { |
if (net_log_.IsCapturing()) { |
net_log_.AddByteTransferEvent( |
- NetLog::TYPE_BIDIRECTIONAL_STREAM_BYTES_RECEIVED, bytes_read, |
+ NetLogEventType::BIDIRECTIONAL_STREAM_BYTES_RECEIVED, bytes_read, |
read_buffer_->data()); |
} |
read_end_time_ = base::TimeTicks::Now(); |
@@ -267,17 +269,18 @@ void BidirectionalStream::OnDataSent() { |
if (net_log_.IsCapturing()) { |
if (write_buffer_list_.size() > 1) { |
net_log_.BeginEvent( |
- NetLog::TYPE_BIDIRECTIONAL_STREAM_BYTES_SENT_COALESCED, |
+ NetLogEventType::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, |
+ NetLogEventType::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); |
+ net_log_.EndEvent( |
+ NetLogEventType::BIDIRECTIONAL_STREAM_BYTES_SENT_COALESCED); |
} |
} |
send_end_time_ = base::TimeTicks::Now(); |
@@ -288,7 +291,7 @@ void BidirectionalStream::OnDataSent() { |
void BidirectionalStream::OnTrailersReceived(const SpdyHeaderBlock& trailers) { |
if (net_log_.IsCapturing()) { |
- net_log_.AddEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_TRAILERS, |
+ net_log_.AddEvent(NetLogEventType::BIDIRECTIONAL_STREAM_RECV_TRAILERS, |
base::Bind(&NetLogHeadersCallback, &trailers)); |
} |
read_end_time_ = base::TimeTicks::Now(); |
@@ -297,7 +300,7 @@ void BidirectionalStream::OnTrailersReceived(const SpdyHeaderBlock& trailers) { |
void BidirectionalStream::OnFailed(int status) { |
if (net_log_.IsCapturing()) { |
- net_log_.AddEvent(NetLog::TYPE_BIDIRECTIONAL_STREAM_FAILED, |
+ net_log_.AddEvent(NetLogEventType::BIDIRECTIONAL_STREAM_FAILED, |
NetLog::IntCallback("net_error", status)); |
} |
NotifyFailed(status); |