Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Unified Diff: content/renderer/shared_worker/embedded_shared_worker_stub.cc

Issue 189413014: Send WorkerHostMsg_WorkerConnected in EmbeddedSharedWorkerStub::OnConnect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated kinuko's comment Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/shared_worker/embedded_shared_worker_stub.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « content/renderer/shared_worker/embedded_shared_worker_stub.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698