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

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

Issue 264793017: Implements RTP header dumping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix leak Created 6 years, 7 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 77c817e552c9b0b617a7a609dde095f41cd0d399..5dad882629f1577fc7ac90294034cb51e295bea8 100644
--- a/content/browser/renderer_host/p2p/socket_host_udp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_udp.cc
@@ -66,12 +66,12 @@ P2PSocketHostUdp::PendingPacket::~PendingPacket() {
}
P2PSocketHostUdp::P2PSocketHostUdp(IPC::Sender* message_sender,
- int id,
+ int socket_id,
P2PMessageThrottler* throttler)
- : P2PSocketHost(message_sender, id),
- socket_(new net::UDPServerSocket(
- GetContentClient()->browser()->GetNetLog(),
- net::NetLog::Source())),
+ : P2PSocketHost(message_sender, socket_id),
+ socket_(
+ new net::UDPServerSocket(GetContentClient()->browser()->GetNetLog(),
+ net::NetLog::Source())),
send_pending_(false),
last_dscp_(net::DSCP_CS0),
throttler_(throttler) {
@@ -173,6 +173,9 @@ void P2PSocketHostUdp::HandleReadResult(int result) {
message_sender_->Send(new P2PMsg_OnDataReceived(
id_, recv_address_, data, base::TimeTicks::Now()));
+
+ if (dump_incoming_rtp_packet_)
+ DumpRtpPacket(&data[0], data.size(), true);
} else if (result < 0 && !IsTransientError(result)) {
LOG(ERROR) << "Error when reading from UDP socket: " << result;
OnError();
@@ -261,6 +264,9 @@ void P2PSocketHostUdp::DoSend(const PendingPacket& packet) {
} else {
HandleSendResult(packet.id, result);
}
+
+ if (dump_outgoing_rtp_packet_)
+ DumpRtpPacket(packet.data->data(), packet.size, false);
}
void P2PSocketHostUdp::OnSend(uint64 packet_id, int result) {
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_udp.h ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698