diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-15 00:36:54 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-15 00:36:54 +0000 |
commit | 429e1ec2b634ce856c43f077ae6d18d537fc86f2 (patch) | |
tree | 42df518dba3797644bbbdf6ec5e05fbd85d7d9d4 | |
parent | a938b706f6a17ffe41143c0637f4e713467894d0 (diff) | |
download | chromium_src-429e1ec2b634ce856c43f077ae6d18d537fc86f2.zip chromium_src-429e1ec2b634ce856c43f077ae6d18d537fc86f2.tar.gz chromium_src-429e1ec2b634ce856c43f077ae6d18d537fc86f2.tar.bz2 |
SPDY: Add push streams to the NetLog.
For streams that already have delegates, they have their own NetLogs so use those.
For streams that don't have delegates, just write out to the session's NetLog.
TODO(willchan): Use a different event type once the SpdySession NetLog tracker is landed.
Review URL: http://codereview.chromium.org/2101003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47346 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/base/net_log_event_type_list.h | 10 | ||||
-rw-r--r-- | net/spdy/spdy_session.cc | 19 |
2 files changed, 28 insertions, 1 deletions
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h index 7a75f26..d849611 100644 --- a/net/base/net_log_event_type_list.h +++ b/net/base/net_log_event_type_list.h @@ -378,6 +378,16 @@ EVENT_TYPE(SPDY_TRANSACTION_READ_BODY) // } EVENT_TYPE(SPDY_STREAM_SYN_STREAM) +// This event is sent for a SPDY SYN_STREAM pushed by the server, where a +// URLRequest is already waiting for the stream. +// The following parameters are attached: +// { +// "flags": <The control frame flags> +// "headers": <The list of header:value pairs> +// "id": <The stream id> +// } +EVENT_TYPE(SPDY_STREAM_PUSHED_SYN_STREAM) + // Measures the time taken to send headers on a stream. EVENT_TYPE(SPDY_STREAM_SEND_HEADERS) diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 4208d06..55c0b65 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -1012,10 +1012,27 @@ void SpdySession::OnSyn(const spdy::SpdySynStreamControlFrame& frame, CHECK(stream->pushed()); CHECK_EQ(0u, stream->stream_id()); stream->set_stream_id(stream_id); + const BoundNetLog& log = stream->net_log(); + if (log.HasListener()) { + log.AddEvent( + NetLog::TYPE_SPDY_STREAM_PUSHED_SYN_STREAM, + new NetLogSpdySynParameter( + headers, static_cast<spdy::SpdyControlFlags>(frame.flags()), + stream_id)); + } } else { - // TODO(willchan): can we figure out how to use a NetLog here? stream = new SpdyStream(this, stream_id, true); + // TODO(willchan): Rename this event to SPDY_SESSION_PUSHED_SYN_STREAM once + // my other CL gets finished. + if (net_log_.HasListener()) { + net_log_.AddEvent( + NetLog::TYPE_SPDY_STREAM_PUSHED_SYN_STREAM, + new NetLogSpdySynParameter( + headers, static_cast<spdy::SpdyControlFlags>(frame.flags()), + stream_id)); + } + // A new HttpResponseInfo object needs to be generated so the call to // OnResponseReceived below has something to fill in. // When a SpdyNetworkTransaction is created for this resource, the |