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..ee01ca5ed4c3c8e5a30fa3113f61fab45ddff654 100644 |
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc |
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc |
@@ -75,6 +75,7 @@ P2PSocketHostUdp::P2PSocketHostUdp(IPC::Sender* message_sender, |
send_pending_(false), |
last_dscp_(net::DSCP_CS0), |
throttler_(throttler) { |
+ protocol_type_ = P2PSocketHost::UDP; |
} |
P2PSocketHostUdp::~P2PSocketHostUdp() { |
@@ -211,8 +212,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 +286,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); |
} |
} |