| Index: content/browser/renderer_host/render_process_host_impl.cc
|
| diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
| index 04f449ce28c37a43559e0424ec54c86e894719c5..3866ef750aab55ab48f26d6daa8d61e24d1837bf 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -109,7 +109,6 @@
|
| #include "content/browser/renderer_host/render_widget_helper.h"
|
| #include "content/browser/renderer_host/render_widget_host_impl.h"
|
| #include "content/browser/renderer_host/text_input_client_message_filter.h"
|
| -#include "content/browser/renderer_host/websocket_dispatcher_host.h"
|
| #include "content/browser/resolve_proxy_msg_helper.h"
|
| #include "content/browser/service_worker/service_worker_context_wrapper.h"
|
| #include "content/browser/service_worker/service_worker_dispatcher_host.h"
|
| @@ -119,6 +118,7 @@
|
| #include "content/browser/storage_partition_impl.h"
|
| #include "content/browser/streams/stream_context.h"
|
| #include "content/browser/tracing/trace_message_filter.h"
|
| +#include "content/browser/websockets/websocket_manager.h"
|
| #include "content/browser/webui/web_ui_controller_factory_registry.h"
|
| #include "content/common/child_process_host_impl.h"
|
| #include "content/common/child_process_messages.h"
|
| @@ -685,6 +685,9 @@ RenderProcessHostImpl::~RenderProcessHostImpl() {
|
| BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
|
| base::Bind(&RemoveShaderInfo, GetID()));
|
| }
|
| +
|
| + if (websocket_manager_)
|
| + BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, websocket_manager_);
|
| }
|
|
|
| void RenderProcessHostImpl::EnableSendQueue() {
|
| @@ -954,15 +957,6 @@ void RenderProcessHostImpl::CreateMessageFilters() {
|
| AddFilter(new BrowserCdmManager(GetID(), NULL));
|
| #endif
|
|
|
| - WebSocketDispatcherHost::GetRequestContextCallback
|
| - websocket_request_context_callback(
|
| - base::Bind(&GetRequestContext, request_context, media_request_context,
|
| - RESOURCE_TYPE_SUB_RESOURCE));
|
| -
|
| - AddFilter(new WebSocketDispatcherHost(
|
| - GetID(), websocket_request_context_callback, blob_storage_context.get(),
|
| - storage_partition_impl_));
|
| -
|
| message_port_message_filter_ = new MessagePortMessageFilter(
|
| base::Bind(&RenderWidgetHelper::GetNextRoutingID,
|
| base::Unretained(widget_helper_.get())));
|
| @@ -1071,6 +1065,15 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
|
| GetInterfaceRegistry()->AddInterface(
|
| base::Bind(&DeviceOrientationAbsoluteHost::Create), io_task_runner);
|
|
|
| + // This is the fallback registration used when the renderer needs a WebSocket
|
| + // that we cannot associate with a RenderFrame (e.g., Shared Workers).
|
| + GetInterfaceRegistry()->AddInterface(
|
| + base::Bind(
|
| + &WebSocketManager::CreateWebSocket,
|
| + base::Unretained(GetWebSocketManager()),
|
| + MSG_ROUTING_NONE),
|
| + io_task_runner);
|
| +
|
| #if defined(OS_ANDROID)
|
| ServiceRegistrarAndroid::RegisterProcessHostServices(
|
| mojo_child_connection_->service_registry_android());
|
| @@ -2636,6 +2639,12 @@ void RenderProcessHostImpl::OnProcessLaunchFailed(int error_code) {
|
| ProcessDied(true, &details);
|
| }
|
|
|
| +WebSocketManager* RenderProcessHostImpl::GetWebSocketManager() {
|
| + if (!websocket_manager_)
|
| + websocket_manager_ = new WebSocketManager(GetID(), storage_partition_impl_);
|
| + return websocket_manager_;
|
| +}
|
| +
|
| scoped_refptr<AudioRendererHost> RenderProcessHostImpl::audio_renderer_host()
|
| const {
|
| return audio_renderer_host_;
|
|
|