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/peer_connection_tracker_host.h" | 104 #include "content/browser/renderer_host/media/peer_connection_tracker_host.h" |
105 #include "content/browser/renderer_host/media/video_capture_host.h" | 105 #include "content/browser/renderer_host/media/video_capture_host.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/websocket/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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
944 // should eventually be if (!ShouldUseDirectWrite()) guarded. | 944 // should eventually be if (!ShouldUseDirectWrite()) guarded. |
945 channel_->AddFilter(new FontCacheDispatcher()); | 945 channel_->AddFilter(new FontCacheDispatcher()); |
946 #elif defined(OS_ANDROID) | 946 #elif defined(OS_ANDROID) |
947 browser_demuxer_android_ = new BrowserDemuxerAndroid(); | 947 browser_demuxer_android_ = new BrowserDemuxerAndroid(); |
948 AddFilter(browser_demuxer_android_.get()); | 948 AddFilter(browser_demuxer_android_.get()); |
949 #endif | 949 #endif |
950 #if defined(ENABLE_BROWSER_CDMS) | 950 #if defined(ENABLE_BROWSER_CDMS) |
951 AddFilter(new BrowserCdmManager(GetID(), NULL)); | 951 AddFilter(new BrowserCdmManager(GetID(), NULL)); |
952 #endif | 952 #endif |
953 | 953 |
954 WebSocketDispatcherHost::GetRequestContextCallback | 954 // TODO(darin): Find a better spot for this setup code. |
955 websocket_request_context_callback( | 955 websocket_manager_.reset( |
Ben Goodger (Google)
2016/07/01 21:19:51
Is it possible to do this in response to a request
darin (slow to review)
2016/07/06 16:57:21
Done.
| |
956 base::Bind(&GetRequestContext, request_context, media_request_context, | 956 new WebSocketManager(GetID(), |
957 RESOURCE_TYPE_SUB_RESOURCE)); | 957 storage_partition_impl_, |
958 | 958 blob_storage_context)); |
959 AddFilter(new WebSocketDispatcherHost( | |
960 GetID(), websocket_request_context_callback, blob_storage_context.get(), | |
961 storage_partition_impl_)); | |
962 | 959 |
963 message_port_message_filter_ = new MessagePortMessageFilter( | 960 message_port_message_filter_ = new MessagePortMessageFilter( |
964 base::Bind(&RenderWidgetHelper::GetNextRoutingID, | 961 base::Bind(&RenderWidgetHelper::GetNextRoutingID, |
965 base::Unretained(widget_helper_.get()))); | 962 base::Unretained(widget_helper_.get()))); |
966 AddFilter(message_port_message_filter_.get()); | 963 AddFilter(message_port_message_filter_.get()); |
967 | 964 |
968 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = | 965 scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = |
969 new CacheStorageDispatcherHost(); | 966 new CacheStorageDispatcherHost(); |
970 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); | 967 cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); |
971 AddFilter(cache_storage_filter.get()); | 968 AddFilter(cache_storage_filter.get()); |
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2810 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2807 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2811 | 2808 |
2812 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2809 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2813 // enough information here so that we can determine what the bad message was. | 2810 // enough information here so that we can determine what the bad message was. |
2814 base::debug::Alias(&error); | 2811 base::debug::Alias(&error); |
2815 bad_message::ReceivedBadMessage(process.get(), | 2812 bad_message::ReceivedBadMessage(process.get(), |
2816 bad_message::RPH_MOJO_PROCESS_ERROR); | 2813 bad_message::RPH_MOJO_PROCESS_ERROR); |
2817 } | 2814 } |
2818 | 2815 |
2819 } // namespace content | 2816 } // namespace content |
OLD | NEW |