| Index: content/browser/renderer_host/p2p/socket_dispatcher_host.cc | 
| diff --git a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc | 
| index be63c0217bb4cd277713dac1d04d688d5404be26..44023ef8a63e6e4fa7e0a9d15e859293eec91fd3 100644 | 
| --- a/content/browser/renderer_host/p2p/socket_dispatcher_host.cc | 
| +++ b/content/browser/renderer_host/p2p/socket_dispatcher_host.cc | 
| @@ -99,7 +99,9 @@ P2PSocketDispatcherHost::P2PSocketDispatcherHost( | 
| : BrowserMessageFilter(P2PMsgStart), | 
| resource_context_(resource_context), | 
| url_context_(url_context), | 
| -      monitoring_networks_(false) { | 
| +      monitoring_networks_(false), | 
| +      dump_incoming_rtp_packet_(false), | 
| +      dump_outgoing_rtp_packet_(false) { | 
| } | 
|  | 
| void P2PSocketDispatcherHost::OnChannelClosing() { | 
| @@ -147,6 +149,35 @@ void P2PSocketDispatcherHost::OnIPAddressChanged() { | 
| &P2PSocketDispatcherHost::DoGetNetworkList, this)); | 
| } | 
|  | 
| +void P2PSocketDispatcherHost::StartRtpDump( | 
| +    bool incoming, | 
| +    bool outgoing, | 
| +    const RenderProcessHost::WebRtcRtpPacketCallback& packet_callback) { | 
| +  if (dump_incoming_rtp_packet_ != incoming || | 
| +      dump_outgoing_rtp_packet_ != outgoing) { | 
| +    dump_incoming_rtp_packet_ = incoming; | 
| +    dump_outgoing_rtp_packet_ = outgoing; | 
| + | 
| +    packet_callback_ = packet_callback; | 
| +    for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) | 
| +      it->second->StartRtpDump(incoming, outgoing, packet_callback); | 
| +  } | 
| +} | 
| + | 
| +void P2PSocketDispatcherHost::StopRtpDump(bool incoming, bool outgoing) { | 
| +  if (dump_incoming_rtp_packet_ == incoming || | 
| +      dump_outgoing_rtp_packet_ == outgoing) { | 
| +    dump_incoming_rtp_packet_ = !incoming; | 
| +    dump_outgoing_rtp_packet_ = !outgoing; | 
| + | 
| +    if (!dump_incoming_rtp_packet_ && !dump_outgoing_rtp_packet_) | 
| +      packet_callback_.Reset(); | 
| + | 
| +    for (SocketsMap::iterator it = sockets_.begin(); it != sockets_.end(); ++it) | 
| +      it->second->StopRtpDump(incoming, outgoing); | 
| +  } | 
| +} | 
| + | 
| P2PSocketDispatcherHost::~P2PSocketDispatcherHost() { | 
| DCHECK(sockets_.empty()); | 
| DCHECK(dns_requests_.empty()); | 
| @@ -210,6 +241,12 @@ void P2PSocketDispatcherHost::OnCreateSocket( | 
|  | 
| if (socket->Init(local_address, remote_address)) { | 
| sockets_[socket_id] = socket.release(); | 
| + | 
| +    if (dump_incoming_rtp_packet_ || dump_outgoing_rtp_packet_) { | 
| +      sockets_[socket_id]->StartRtpDump(dump_incoming_rtp_packet_, | 
| +                                        dump_outgoing_rtp_packet_, | 
| +                                        packet_callback_); | 
| +    } | 
| } | 
| } | 
|  | 
|  |