| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 #include "content/browser/renderer_host/render_view_host_impl.h" | 92 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 93 #include "content/browser/renderer_host/render_widget_helper.h" | 93 #include "content/browser/renderer_host/render_widget_helper.h" |
| 94 #include "content/browser/renderer_host/render_widget_host_impl.h" | 94 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 95 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" | 95 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" |
| 96 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 96 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
| 97 #include "content/browser/renderer_host/websocket_dispatcher_host.h" | 97 #include "content/browser/renderer_host/websocket_dispatcher_host.h" |
| 98 #include "content/browser/resolve_proxy_msg_helper.h" | 98 #include "content/browser/resolve_proxy_msg_helper.h" |
| 99 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 99 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 100 #include "content/browser/service_worker/service_worker_dispatcher_host.h" | 100 #include "content/browser/service_worker/service_worker_dispatcher_host.h" |
| 101 #include "content/browser/shared_worker/shared_worker_message_filter.h" | 101 #include "content/browser/shared_worker/shared_worker_message_filter.h" |
| 102 #include "content/browser/shared_worker/worker_storage_partition.h" |
| 102 #include "content/browser/speech/speech_recognition_dispatcher_host.h" | 103 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
| 103 #include "content/browser/storage_partition_impl.h" | 104 #include "content/browser/storage_partition_impl.h" |
| 104 #include "content/browser/streams/stream_context.h" | 105 #include "content/browser/streams/stream_context.h" |
| 105 #include "content/browser/tracing/trace_message_filter.h" | 106 #include "content/browser/tracing/trace_message_filter.h" |
| 106 #include "content/browser/vibration/vibration_message_filter.h" | 107 #include "content/browser/vibration/vibration_message_filter.h" |
| 107 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 108 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
| 108 #include "content/browser/worker_host/worker_message_filter.h" | |
| 109 #include "content/browser/worker_host/worker_storage_partition.h" | |
| 110 #include "content/common/child_process_host_impl.h" | 109 #include "content/common/child_process_host_impl.h" |
| 111 #include "content/common/child_process_messages.h" | 110 #include "content/common/child_process_messages.h" |
| 112 #include "content/common/content_switches_internal.h" | 111 #include "content/common/content_switches_internal.h" |
| 113 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" | 112 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
| 114 #include "content/common/gpu/gpu_messages.h" | 113 #include "content/common/gpu/gpu_messages.h" |
| 115 #include "content/common/mojo/mojo_messages.h" | 114 #include "content/common/mojo/mojo_messages.h" |
| 116 #include "content/common/resource_messages.h" | 115 #include "content/common/resource_messages.h" |
| 117 #include "content/common/view_messages.h" | 116 #include "content/common/view_messages.h" |
| 118 #include "content/public/browser/browser_context.h" | 117 #include "content/public/browser/browser_context.h" |
| 119 #include "content/public/browser/content_browser_client.h" | 118 #include "content/public/browser/content_browser_client.h" |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 826 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
| 828 base::Unretained(widget_helper_.get()))); | 827 base::Unretained(widget_helper_.get()))); |
| 829 AddFilter(message_port_message_filter_); | 828 AddFilter(message_port_message_filter_); |
| 830 | 829 |
| 831 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = | 830 scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter = |
| 832 new ServiceWorkerDispatcherHost(GetID(), message_port_message_filter_); | 831 new ServiceWorkerDispatcherHost(GetID(), message_port_message_filter_); |
| 833 service_worker_filter->Init( | 832 service_worker_filter->Init( |
| 834 storage_partition_impl_->GetServiceWorkerContext()); | 833 storage_partition_impl_->GetServiceWorkerContext()); |
| 835 AddFilter(service_worker_filter); | 834 AddFilter(service_worker_filter); |
| 836 | 835 |
| 837 // If "--enable-embedded-shared-worker" is set, we use | 836 AddFilter(new SharedWorkerMessageFilter( |
| 838 // SharedWorkerMessageFilter in stead of WorkerMessageFilter. | 837 GetID(), |
| 839 if (WorkerService::EmbeddedSharedWorkerEnabled()) { | 838 resource_context, |
| 840 AddFilter(new SharedWorkerMessageFilter( | 839 WorkerStoragePartition( |
| 841 GetID(), | 840 storage_partition_impl_->GetURLRequestContext(), |
| 842 resource_context, | 841 storage_partition_impl_->GetMediaURLRequestContext(), |
| 843 WorkerStoragePartition( | 842 storage_partition_impl_->GetAppCacheService(), |
| 844 storage_partition_impl_->GetURLRequestContext(), | 843 storage_partition_impl_->GetQuotaManager(), |
| 845 storage_partition_impl_->GetMediaURLRequestContext(), | 844 storage_partition_impl_->GetFileSystemContext(), |
| 846 storage_partition_impl_->GetAppCacheService(), | 845 storage_partition_impl_->GetDatabaseTracker(), |
| 847 storage_partition_impl_->GetQuotaManager(), | 846 storage_partition_impl_->GetIndexedDBContext(), |
| 848 storage_partition_impl_->GetFileSystemContext(), | 847 storage_partition_impl_->GetServiceWorkerContext()), |
| 849 storage_partition_impl_->GetDatabaseTracker(), | 848 message_port_message_filter_)); |
| 850 storage_partition_impl_->GetIndexedDBContext(), | |
| 851 storage_partition_impl_->GetServiceWorkerContext()), | |
| 852 message_port_message_filter_)); | |
| 853 } else { | |
| 854 AddFilter(new WorkerMessageFilter( | |
| 855 GetID(), | |
| 856 resource_context, | |
| 857 WorkerStoragePartition( | |
| 858 storage_partition_impl_->GetURLRequestContext(), | |
| 859 storage_partition_impl_->GetMediaURLRequestContext(), | |
| 860 storage_partition_impl_->GetAppCacheService(), | |
| 861 storage_partition_impl_->GetQuotaManager(), | |
| 862 storage_partition_impl_->GetFileSystemContext(), | |
| 863 storage_partition_impl_->GetDatabaseTracker(), | |
| 864 storage_partition_impl_->GetIndexedDBContext(), | |
| 865 storage_partition_impl_->GetServiceWorkerContext()), | |
| 866 message_port_message_filter_)); | |
| 867 } | |
| 868 | 849 |
| 869 #if defined(ENABLE_WEBRTC) | 850 #if defined(ENABLE_WEBRTC) |
| 870 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( | 851 p2p_socket_dispatcher_host_ = new P2PSocketDispatcherHost( |
| 871 resource_context, | 852 resource_context, |
| 872 browser_context->GetRequestContextForRenderProcess(GetID())); | 853 browser_context->GetRequestContextForRenderProcess(GetID())); |
| 873 AddFilter(p2p_socket_dispatcher_host_); | 854 AddFilter(p2p_socket_dispatcher_host_); |
| 874 #endif | 855 #endif |
| 875 | 856 |
| 876 AddFilter(new TraceMessageFilter()); | 857 AddFilter(new TraceMessageFilter()); |
| 877 AddFilter(new ResolveProxyMsgHelper( | 858 AddFilter(new ResolveProxyMsgHelper( |
| (...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2344 } | 2325 } |
| 2345 | 2326 |
| 2346 void RenderProcessHostImpl::OnDeletedGpuMemoryBuffer( | 2327 void RenderProcessHostImpl::OnDeletedGpuMemoryBuffer( |
| 2347 gfx::GpuMemoryBufferType type, | 2328 gfx::GpuMemoryBufferType type, |
| 2348 const gfx::GpuMemoryBufferId& id) { | 2329 const gfx::GpuMemoryBufferId& id) { |
| 2349 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 2330 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 2350 GpuMemoryBufferImpl::DeletedByChildProcess(type, id, GetHandle()); | 2331 GpuMemoryBufferImpl::DeletedByChildProcess(type, id, GetHandle()); |
| 2351 } | 2332 } |
| 2352 | 2333 |
| 2353 } // namespace content | 2334 } // namespace content |
| OLD | NEW |