Commit f88028e3 authored by xunjieli's avatar xunjieli Committed by Commit bot

Log BIDIRECTIONL_STREAM_ALIVE before HTTP_STREAM_REQUEST

This CL logs BIDIRECTIONL_STREAM_ALIVE before we start any stream request.
This makes sure that HTTP_STREAM_REQUEST is nested inside
BIDIRECTIONL_STREAM_ALIVE begin and end events.

BUG=516342

Review-Url: https://codereview.chromium.org/2016863002
Cr-Commit-Position: refs/heads/master@{#397205}
parent 453035e2
...@@ -90,6 +90,13 @@ BidirectionalStream::BidirectionalStream( ...@@ -90,6 +90,13 @@ BidirectionalStream::BidirectionalStream(
DCHECK(delegate_); DCHECK(delegate_);
DCHECK(request_info_); DCHECK(request_info_);
if (net_log_.IsCapturing()) {
net_log_.BeginEvent(
NetLog::TYPE_BIDIRECTIONAL_STREAM_ALIVE,
base::Bind(&NetLogCallback, &request_info_->url, &request_info_->method,
base::Unretained(&request_info_->extra_headers)));
}
SSLConfig server_ssl_config; SSLConfig server_ssl_config;
session->ssl_config_service()->GetSSLConfig(&server_ssl_config); session->ssl_config_service()->GetSSLConfig(&server_ssl_config);
session->GetAlpnProtos(&server_ssl_config.alpn_protos); session->GetAlpnProtos(&server_ssl_config.alpn_protos);
...@@ -116,12 +123,6 @@ BidirectionalStream::BidirectionalStream( ...@@ -116,12 +123,6 @@ BidirectionalStream::BidirectionalStream(
// Check that HttpStreamFactory does not invoke OnBidirectionalStreamImplReady // Check that HttpStreamFactory does not invoke OnBidirectionalStreamImplReady
// synchronously. // synchronously.
DCHECK(!stream_impl_); DCHECK(!stream_impl_);
if (net_log_.IsCapturing()) {
net_log_.BeginEvent(
NetLog::TYPE_BIDIRECTIONAL_STREAM_ALIVE,
base::Bind(&NetLogCallback, &request_info_->url, &request_info_->method,
base::Unretained(&request_info_->extra_headers)));
}
} }
BidirectionalStream::~BidirectionalStream() { BidirectionalStream::~BidirectionalStream() {
......
...@@ -580,7 +580,12 @@ TEST_F(BidirectionalStreamTest, TestNetLogContainEntries) { ...@@ -580,7 +580,12 @@ TEST_F(BidirectionalStreamTest, TestNetLogContainEntries) {
net_log_.GetEntries(&entries); net_log_.GetEntries(&entries);
size_t index = ExpectLogContainsSomewhere( size_t index = ExpectLogContainsSomewhere(
entries, 0, NetLog::TYPE_BIDIRECTIONAL_STREAM_ALIVE, NetLog::PHASE_BEGIN); entries, 0, NetLog::TYPE_BIDIRECTIONAL_STREAM_ALIVE, NetLog::PHASE_BEGIN);
// Headers received should happen after BIDIRECTIONAL_STREAM_ALIVE. // HTTP_STREAM_REQUEST is nested inside in BIDIRECTIONAL_STREAM_ALIVE.
index = ExpectLogContainsSomewhere(
entries, index, NetLog::TYPE_HTTP_STREAM_REQUEST, NetLog::PHASE_BEGIN);
index = ExpectLogContainsSomewhere(
entries, index, NetLog::TYPE_HTTP_STREAM_REQUEST, NetLog::PHASE_END);
// Headers received should happen after HTTP_STREAM_REQUEST.
index = ExpectLogContainsSomewhere( index = ExpectLogContainsSomewhere(
entries, index, NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_HEADERS, entries, index, NetLog::TYPE_BIDIRECTIONAL_STREAM_RECV_HEADERS,
NetLog::PHASE_NONE); NetLog::PHASE_NONE);
......
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