| 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 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( | 810 AddFilter(new P2PSocketDispatcherHost( |
| 811 resource_context, | 811 resource_context, |
| 812 browser_context->GetRequestContextForRenderProcess(GetID())); | 812 browser_context->GetRequestContextForRenderProcess(GetID()))); |
| 813 AddFilter(p2p_socket_dispatcher_host_); | |
| 814 #endif | 813 #endif |
| 815 | 814 |
| 816 AddFilter(new TraceMessageFilter()); | 815 AddFilter(new TraceMessageFilter()); |
| 817 AddFilter(new ResolveProxyMsgHelper( | 816 AddFilter(new ResolveProxyMsgHelper( |
| 818 browser_context->GetRequestContextForRenderProcess(GetID()))); | 817 browser_context->GetRequestContextForRenderProcess(GetID()))); |
| 819 AddFilter(new QuotaDispatcherHost( | 818 AddFilter(new QuotaDispatcherHost( |
| 820 GetID(), | 819 GetID(), |
| 821 storage_partition_impl_->GetQuotaManager(), | 820 storage_partition_impl_->GetQuotaManager(), |
| 822 GetContentClient()->browser()->CreateQuotaPermissionContext())); | 821 GetContentClient()->browser()->CreateQuotaPermissionContext())); |
| 823 AddFilter(new GamepadBrowserMessageFilter()); | 822 AddFilter(new GamepadBrowserMessageFilter()); |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1502 BrowserThread::FILE, FROM_HERE, | 1501 BrowserThread::FILE, FROM_HERE, |
| 1503 base::Bind(&DisableAecDumpOnFileThread), | 1502 base::Bind(&DisableAecDumpOnFileThread), |
| 1504 base::Bind(&RenderProcessHostImpl::SendDisableAecDumpToRenderer, | 1503 base::Bind(&RenderProcessHostImpl::SendDisableAecDumpToRenderer, |
| 1505 weak_factory_.GetWeakPtr())); | 1504 weak_factory_.GetWeakPtr())); |
| 1506 } | 1505 } |
| 1507 | 1506 |
| 1508 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( | 1507 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( |
| 1509 base::Callback<void(const std::string&)> callback) { | 1508 base::Callback<void(const std::string&)> callback) { |
| 1510 webrtc_log_message_callback_ = callback; | 1509 webrtc_log_message_callback_ = callback; |
| 1511 } | 1510 } |
| 1512 | |
| 1513 RenderProcessHostImpl::WebRtcStopRtpDumpCallback | |
| 1514 RenderProcessHostImpl::StartRtpDump( | |
| 1515 bool incoming, | |
| 1516 bool outgoing, | |
| 1517 const WebRtcRtpPacketCallback& packet_callback) { | |
| 1518 if (!p2p_socket_dispatcher_host_) | |
| 1519 return WebRtcStopRtpDumpCallback(); | |
| 1520 | |
| 1521 BrowserThread::PostTask(BrowserThread::IO, | |
| 1522 FROM_HERE, | |
| 1523 base::Bind(&P2PSocketDispatcherHost::StartRtpDump, | |
| 1524 p2p_socket_dispatcher_host_, | |
| 1525 incoming, | |
| 1526 outgoing, | |
| 1527 packet_callback)); | |
| 1528 | |
| 1529 if (stop_rtp_dump_callback_.is_null()) { | |
| 1530 stop_rtp_dump_callback_ = | |
| 1531 base::Bind(&P2PSocketDispatcherHost::StopRtpDumpOnUIThread, | |
| 1532 p2p_socket_dispatcher_host_); | |
| 1533 } | |
| 1534 return stop_rtp_dump_callback_; | |
| 1535 } | |
| 1536 #endif | 1511 #endif |
| 1537 | 1512 |
| 1538 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() { | 1513 IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() { |
| 1539 return channel_.get(); | 1514 return channel_.get(); |
| 1540 } | 1515 } |
| 1541 | 1516 |
| 1542 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) { | 1517 void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) { |
| 1543 channel_->AddFilter(filter->GetFilter()); | 1518 channel_->AddFilter(filter->GetFilter()); |
| 1544 } | 1519 } |
| 1545 | 1520 |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 const base::StringPiece& service_name, | 2071 const base::StringPiece& service_name, |
| 2097 mojo::ScopedMessagePipeHandle handle) { | 2072 mojo::ScopedMessagePipeHandle handle) { |
| 2098 mojo_activation_required_ = true; | 2073 mojo_activation_required_ = true; |
| 2099 MaybeActivateMojo(); | 2074 MaybeActivateMojo(); |
| 2100 | 2075 |
| 2101 mojo_application_host_->service_provider()->ConnectToService( | 2076 mojo_application_host_->service_provider()->ConnectToService( |
| 2102 mojo::String::From(service_name), handle.Pass()); | 2077 mojo::String::From(service_name), handle.Pass()); |
| 2103 } | 2078 } |
| 2104 | 2079 |
| 2105 } // namespace content | 2080 } // namespace content |
| OLD | NEW |