Index: content/renderer/shared_worker/websharedworker_proxy.cc |
diff --git a/content/renderer/shared_worker/websharedworker_proxy.cc b/content/renderer/shared_worker/websharedworker_proxy.cc |
index 15d534d9deeee2941383d1881af6d82c48bd1827..a53beb37bf895b1916bd3daf8e76abdfa150b9e8 100644 |
--- a/content/renderer/shared_worker/websharedworker_proxy.cc |
+++ b/content/renderer/shared_worker/websharedworker_proxy.cc |
@@ -6,21 +6,24 @@ |
#include <stddef.h> |
+#include "content/child/child_thread_impl.h" |
#include "content/child/webmessageportchannel_impl.h" |
#include "content/common/view_messages.h" |
#include "content/common/worker_messages.h" |
+#include "ipc/ipc_sync_channel.h" |
#include "ipc/message_router.h" |
namespace content { |
-WebSharedWorkerProxy::WebSharedWorkerProxy(IPC::MessageRouter* router, |
- int route_id) |
+WebSharedWorkerProxy::WebSharedWorkerProxy(int route_id) |
: route_id_(route_id), |
- router_(router), |
message_port_id_(MSG_ROUTING_NONE), |
+ router_(ChildThreadImpl::current()->GetRouter()), |
connect_listener_(nullptr) { |
DCHECK_NE(MSG_ROUTING_NONE, route_id_); |
router_->AddRoute(route_id_, this); |
+ ChildThreadImpl::current()->channel()->GetRemoteAssociatedInterface( |
+ &message_filter_); |
} |
WebSharedWorkerProxy::~WebSharedWorkerProxy() { |
@@ -35,6 +38,7 @@ void WebSharedWorkerProxy::connect(blink::WebMessagePortChannel* channel, |
message_port_id_ = webchannel->message_port_id(); |
DCHECK_NE(MSG_ROUTING_NONE, message_port_id_); |
webchannel->QueueMessages(); |
+ |
connect_listener_ = listener; |
// An actual connection request will be issued on OnWorkerCreated(). |
} |
@@ -56,9 +60,8 @@ void WebSharedWorkerProxy::OnWorkerCreated() { |
// connect() should be called before. |
DCHECK_NE(MSG_ROUTING_NONE, message_port_id_); |
- // The worker is created - now send off the connection request. |
- router_->Send( |
- new ViewHostMsg_ConnectToWorker(route_id_, message_port_id_)); |
+ // The worker is created - nowconnect to the worker. |
kinuko
2017/01/11 06:06:43
nowconnect -> now connect
|
+ message_filter_->OnConnectToWorker(route_id_, message_port_id_); |
} |
void WebSharedWorkerProxy::OnWorkerScriptLoadFailed() { |