| 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 5137972ebb0d9edb3d6f02cfd820135a39caaff1..b08c95aed1afd129744440c228e6f4ff498fc8d1 100644
|
| --- a/content/browser/renderer_host/p2p/socket_host_udp.cc
|
| +++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
|
| @@ -295,31 +295,28 @@ void P2PSocketHostUdp::DoSend(const PendingPacket& packet) {
|
|
|
| packet_processing_helpers::ApplyPacketOptions(
|
| packet.data->data(), packet.size, packet.packet_options, 0);
|
| - int result = socket_->SendTo(packet.data.get(),
|
| - packet.size,
|
| - packet.to,
|
| - base::Bind(&P2PSocketHostUdp::OnSend,
|
| - base::Unretained(this),
|
| - packet.id,
|
| - tick_received));
|
| + int result = socket_->SendTo(
|
| + packet.data.get(), packet.size, packet.to,
|
| + base::Bind(&P2PSocketHostUdp::OnSend, base::Unretained(this), packet.id,
|
| + packet.packet_options.transport_sequence_number,
|
| + tick_received));
|
|
|
| // sendto() may return an error, e.g. if we've received an ICMP Destination
|
| // Unreachable message. When this happens try sending the same packet again,
|
| // and just drop it if it fails again.
|
| if (IsTransientError(result)) {
|
| - result = socket_->SendTo(packet.data.get(),
|
| - packet.size,
|
| - packet.to,
|
| - base::Bind(&P2PSocketHostUdp::OnSend,
|
| - base::Unretained(this),
|
| - packet.id,
|
| - tick_received));
|
| + result = socket_->SendTo(
|
| + packet.data.get(), packet.size, packet.to,
|
| + base::Bind(&P2PSocketHostUdp::OnSend, base::Unretained(this), packet.id,
|
| + packet.packet_options.transport_sequence_number,
|
| + tick_received));
|
| }
|
|
|
| if (result == net::ERR_IO_PENDING) {
|
| send_pending_ = true;
|
| } else {
|
| - HandleSendResult(packet.id, tick_received, result);
|
| + HandleSendResult(packet.id, packet.packet_options.transport_sequence_number,
|
| + tick_received, result);
|
| }
|
|
|
| if (dump_outgoing_rtp_packet_)
|
| @@ -327,6 +324,7 @@ void P2PSocketHostUdp::DoSend(const PendingPacket& packet) {
|
| }
|
|
|
| void P2PSocketHostUdp::OnSend(uint64 packet_id,
|
| + int32_t transport_sequence_number,
|
| uint64 tick_received,
|
| int result) {
|
| DCHECK(send_pending_);
|
| @@ -334,7 +332,7 @@ void P2PSocketHostUdp::OnSend(uint64 packet_id,
|
|
|
| send_pending_ = false;
|
|
|
| - HandleSendResult(packet_id, tick_received, result);
|
| + HandleSendResult(packet_id, transport_sequence_number, tick_received, result);
|
|
|
| // Send next packets if we have them waiting in the buffer.
|
| while (state_ == STATE_OPEN && !send_queue_.empty() && !send_pending_) {
|
| @@ -346,6 +344,7 @@ void P2PSocketHostUdp::OnSend(uint64 packet_id,
|
| }
|
|
|
| void P2PSocketHostUdp::HandleSendResult(uint64 packet_id,
|
| + int32_t transport_sequence_number,
|
| uint64 tick_received,
|
| int result) {
|
| TRACE_EVENT_ASYNC_END1("p2p", "Send", packet_id,
|
| @@ -363,13 +362,17 @@ void P2PSocketHostUdp::HandleSendResult(uint64 packet_id,
|
|
|
| // UMA to track the histograms from 1ms to 1 sec for how long a packet spends
|
| // in the browser process.
|
| - UMA_HISTOGRAM_TIMES(
|
| - "WebRTC.SystemSendPacketDuration_UDP" /* name */,
|
| - base::TimeTicks::Now() -
|
| - base::TimeTicks::FromInternalValue(tick_received) /* sample */);
|
| + const base::TimeTicks timeticks_received =
|
| + base::TimeTicks::FromInternalValue(tick_received);
|
| + UMA_HISTOGRAM_TIMES("WebRTC.SystemSendPacketDuration_UDP" /* name */,
|
| + base::TimeTicks::Now() - timeticks_received /* sample */);
|
|
|
| - message_sender_->Send(
|
| - new P2PMsg_OnSendComplete(id_, P2PSendPacketMetrics(packet_id)));
|
| + uint64 send_time_ms =
|
| + (timeticks_received - base::TimeTicks::UnixEpoch()).InMilliseconds();
|
| +
|
| + message_sender_->Send(new P2PMsg_OnSendComplete(
|
| + id_, P2PSendPacketMetrics(packet_id, transport_sequence_number,
|
| + send_time_ms)));
|
| }
|
|
|
| P2PSocketHost* P2PSocketHostUdp::AcceptIncomingTcpConnection(
|
|
|