| 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 BrowserMainLoop::GetInstance()->audio_mirroring_manager(), | 758 BrowserMainLoop::GetInstance()->audio_mirroring_manager(), |
| 759 BrowserMainLoop::GetInstance()->user_input_monitor())); | 759 BrowserMainLoop::GetInstance()->user_input_monitor())); |
| 760 // The AudioRendererHost needs to be available for lookup, so it's | 760 // The AudioRendererHost needs to be available for lookup, so it's |
| 761 // stashed in a member variable. | 761 // stashed in a member variable. |
| 762 audio_renderer_host_ = new AudioRendererHost( | 762 audio_renderer_host_ = new AudioRendererHost( |
| 763 GetID(), | 763 GetID(), |
| 764 audio_manager, | 764 audio_manager, |
| 765 BrowserMainLoop::GetInstance()->audio_mirroring_manager(), | 765 BrowserMainLoop::GetInstance()->audio_mirroring_manager(), |
| 766 media_internals, | 766 media_internals, |
| 767 media_stream_manager); | 767 media_stream_manager); |
| 768 AddFilter(audio_renderer_host_); | 768 AddFilter(audio_renderer_host_.get()); |
| 769 AddFilter( | 769 AddFilter( |
| 770 new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_manager())); | 770 new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_manager())); |
| 771 AddFilter(new VideoCaptureHost(media_stream_manager)); | 771 AddFilter(new VideoCaptureHost(media_stream_manager)); |
| 772 AddFilter(new AppCacheDispatcherHost( | 772 AddFilter(new AppCacheDispatcherHost( |
| 773 storage_partition_impl_->GetAppCacheService(), | 773 storage_partition_impl_->GetAppCacheService(), |
| 774 GetID())); | 774 GetID())); |
| 775 AddFilter(new ClipboardMessageFilter); | 775 AddFilter(new ClipboardMessageFilter); |
| 776 AddFilter(new DOMStorageMessageFilter( | 776 AddFilter(new DOMStorageMessageFilter( |
| 777 GetID(), | 777 GetID(), |
| 778 storage_partition_impl_->GetDOMStorageContext())); | 778 storage_partition_impl_->GetDOMStorageContext())); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 websocket_request_context_callback( | 840 websocket_request_context_callback( |
| 841 base::Bind(&GetRequestContext, request_context, | 841 base::Bind(&GetRequestContext, request_context, |
| 842 media_request_context, RESOURCE_TYPE_SUB_RESOURCE)); | 842 media_request_context, RESOURCE_TYPE_SUB_RESOURCE)); |
| 843 | 843 |
| 844 AddFilter( | 844 AddFilter( |
| 845 new WebSocketDispatcherHost(GetID(), websocket_request_context_callback)); | 845 new WebSocketDispatcherHost(GetID(), websocket_request_context_callback)); |
| 846 | 846 |
| 847 message_port_message_filter_ = new MessagePortMessageFilter( | 847 message_port_message_filter_ = new MessagePortMessageFilter( |
| 848 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 848 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
| 849 base::Unretained(widget_helper_.get()))); | 849 base::Unretained(widget_helper_.get()))); |
| 850 AddFilter(message_port_message_filter_); | 850 AddFilter(message_port_message_filter_.get()); |
| 851 | 851 |
| 852 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = | 852 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = |
| 853 new ServiceWorkerDispatcherHost(GetID(), message_port_message_filter_); | 853 new ServiceWorkerDispatcherHost(GetID(), |
| 854 message_port_message_filter_.get()); |
| 854 service_worker_filter->Init( | 855 service_worker_filter->Init( |
| 855 storage_partition_impl_->GetServiceWorkerContext()); | 856 storage_partition_impl_->GetServiceWorkerContext()); |
| 856 AddFilter(service_worker_filter); | 857 AddFilter(service_worker_filter.get()); |
| 857 | 858 |
| 858 AddFilter(new SharedWorkerMessageFilter( | 859 AddFilter(new SharedWorkerMessageFilter( |
| 859 GetID(), | 860 GetID(), |
| 860 resource_context, | 861 resource_context, |
| 861 WorkerStoragePartition( | 862 WorkerStoragePartition( |
| 862 storage_partition_impl_->GetURLRequestContext(), | 863 storage_partition_impl_->GetURLRequestContext(), |
| 863 storage_partition_impl_->GetMediaURLRequestContext(), | 864 storage_partition_impl_->GetMediaURLRequestContext(), |
| 864 storage_partition_impl_->GetAppCacheService(), | 865 storage_partition_impl_->GetAppCacheService(), |
| 865 storage_partition_impl_->GetQuotaManager(), | 866 storage_partition_impl_->GetQuotaManager(), |
| 866 storage_partition_impl_->GetFileSystemContext(), | 867 storage_partition_impl_->GetFileSystemContext(), |
| 867 storage_partition_impl_->GetDatabaseTracker(), | 868 storage_partition_impl_->GetDatabaseTracker(), |
| 868 storage_partition_impl_->GetIndexedDBContext(), | 869 storage_partition_impl_->GetIndexedDBContext(), |
| 869 storage_partition_impl_->GetServiceWorkerContext()), | 870 storage_partition_impl_->GetServiceWorkerContext()), |
| 870 message_port_message_filter_)); | 871 message_port_message_filter_.get())); |
| 871 | 872 |
| 872 #if defined(ENABLE_WEBRTC) | 873 #if defined(ENABLE_WEBRTC) |
| 873 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( | 874 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( |
| 874 resource_context, | 875 resource_context, |
| 875 browser_context->GetRequestContextForRenderProcess(GetID())); | 876 browser_context->GetRequestContextForRenderProcess(GetID())); |
| 876 AddFilter(p2p_socket_dispatcher_host_); | 877 AddFilter(p2p_socket_dispatcher_host_.get()); |
| 877 #endif | 878 #endif |
| 878 | 879 |
| 879 AddFilter(new TraceMessageFilter()); | 880 AddFilter(new TraceMessageFilter()); |
| 880 AddFilter(new ResolveProxyMsgHelper( | 881 AddFilter(new ResolveProxyMsgHelper( |
| 881 browser_context->GetRequestContextForRenderProcess(GetID()))); | 882 browser_context->GetRequestContextForRenderProcess(GetID()))); |
| 882 AddFilter(new QuotaDispatcherHost( | 883 AddFilter(new QuotaDispatcherHost( |
| 883 GetID(), | 884 GetID(), |
| 884 storage_partition_impl_->GetQuotaManager(), | 885 storage_partition_impl_->GetQuotaManager(), |
| 885 GetContentClient()->browser()->CreateQuotaPermissionContext())); | 886 GetContentClient()->browser()->CreateQuotaPermissionContext())); |
| 886 AddFilter(new GamepadBrowserMessageFilter()); | 887 AddFilter(new GamepadBrowserMessageFilter()); |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( | 1567 void RenderProcessHostImpl::SetWebRtcLogMessageCallback( |
| 1567 base::Callback<void(const std::string&)> callback) { | 1568 base::Callback<void(const std::string&)> callback) { |
| 1568 webrtc_log_message_callback_ = callback; | 1569 webrtc_log_message_callback_ = callback; |
| 1569 } | 1570 } |
| 1570 | 1571 |
| 1571 RenderProcessHostImpl::WebRtcStopRtpDumpCallback | 1572 RenderProcessHostImpl::WebRtcStopRtpDumpCallback |
| 1572 RenderProcessHostImpl::StartRtpDump( | 1573 RenderProcessHostImpl::StartRtpDump( |
| 1573 bool incoming, | 1574 bool incoming, |
| 1574 bool outgoing, | 1575 bool outgoing, |
| 1575 const WebRtcRtpPacketCallback& packet_callback) { | 1576 const WebRtcRtpPacketCallback& packet_callback) { |
| 1576 if (!p2p_socket_dispatcher_host_) | 1577 if (!p2p_socket_dispatcher_host_.get()) |
| 1577 return WebRtcStopRtpDumpCallback(); | 1578 return WebRtcStopRtpDumpCallback(); |
| 1578 | 1579 |
| 1579 BrowserThread::PostTask(BrowserThread::IO, | 1580 BrowserThread::PostTask(BrowserThread::IO, |
| 1580 FROM_HERE, | 1581 FROM_HERE, |
| 1581 base::Bind(&P2PSocketDispatcherHost::StartRtpDump, | 1582 base::Bind(&P2PSocketDispatcherHost::StartRtpDump, |
| 1582 p2p_socket_dispatcher_host_, | 1583 p2p_socket_dispatcher_host_, |
| 1583 incoming, | 1584 incoming, |
| 1584 outgoing, | 1585 outgoing, |
| 1585 packet_callback)); | 1586 packet_callback)); |
| 1586 | 1587 |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2349 } | 2350 } |
| 2350 | 2351 |
| 2351 void RenderProcessHostImpl::OnDeletedGpuMemoryBuffer( | 2352 void RenderProcessHostImpl::OnDeletedGpuMemoryBuffer( |
| 2352 gfx::GpuMemoryBufferType type, | 2353 gfx::GpuMemoryBufferType type, |
| 2353 const gfx::GpuMemoryBufferId& id) { | 2354 const gfx::GpuMemoryBufferId& id) { |
| 2354 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2355 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 2355 GpuMemoryBufferImpl::DeletedByChildProcess(type, id, GetHandle()); | 2356 GpuMemoryBufferImpl::DeletedByChildProcess(type, id, GetHandle()); |
| 2356 } | 2357 } |
| 2357 | 2358 |
| 2358 } // namespace content | 2359 } // namespace content |
| OLD | NEW |