From a25d7e09c74505a08160143dcd5b2e9d6b88874e Mon Sep 17 00:00:00 2001 From: bnc Date: Thu, 26 Feb 2015 08:51:46 -0800 Subject: Log sending HTTP/2 HEADERS frames correctly. This CL changes the event type logged when HTTP/2 HEADERS frame is sent to reflect that fact that it is not a SYN_STREAM (which does not even exist in HTTP2). BUG=456986 Review URL: https://codereview.chromium.org/959903002 Cr-Commit-Position: refs/heads/master@{#318249} --- net/spdy/spdy_network_transaction_unittest.cc | 9 ++++++--- net/spdy/spdy_session.cc | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'net') diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index 83f6bc0..a79d76a 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc @@ -3779,9 +3779,12 @@ TEST_P(SpdyNetworkTransactionTest, NetLog) { net::NetLog::PHASE_END); // Check that we logged all the headers correctly - pos = net::ExpectLogContainsSomewhere( - entries, 0, net::NetLog::TYPE_HTTP2_SESSION_SYN_STREAM, - net::NetLog::PHASE_NONE); + const NetLog::EventType type = + (GetParam().protocol <= kProtoSPDY31) + ? net::NetLog::TYPE_HTTP2_SESSION_SYN_STREAM + : net::NetLog::TYPE_HTTP2_SESSION_SEND_HEADERS; + pos = net::ExpectLogContainsSomewhere(entries, 0, type, + net::NetLog::PHASE_NONE); base::ListValue* header_list; ASSERT_TRUE(entries[pos].params.get()); diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index b6318e0..a5a1ea6 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -1083,7 +1083,11 @@ scoped_ptr SpdySession::CreateSynStream( streams_initiated_count_++; if (net_log().IsLogging()) { - net_log().AddEvent(NetLog::TYPE_HTTP2_SESSION_SYN_STREAM, + const NetLog::EventType type = + (GetProtocolVersion() <= SPDY3) + ? NetLog::TYPE_HTTP2_SESSION_SYN_STREAM + : NetLog::TYPE_HTTP2_SESSION_SEND_HEADERS; + net_log().AddEvent(type, base::Bind(&NetLogSpdySynStreamSentCallback, &block, (flags & CONTROL_FLAG_FIN) != 0, (flags & CONTROL_FLAG_UNIDIRECTIONAL) != 0, -- cgit v1.1