Index: content/browser/renderer_host/render_process_host_impl.cc |
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
index 4cf4cdc0a6b6e63c5a496f0b834bd5176bcc5668..5febbcb2615532c36cfdf1e105f7b24e48e124e6 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.cc |
+++ b/content/browser/renderer_host/render_process_host_impl.cc |
@@ -808,9 +808,11 @@ void RenderProcessHostImpl::CreateMessageFilters() { |
} |
#if defined(ENABLE_WEBRTC) |
- AddFilter(new P2PSocketDispatcherHost( |
+ p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( |
resource_context, |
- browser_context->GetRequestContextForRenderProcess(GetID()))); |
+ browser_context->GetRequestContextForRenderProcess(GetID()), |
+ GetID()); |
+ AddFilter(p2p_socket_dispatcher_host_); |
#endif |
AddFilter(new TraceMessageFilter()); |
@@ -1513,6 +1515,34 @@ void RenderProcessHostImpl::SetWebRtcLogMessageCallback( |
base::Callback<void(const std::string&)> callback) { |
webrtc_log_message_callback_ = callback; |
} |
+ |
+void RenderProcessHostImpl::SetWebRtcRtpPacketCallback( |
+ const WebRtcRtpPacketCallback& callback) { |
+ webrtc_rtp_packet_callback_ = callback; |
+} |
+ |
+void RenderProcessHostImpl::StartRtpDump(bool incoming, bool outgoing) { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ |
+ BrowserThread::PostTask(BrowserThread::IO, |
+ FROM_HERE, |
+ base::Bind(&P2PSocketDispatcherHost::StartRtpDump, |
+ p2p_socket_dispatcher_host_, |
+ incoming, |
+ outgoing)); |
+} |
+ |
+void RenderProcessHostImpl::StopRtpDump(bool incoming, bool outgoing) { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ |
+ BrowserThread::PostTask(BrowserThread::IO, |
+ FROM_HERE, |
+ base::Bind(&P2PSocketDispatcherHost::StopRtpDump, |
+ p2p_socket_dispatcher_host_, |
+ incoming, |
+ outgoing)); |
+} |
+ |
#endif |
IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() { |
@@ -1900,6 +1930,16 @@ void RenderProcessHostImpl::WebRtcLogMessage(const std::string& message) { |
if (!webrtc_log_message_callback_.is_null()) |
webrtc_log_message_callback_.Run(message); |
} |
+ |
+void RenderProcessHostImpl::OnRtpPacket(const uint8* packet_header, |
+ size_t header_length, |
+ size_t packet_length, |
+ bool incoming) { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ if (!webrtc_rtp_packet_callback_.is_null()) |
+ webrtc_rtp_packet_callback_.Run( |
+ packet_header, header_length, packet_length, incoming); |
+} |
#endif |
scoped_refptr<ScreenOrientationDispatcherHost> |