OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 #include "content/browser/renderer_host/media/video_capture_host.h" | 104 #include "content/browser/renderer_host/media/video_capture_host.h" |
105 #include "content/browser/renderer_host/offscreen_canvas_surface_impl.h" | 105 #include "content/browser/renderer_host/offscreen_canvas_surface_impl.h" |
106 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" | 106 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" |
107 #include "content/browser/renderer_host/pepper/pepper_renderer_connection.h" | 107 #include "content/browser/renderer_host/pepper/pepper_renderer_connection.h" |
108 #include "content/browser/renderer_host/render_message_filter.h" | 108 #include "content/browser/renderer_host/render_message_filter.h" |
109 #include "content/browser/renderer_host/render_view_host_delegate.h" | 109 #include "content/browser/renderer_host/render_view_host_delegate.h" |
110 #include "content/browser/renderer_host/render_view_host_impl.h" | 110 #include "content/browser/renderer_host/render_view_host_impl.h" |
111 #include "content/browser/renderer_host/render_widget_helper.h" | 111 #include "content/browser/renderer_host/render_widget_helper.h" |
112 #include "content/browser/renderer_host/render_widget_host_impl.h" | 112 #include "content/browser/renderer_host/render_widget_host_impl.h" |
113 #include "content/browser/renderer_host/text_input_client_message_filter.h" | 113 #include "content/browser/renderer_host/text_input_client_message_filter.h" |
114 #include "content/browser/renderer_host/websocket_dispatcher_host.h" | |
115 #include "content/browser/resolve_proxy_msg_helper.h" | 114 #include "content/browser/resolve_proxy_msg_helper.h" |
116 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 115 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
117 #include "content/browser/service_worker/service_worker_dispatcher_host.h" | 116 #include "content/browser/service_worker/service_worker_dispatcher_host.h" |
118 #include "content/browser/shared_worker/shared_worker_message_filter.h" | 117 #include "content/browser/shared_worker/shared_worker_message_filter.h" |
119 #include "content/browser/shared_worker/worker_storage_partition.h" | 118 #include "content/browser/shared_worker/worker_storage_partition.h" |
120 #include "content/browser/speech/speech_recognition_dispatcher_host.h" | 119 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
121 #include "content/browser/storage_partition_impl.h" | 120 #include "content/browser/storage_partition_impl.h" |
122 #include "content/browser/streams/stream_context.h" | 121 #include "content/browser/streams/stream_context.h" |
123 #include "content/browser/tracing/trace_message_filter.h" | 122 #include "content/browser/tracing/trace_message_filter.h" |
| 123 #include "content/browser/websockets/websocket_manager.h" |
124 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 124 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
125 #include "content/common/child_process_host_impl.h" | 125 #include "content/common/child_process_host_impl.h" |
126 #include "content/common/child_process_messages.h" | 126 #include "content/common/child_process_messages.h" |
127 #include "content/common/content_switches_internal.h" | 127 #include "content/common/content_switches_internal.h" |
128 #include "content/common/frame_messages.h" | 128 #include "content/common/frame_messages.h" |
129 #include "content/common/gpu_host_messages.h" | 129 #include "content/common/gpu_host_messages.h" |
130 #include "content/common/in_process_child_thread_params.h" | 130 #include "content/common/in_process_child_thread_params.h" |
131 #include "content/common/mojo/mojo_shell_connection_impl.h" | 131 #include "content/common/mojo/mojo_shell_connection_impl.h" |
132 #include "content/common/render_process_messages.h" | 132 #include "content/common/render_process_messages.h" |
133 #include "content/common/resource_messages.h" | 133 #include "content/common/resource_messages.h" |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 // should eventually be if (!ShouldUseDirectWrite()) guarded. | 981 // should eventually be if (!ShouldUseDirectWrite()) guarded. |
982 channel_->AddFilter(new FontCacheDispatcher()); | 982 channel_->AddFilter(new FontCacheDispatcher()); |
983 #elif defined(OS_ANDROID) | 983 #elif defined(OS_ANDROID) |
984 browser_demuxer_android_ = new BrowserDemuxerAndroid(); | 984 browser_demuxer_android_ = new BrowserDemuxerAndroid(); |
985 AddFilter(browser_demuxer_android_.get()); | 985 AddFilter(browser_demuxer_android_.get()); |
986 #endif | 986 #endif |
987 #if defined(ENABLE_BROWSER_CDMS) | 987 #if defined(ENABLE_BROWSER_CDMS) |
988 AddFilter(new BrowserCdmManager(GetID(), NULL)); | 988 AddFilter(new BrowserCdmManager(GetID(), NULL)); |
989 #endif | 989 #endif |
990 | 990 |
991 WebSocketDispatcherHost::GetRequestContextCallback | |
992 websocket_request_context_callback( | |
993 base::Bind(&GetRequestContext, request_context, media_request_context, | |
994 RESOURCE_TYPE_SUB_RESOURCE)); | |
995 | |
996 AddFilter(new WebSocketDispatcherHost( | |
997 GetID(), websocket_request_context_callback, blob_storage_context.get(), | |
998 storage_partition_impl_)); | |
999 | |
1000 message_port_message_filter_ = new MessagePortMessageFilter( | 991 message_port_message_filter_ = new MessagePortMessageFilter( |
1001 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 992 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
1002 base::Unretained(widget_helper_.get()))); | 993 base::Unretained(widget_helper_.get()))); |
1003 AddFilter(message_port_message_filter_.get()); | 994 AddFilter(message_port_message_filter_.get()); |
1004 | 995 |
1005 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = | 996 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = |
1006 new CacheStorageDispatcherHost(); | 997 new CacheStorageDispatcherHost(); |
1007 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); | 998 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); |
1008 AddFilter(cache_storage_filter.get()); | 999 AddFilter(cache_storage_filter.get()); |
1009 | 1000 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 GetInterfaceRegistry()->AddInterface( | 1103 GetInterfaceRegistry()->AddInterface( |
1113 base::Bind(&DeviceOrientationHost::Create), io_task_runner); | 1104 base::Bind(&DeviceOrientationHost::Create), io_task_runner); |
1114 GetInterfaceRegistry()->AddInterface( | 1105 GetInterfaceRegistry()->AddInterface( |
1115 base::Bind(&DeviceOrientationAbsoluteHost::Create), io_task_runner); | 1106 base::Bind(&DeviceOrientationAbsoluteHost::Create), io_task_runner); |
1116 | 1107 |
1117 if (memory_coordinator::IsEnabled()) { | 1108 if (memory_coordinator::IsEnabled()) { |
1118 GetInterfaceRegistry()->AddInterface( | 1109 GetInterfaceRegistry()->AddInterface( |
1119 base::Bind(&CreateMemoryCoordinatorHandle, GetID())); | 1110 base::Bind(&CreateMemoryCoordinatorHandle, GetID())); |
1120 } | 1111 } |
1121 | 1112 |
| 1113 GetInterfaceRegistry()->AddInterface( |
| 1114 base::Bind(&WebSocketManager::CreateWebSocket, GetID())); |
| 1115 |
1122 #if defined(OS_ANDROID) | 1116 #if defined(OS_ANDROID) |
1123 ServiceRegistrarAndroid::RegisterProcessHostServices( | 1117 ServiceRegistrarAndroid::RegisterProcessHostServices( |
1124 mojo_child_connection_->service_registry_android()); | 1118 mojo_child_connection_->service_registry_android()); |
1125 #endif | 1119 #endif |
1126 | 1120 |
1127 GetContentClient()->browser()->ExposeInterfacesToRenderer( | 1121 GetContentClient()->browser()->ExposeInterfacesToRenderer( |
1128 GetInterfaceRegistry(), this); | 1122 GetInterfaceRegistry(), this); |
1129 } | 1123 } |
1130 | 1124 |
1131 void RenderProcessHostImpl::CreateStoragePartitionService( | 1125 void RenderProcessHostImpl::CreateStoragePartitionService( |
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2787 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2794 | 2788 |
2795 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2789 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2796 // enough information here so that we can determine what the bad message was. | 2790 // enough information here so that we can determine what the bad message was. |
2797 base::debug::Alias(&error); | 2791 base::debug::Alias(&error); |
2798 bad_message::ReceivedBadMessage(process.get(), | 2792 bad_message::ReceivedBadMessage(process.get(), |
2799 bad_message::RPH_MOJO_PROCESS_ERROR); | 2793 bad_message::RPH_MOJO_PROCESS_ERROR); |
2800 } | 2794 } |
2801 | 2795 |
2802 } // namespace content | 2796 } // namespace content |
OLD | NEW |