| Index: content/renderer/shared_worker/embedded_shared_worker_stub.cc
|
| diff --git a/content/renderer/shared_worker/embedded_shared_worker_stub.cc b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
|
| index b3066a8f6e676f0bfd7fda640e12e3fc76ea9fd1..93179d96bfed50454888dc9342555b12691e5175 100644
|
| --- a/content/renderer/shared_worker/embedded_shared_worker_stub.cc
|
| +++ b/content/renderer/shared_worker/embedded_shared_worker_stub.cc
|
| @@ -63,9 +63,7 @@ void EmbeddedSharedWorkerStub::workerScriptLoaded() {
|
| for (PendingChannelList::const_iterator iter = pending_channels_.begin();
|
| iter != pending_channels_.end();
|
| ++iter) {
|
| - impl_->connect(*iter);
|
| - Send(new WorkerHostMsg_WorkerConnected((*iter)->message_port_id(),
|
| - route_id_));
|
| + ConnectToChannel(*iter);
|
| }
|
| pending_channels_.clear();
|
| }
|
| @@ -134,6 +132,13 @@ bool EmbeddedSharedWorkerStub::Send(IPC::Message* message) {
|
| return RenderThreadImpl::current()->Send(message);
|
| }
|
|
|
| +void EmbeddedSharedWorkerStub::ConnectToChannel(
|
| + WebMessagePortChannelImpl* channel) {
|
| + impl_->connect(channel);
|
| + Send(
|
| + new WorkerHostMsg_WorkerConnected(channel->message_port_id(), route_id_));
|
| +}
|
| +
|
| void EmbeddedSharedWorkerStub::OnConnect(int sent_message_port_id,
|
| int routing_id) {
|
| WebMessagePortChannelImpl* channel =
|
| @@ -141,7 +146,7 @@ void EmbeddedSharedWorkerStub::OnConnect(int sent_message_port_id,
|
| sent_message_port_id,
|
| base::MessageLoopProxy::current().get());
|
| if (runing_) {
|
| - impl_->connect(channel);
|
| + ConnectToChannel(channel);
|
| } else {
|
| // If two documents try to load a SharedWorker at the same time, the
|
| // WorkerMsg_Connect for one of the documents can come in before the
|
|
|