Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: net/udp/udp_socket_win.cc

Issue 726673002: Add a new NetworkActivityMonitor to track network activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/udp/udp_socket_win.cc
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc
index 4c307fd3b2804f4cec8fcf370aafc875050150a3..207edd2cbfeac68477261afeb9c1feac1a70c9ec 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()->IncrementBytesWritten(result);
}
int UDPSocketWin::InternalRecvFrom(IOBuffer* buf, int buf_len,
« net/base/network_activity_monitor_unittest.cc ('K') | « net/udp/udp_socket_libevent.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698