diff options
author | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 23:46:12 +0000 |
---|---|---|
committer | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-06 23:46:12 +0000 |
commit | 1b1613a0db5cb2246f48c2694d6a36c04119d275 (patch) | |
tree | 1fd31e49145a5dbd86dd72cba946d0d5b028d9e4 /net | |
parent | b43a8979ea49b29dad4617c1a718493dd3973bf0 (diff) | |
download | chromium_src-1b1613a0db5cb2246f48c2694d6a36c04119d275.zip chromium_src-1b1613a0db5cb2246f48c2694d6a36c04119d275.tar.gz chromium_src-1b1613a0db5cb2246f48c2694d6a36c04119d275.tar.bz2 |
SPDY PING - log the type of PING if it is received
or sent ping (like below):
t=1323200233634 [st=196851] SPDY_SESSION_PING
--> type = "sent"
--> unique_id = 3
t=1323200233638 [st=196855] SPDY_SESSION_PING
--> type = "received"
--> unique_id = 3
BUG=106499
R=willchan
TEST=spdy unit tests
Review URL: http://codereview.chromium.org/8824005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113295 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/net_log_event_type_list.h | 1 | ||||
-rw-r--r-- | net/spdy/spdy_session.cc | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h index c6a8ff7..4c82672 100644 --- a/net/base/net_log_event_type_list.h +++ b/net/base/net_log_event_type_list.h @@ -952,6 +952,7 @@ EVENT_TYPE(SPDY_SESSION_SEND_RST_STREAM) // The following parameters are attached: // { // "unique_id": <The unique id of the PING message>, +// "type": <The PING type ("sent", "received")>, // } EVENT_TYPE(SPDY_SESSION_PING) diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 3e48230..6455167 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -175,17 +175,21 @@ class NetLogSpdyRstParameter : public NetLog::EventParameters { class NetLogSpdyPingParameter : public NetLog::EventParameters { public: - explicit NetLogSpdyPingParameter(uint32 unique_id) : unique_id_(unique_id) {} + explicit NetLogSpdyPingParameter(uint32 unique_id, const std::string& type) + : unique_id_(unique_id), + type_(type) {} virtual Value* ToValue() const { DictionaryValue* dict = new DictionaryValue(); dict->SetInteger("unique_id", unique_id_); + dict->SetString("type", type_); return dict; } private: ~NetLogSpdyPingParameter() {} const uint32 unique_id_; + const std::string type_; DISALLOW_COPY_AND_ASSIGN(NetLogSpdyPingParameter); }; @@ -1382,7 +1386,8 @@ void SpdySession::OnGoAway(const spdy::SpdyGoAwayControlFrame& frame) { void SpdySession::OnPing(const spdy::SpdyPingControlFrame& frame) { net_log_.AddEvent( NetLog::TYPE_SPDY_SESSION_PING, - make_scoped_refptr(new NetLogSpdyPingParameter(frame.unique_id()))); + make_scoped_refptr( + new NetLogSpdyPingParameter(frame.unique_id(), "received"))); // Send response to a PING from server. if (frame.unique_id() % 2 == 0) { @@ -1593,7 +1598,7 @@ void SpdySession::WritePingFrame(uint32 unique_id) { if (net_log().IsLoggingAllEvents()) { net_log().AddEvent( NetLog::TYPE_SPDY_SESSION_PING, - make_scoped_refptr(new NetLogSpdyPingParameter(next_ping_id_))); + make_scoped_refptr(new NetLogSpdyPingParameter(next_ping_id_, "sent"))); } if (unique_id % 2 != 0) { next_ping_id_ += 2; |