diff options
author | rch <rch@chromium.org> | 2014-11-14 15:57:36 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-14 23:57:59 +0000 |
commit | 29ae89d5019ec937b66613083deb9a87900b39fc (patch) | |
tree | 007e84a8a0eff4f05402924632ca5cad23350742 /net/udp/udp_socket_win.cc | |
parent | d459d629d48f57d066268bcd3f60553b6423041a (diff) | |
download | chromium_src-29ae89d5019ec937b66613083deb9a87900b39fc.zip chromium_src-29ae89d5019ec937b66613083deb9a87900b39fc.tar.gz chromium_src-29ae89d5019ec937b66613083deb9a87900b39fc.tar.bz2 |
Add a new NetworkActivityMonitor to track network activity across all
sockets and provides cumulative statistics about bytes written to and
read from the network. It uses locks to ensure thread-safety.
Review URL: https://codereview.chromium.org/726673002
Cr-Commit-Position: refs/heads/master@{#304302}
Diffstat (limited to 'net/udp/udp_socket_win.cc')
-rw-r--r-- | net/udp/udp_socket_win.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc index 4c307fd..11c731f 100644 --- a/net/udp/udp_socket_win.cc +++ b/net/udp/udp_socket_win.cc @@ -20,6 +20,7 @@ #include "net/base/net_errors.h" #include "net/base/net_log.h" #include "net/base/net_util.h" +#include "net/base/network_activity_monitor.h" #include "net/base/winsock_init.h" #include "net/base/winsock_util.h" #include "net/socket/socket_descriptor.h" @@ -595,6 +596,7 @@ void UDPSocketWin::LogRead(int result, const char* bytes) const { base::StatsCounter read_bytes("udp.read_bytes"); read_bytes.Add(result); + NetworkActivityMonitor::GetInstance()->IncrementBytesReceived(result); } void UDPSocketWin::DidCompleteWrite() { @@ -626,6 +628,7 @@ void UDPSocketWin::LogWrite(int result, base::StatsCounter write_bytes("udp.write_bytes"); write_bytes.Add(result); + NetworkActivityMonitor::GetInstance()->IncrementBytesSent(result); } int UDPSocketWin::InternalRecvFrom(IOBuffer* buf, int buf_len, |