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

Unified Diff: content/browser/renderer_host/p2p/socket_host_udp.cc

Issue 677473002: Implement UMA and internal data structure for tracking EWOULDBLOCK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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: content/browser/renderer_host/p2p/socket_host_udp.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_udp.cc b/content/browser/renderer_host/p2p/socket_host_udp.cc
index 3833b62d03b1b19536896498f75e7ff90ba60f40..3bea4dfb2d71d23bb8fd66a3e707aff3b8ea6953 100644
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
@@ -68,7 +68,7 @@ P2PSocketHostUdp::PendingPacket::~PendingPacket() {
P2PSocketHostUdp::P2PSocketHostUdp(IPC::Sender* message_sender,
int socket_id,
P2PMessageThrottler* throttler)
- : P2PSocketHost(message_sender, socket_id),
+ : P2PSocketHost(message_sender, socket_id, P2PSocketHost::UDP),
socket_(
new net::UDPServerSocket(GetContentClient()->browser()->GetNetLog(),
net::NetLog::Source())),
@@ -211,8 +211,12 @@ void P2PSocketHostUdp::Send(const net::IPEndPoint& to,
}
}
+ IncrementTotalSentPackets();
+
if (send_pending_) {
send_queue_.push_back(PendingPacket(to, data, options, packet_id));
+ IncrementDelayedBytes(data.size());
+ IncrementDelayedPackets();
} else {
// TODO(mallinath: Remove unnecessary memcpy in this case.
PendingPacket packet(to, data, options, packet_id);
@@ -281,8 +285,10 @@ void P2PSocketHostUdp::OnSend(uint64 packet_id, int result) {
// Send next packets if we have them waiting in the buffer.
while (state_ == STATE_OPEN && !send_queue_.empty() && !send_pending_) {
- DoSend(send_queue_.front());
+ PendingPacket packet = send_queue_.front();
+ DoSend(packet);
send_queue_.pop_front();
+ DecrementDelayedBytes(packet.size);
}
}
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp_server.cc ('k') | content/renderer/p2p/ipc_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698