OLD | NEW |
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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 storage_partition_impl_->GetAppCacheService(), | 800 storage_partition_impl_->GetAppCacheService(), |
801 storage_partition_impl_->GetQuotaManager(), | 801 storage_partition_impl_->GetQuotaManager(), |
802 storage_partition_impl_->GetFileSystemContext(), | 802 storage_partition_impl_->GetFileSystemContext(), |
803 storage_partition_impl_->GetDatabaseTracker(), | 803 storage_partition_impl_->GetDatabaseTracker(), |
804 storage_partition_impl_->GetIndexedDBContext(), | 804 storage_partition_impl_->GetIndexedDBContext(), |
805 storage_partition_impl_->GetServiceWorkerContext()), | 805 storage_partition_impl_->GetServiceWorkerContext()), |
806 message_port_message_filter_)); | 806 message_port_message_filter_)); |
807 } | 807 } |
808 | 808 |
809 #if defined(ENABLE_WEBRTC) | 809 #if defined(ENABLE_WEBRTC) |
810 AddFilter(new P2PSocketDispatcherHost( | 810 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( |
811 resource_context, | 811 resource_context, |
812 browser_context->GetRequestContextForRenderProcess(GetID()))); | 812 browser_context->GetRequestContextForRenderProcess(GetID()), |
| 813 GetID()); |
| 814 AddFilter(p2p_socket_dispatcher_host_); |
813 #endif | 815 #endif |
814 | 816 |
815 AddFilter(new TraceMessageFilter()); | 817 AddFilter(new TraceMessageFilter()); |
816 AddFilter(new ResolveProxyMsgHelper( | 818 AddFilter(new ResolveProxyMsgHelper( |
817 browser_context->GetRequestContextForRenderProcess(GetID()))); | 819 browser_context->GetRequestContextForRenderProcess(GetID()))); |
818 AddFilter(new QuotaDispatcherHost( | 820 AddFilter(new QuotaDispatcherHost( |
819 GetID(), | 821 GetID(), |
820 storage_partition_impl_->GetQuotaManager(), | 822 storage_partition_impl_->GetQuotaManager(), |
821 GetContentClient()->browser()->CreateQuotaPermissionContext())); | 823 GetContentClient()->browser()->CreateQuotaPermissionContext())); |
822 AddFilter(new GamepadBrowserMessageFilter()); | 824 AddFilter(new GamepadBrowserMessageFilter()); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 BrowserThread::FILE, FROM_HERE, | 1506 BrowserThread::FILE, FROM_HERE, |
1505 base::Bind(&DisableAecDumpOnFileThread), | 1507 base::Bind(&DisableAecDumpOnFileThread), |
1506 base::Bind(&RenderProcessHostImpl::SendDisableAecDumpToRenderer, | 1508 base::Bind(&RenderProcessHostImpl::SendDisableAecDumpToRenderer, |
1507 weak_factory_.GetWeakPtr())); | 1509 weak_factory_.GetWeakPtr())); |
1508 } | 1510 } |
1509 | 1511 |
1510 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( | 1512 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( |
1511 base::Callback<void(const std::string&)> callback) { | 1513 base::Callback<void(const std::string&)> callback) { |
1512 webrtc_log_message_callback_ = callback; | 1514 webrtc_log_message_callback_ = callback; |
1513 } | 1515 } |
| 1516 |
| 1517 void RenderProcessHostImpl::SetWebRtcRtpPacketCallback( |
| 1518 const WebRtcRtpPacketCallback& callback) { |
| 1519 webrtc_rtp_packet_callback_ = callback; |
| 1520 } |
| 1521 |
| 1522 void RenderProcessHostImpl::StartRtpDump(bool incoming, bool outgoing) { |
| 1523 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1524 |
| 1525 BrowserThread::PostTask(BrowserThread::IO, |
| 1526 FROM_HERE, |
| 1527 base::Bind(&P2PSocketDispatcherHost::StartRtpDump, |
| 1528 p2p_socket_dispatcher_host_, |
| 1529 incoming, |
| 1530 outgoing)); |
| 1531 } |
| 1532 |
| 1533 void RenderProcessHostImpl::StopRtpDump(bool incoming, bool outgoing) { |
| 1534 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1535 |
| 1536 BrowserThread::PostTask(BrowserThread::IO, |
| 1537 FROM_HERE, |
| 1538 base::Bind(&P2PSocketDispatcherHost::StopRtpDump, |
| 1539 p2p_socket_dispatcher_host_, |
| 1540 incoming, |
| 1541 outgoing)); |
| 1542 } |
| 1543 |
1514 #endif | 1544 #endif |
1515 | 1545 |
1516 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() { | 1546 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() { |
1517 return channel_.get(); | 1547 return channel_.get(); |
1518 } | 1548 } |
1519 | 1549 |
1520 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) { | 1550 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) { |
1521 channel_->AddFilter(filter->GetFilter()); | 1551 channel_->AddFilter(filter->GetFilter()); |
1522 } | 1552 } |
1523 | 1553 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 gpu_message_filter_, | 1922 gpu_message_filter_, |
1893 route_id)); | 1923 route_id)); |
1894 } | 1924 } |
1895 | 1925 |
1896 #if defined(ENABLE_WEBRTC) | 1926 #if defined(ENABLE_WEBRTC) |
1897 void RenderProcessHostImpl::WebRtcLogMessage(const std::string& message) { | 1927 void RenderProcessHostImpl::WebRtcLogMessage(const std::string& message) { |
1898 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1928 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1899 if (!webrtc_log_message_callback_.is_null()) | 1929 if (!webrtc_log_message_callback_.is_null()) |
1900 webrtc_log_message_callback_.Run(message); | 1930 webrtc_log_message_callback_.Run(message); |
1901 } | 1931 } |
| 1932 |
| 1933 void RenderProcessHostImpl::OnRtpPacket(const uint8* packet_header, |
| 1934 size_t header_length, |
| 1935 size_t packet_length, |
| 1936 bool incoming) { |
| 1937 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1938 if (!webrtc_rtp_packet_callback_.is_null()) |
| 1939 webrtc_rtp_packet_callback_.Run( |
| 1940 packet_header, header_length, packet_length, incoming); |
| 1941 } |
1902 #endif | 1942 #endif |
1903 | 1943 |
1904 scoped_refptr<ScreenOrientationDispatcherHost> | 1944 scoped_refptr<ScreenOrientationDispatcherHost> |
1905 RenderProcessHostImpl::screen_orientation_dispatcher_host() const { | 1945 RenderProcessHostImpl::screen_orientation_dispatcher_host() const { |
1906 return make_scoped_refptr(screen_orientation_dispatcher_host_); | 1946 return make_scoped_refptr(screen_orientation_dispatcher_host_); |
1907 } | 1947 } |
1908 | 1948 |
1909 void RenderProcessHostImpl::OnShutdownRequest() { | 1949 void RenderProcessHostImpl::OnShutdownRequest() { |
1910 // Don't shut down if there are active RenderViews, or if there are pending | 1950 // Don't shut down if there are active RenderViews, or if there are pending |
1911 // RenderViews being swapped back in. | 1951 // RenderViews being swapped back in. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 mojo::ScopedMessagePipeHandle handle) { | 2115 mojo::ScopedMessagePipeHandle handle) { |
2076 mojo_activation_required_ = true; | 2116 mojo_activation_required_ = true; |
2077 MaybeActivateMojo(); | 2117 MaybeActivateMojo(); |
2078 | 2118 |
2079 mojo::AllocationScope scope; | 2119 mojo::AllocationScope scope; |
2080 mojo_application_host_->shell_client()->AcceptConnection(service_name, | 2120 mojo_application_host_->shell_client()->AcceptConnection(service_name, |
2081 handle.Pass()); | 2121 handle.Pass()); |
2082 } | 2122 } |
2083 | 2123 |
2084 } // namespace content | 2124 } // namespace content |
OLD | NEW |