diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-27 23:20:45 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-27 23:20:45 +0000 |
commit | d13f51bc832e8e7965e92f5aa4b16b8c10c3f913 (patch) | |
tree | d5a1a413bf8716befbae7d056cd8c6194eed5a98 /net/socket/tcp_client_socket_win.cc | |
parent | f2286c23e17c0012d53800a5ef28975b6e22393a (diff) | |
download | chromium_src-d13f51bc832e8e7965e92f5aa4b16b8c10c3f913.zip chromium_src-d13f51bc832e8e7965e92f5aa4b16b8c10c3f913.tar.gz chromium_src-d13f51bc832e8e7965e92f5aa4b16b8c10c3f913.tar.bz2 |
Cleanup: Address some of the todos in net_log.h
- Get rid of the AddString() and AddStringLiteral() methods.
- Make EventParameters able to serialize to JSON, instead of a string.
BUG=37421
Review URL: http://codereview.chromium.org/1716007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/tcp_client_socket_win.cc')
-rw-r--r-- | net/socket/tcp_client_socket_win.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc index 24c3eca..95ec3a9 100644 --- a/net/socket/tcp_client_socket_win.cc +++ b/net/socket/tcp_client_socket_win.cc @@ -477,7 +477,8 @@ int TCPClientSocketWin::Read(IOBuffer* buf, base::MemoryDebug::MarkAsInitialized(core_->read_buffer_.buf, num); static StatsCounter read_bytes("tcp.read_bytes"); read_bytes.Add(num); - net_log_.AddEventWithInteger(NetLog::TYPE_SOCKET_BYTES_RECEIVED, num); + net_log_.AddEventWithInteger(NetLog::TYPE_SOCKET_BYTES_RECEIVED, + "num_bytes", num); return static_cast<int>(num); } } else { @@ -528,7 +529,8 @@ int TCPClientSocketWin::Write(IOBuffer* buf, TRACE_EVENT_END("socket.write", this, StringPrintf("%d bytes", rv)); static StatsCounter write_bytes("tcp.write_bytes"); write_bytes.Add(rv); - net_log_.AddEventWithInteger(NetLog::TYPE_SOCKET_BYTES_SENT, rv); + net_log_.AddEventWithInteger(NetLog::TYPE_SOCKET_BYTES_SENT, + "num_bytes", rv); return rv; } } else { @@ -691,8 +693,10 @@ void TCPClientSocketWin::DidCompleteRead() { TRACE_EVENT_END("socket.read", this, StringPrintf("%d bytes", num_bytes)); waiting_read_ = false; core_->read_iobuffer_ = NULL; - if (ok) - net_log_.AddEventWithInteger(NetLog::TYPE_SOCKET_BYTES_RECEIVED, num_bytes); + if (ok) { + net_log_.AddEventWithInteger(NetLog::TYPE_SOCKET_BYTES_RECEIVED, + "num_bytes", num_bytes); + } DoReadCallback(ok ? num_bytes : MapWinsockError(WSAGetLastError())); } @@ -718,7 +722,8 @@ void TCPClientSocketWin::DidCompleteWrite() { << " bytes reported."; rv = ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES; } else { - net_log_.AddEventWithInteger(NetLog::TYPE_SOCKET_BYTES_SENT, rv); + net_log_.AddEventWithInteger(NetLog::TYPE_SOCKET_BYTES_SENT, + "num_bytes", rv); } } core_->write_iobuffer_ = NULL; |