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

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 264793017: Implements RTP header dumping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "content/browser/renderer_host/render_process_host_impl.h" 8 #include "content/browser/renderer_host/render_process_host_impl.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 storage_partition_impl_->GetAppCacheService(), 801 storage_partition_impl_->GetAppCacheService(),
802 storage_partition_impl_->GetQuotaManager(), 802 storage_partition_impl_->GetQuotaManager(),
803 storage_partition_impl_->GetFileSystemContext(), 803 storage_partition_impl_->GetFileSystemContext(),
804 storage_partition_impl_->GetDatabaseTracker(), 804 storage_partition_impl_->GetDatabaseTracker(),
805 storage_partition_impl_->GetIndexedDBContext(), 805 storage_partition_impl_->GetIndexedDBContext(),
806 storage_partition_impl_->GetServiceWorkerContext()), 806 storage_partition_impl_->GetServiceWorkerContext()),
807 message_port_message_filter_)); 807 message_port_message_filter_));
808 } 808 }
809 809
810 #if defined(ENABLE_WEBRTC) 810 #if defined(ENABLE_WEBRTC)
811 AddFilter(new P2PSocketDispatcherHost( 811 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost(
812 resource_context, 812 resource_context,
813 browser_context->GetRequestContextForRenderProcess(GetID()))); 813 browser_context->GetRequestContextForRenderProcess(GetID()),
814 GetID());
815 AddFilter(p2p_socket_dispatcher_host_);
814 #endif 816 #endif
815 817
816 AddFilter(new TraceMessageFilter()); 818 AddFilter(new TraceMessageFilter());
817 AddFilter(new ResolveProxyMsgHelper( 819 AddFilter(new ResolveProxyMsgHelper(
818 browser_context->GetRequestContextForRenderProcess(GetID()))); 820 browser_context->GetRequestContextForRenderProcess(GetID())));
819 AddFilter(new QuotaDispatcherHost( 821 AddFilter(new QuotaDispatcherHost(
820 GetID(), 822 GetID(),
821 storage_partition_impl_->GetQuotaManager(), 823 storage_partition_impl_->GetQuotaManager(),
822 GetContentClient()->browser()->CreateQuotaPermissionContext())); 824 GetContentClient()->browser()->CreateQuotaPermissionContext()));
823 AddFilter(new GamepadBrowserMessageFilter()); 825 AddFilter(new GamepadBrowserMessageFilter());
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 BrowserThread::FILE, FROM_HERE, 1508 BrowserThread::FILE, FROM_HERE,
1507 base::Bind(&DisableAecDumpOnFileThread), 1509 base::Bind(&DisableAecDumpOnFileThread),
1508 base::Bind(&RenderProcessHostImpl::SendDisableAecDumpToRenderer, 1510 base::Bind(&RenderProcessHostImpl::SendDisableAecDumpToRenderer,
1509 weak_factory_.GetWeakPtr())); 1511 weak_factory_.GetWeakPtr()));
1510 } 1512 }
1511 1513
1512 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( 1514 void RenderProcessHostImpl::SetWebRtcLogMessageCallback(
1513 base::Callback<void(const std::string&)> callback) { 1515 base::Callback<void(const std::string&)> callback) {
1514 webrtc_log_message_callback_ = callback; 1516 webrtc_log_message_callback_ = callback;
1515 } 1517 }
1518
1519 void RenderProcessHostImpl::SetWebRtcRtpPacketCallback(
1520 const WebRtcRtpPacketCallback& callback) {
1521 webrtc_rtp_packet_callback_ = callback;
1522 }
1523
1524 void RenderProcessHostImpl::StartRtpDump(bool incoming, bool outgoing) {
1525 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1526
1527 BrowserThread::PostTask(BrowserThread::IO,
1528 FROM_HERE,
1529 base::Bind(&P2PSocketDispatcherHost::StartRtpDump,
1530 p2p_socket_dispatcher_host_,
1531 incoming,
1532 outgoing));
1533 }
1534
1535 void RenderProcessHostImpl::StopRtpDump(bool incoming, bool outgoing) {
1536 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1537
1538 BrowserThread::PostTask(BrowserThread::IO,
1539 FROM_HERE,
1540 base::Bind(&P2PSocketDispatcherHost::StopRtpDump,
1541 p2p_socket_dispatcher_host_,
1542 incoming,
1543 outgoing));
1544 }
1545
1516 #endif 1546 #endif
1517 1547
1518 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() { 1548 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() {
1519 return channel_.get(); 1549 return channel_.get();
1520 } 1550 }
1521 1551
1522 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) { 1552 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) {
1523 channel_->AddFilter(filter->GetFilter()); 1553 channel_->AddFilter(filter->GetFilter());
1524 } 1554 }
1525 1555
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 gpu_message_filter_, 1923 gpu_message_filter_,
1894 route_id)); 1924 route_id));
1895 } 1925 }
1896 1926
1897 #if defined(ENABLE_WEBRTC) 1927 #if defined(ENABLE_WEBRTC)
1898 void RenderProcessHostImpl::WebRtcLogMessage(const std::string& message) { 1928 void RenderProcessHostImpl::WebRtcLogMessage(const std::string& message) {
1899 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1929 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1900 if (!webrtc_log_message_callback_.is_null()) 1930 if (!webrtc_log_message_callback_.is_null())
1901 webrtc_log_message_callback_.Run(message); 1931 webrtc_log_message_callback_.Run(message);
1902 } 1932 }
1933
1934 void RenderProcessHostImpl::OnRtpPacket(const uint8* packet_header,
1935 size_t header_length,
1936 size_t packet_length,
1937 bool incoming) {
1938 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1939 if (!webrtc_rtp_packet_callback_.is_null())
1940 webrtc_rtp_packet_callback_.Run(
1941 packet_header, header_length, packet_length, incoming);
1942 }
1903 #endif 1943 #endif
1904 1944
1905 scoped_refptr<ScreenOrientationDispatcherHost> 1945 scoped_refptr<ScreenOrientationDispatcherHost>
1906 RenderProcessHostImpl::screen_orientation_dispatcher_host() const { 1946 RenderProcessHostImpl::screen_orientation_dispatcher_host() const {
1907 return make_scoped_refptr(screen_orientation_dispatcher_host_); 1947 return make_scoped_refptr(screen_orientation_dispatcher_host_);
1908 } 1948 }
1909 1949
1910 void RenderProcessHostImpl::OnShutdownRequest() { 1950 void RenderProcessHostImpl::OnShutdownRequest() {
1911 // Don't shut down if there are active RenderViews, or if there are pending 1951 // Don't shut down if there are active RenderViews, or if there are pending
1912 // RenderViews being swapped back in. 1952 // RenderViews being swapped back in.
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2076 mojo::ScopedMessagePipeHandle handle) { 2116 mojo::ScopedMessagePipeHandle handle) {
2077 mojo_activation_required_ = true; 2117 mojo_activation_required_ = true;
2078 MaybeActivateMojo(); 2118 MaybeActivateMojo();
2079 2119
2080 mojo::AllocationScope scope; 2120 mojo::AllocationScope scope;
2081 mojo_application_host_->shell_client()->AcceptConnection(service_name, 2121 mojo_application_host_->shell_client()->AcceptConnection(service_name,
2082 handle.Pass()); 2122 handle.Pass());
2083 } 2123 }
2084 2124
2085 } // namespace content 2125 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698