summaryrefslogtreecommitdiffstats
path: root/chrome/common/webmessageportchannel_impl.cc
diff options
context:
space:
mode:
authordimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 21:46:21 +0000
committerdimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 21:46:21 +0000
commita6de082421306f85d8d8f8115c3cc1bc1c094dcd (patch)
treea5b5a234d19b3ccc1402992321f80e284d9b2a17 /chrome/common/webmessageportchannel_impl.cc
parent2d8a77e2993b6adf54db93fb2a42b95c3b206990 (diff)
downloadchromium_src-a6de082421306f85d8d8f8115c3cc1bc1c094dcd.zip
chromium_src-a6de082421306f85d8d8f8115c3cc1bc1c094dcd.tar.gz
chromium_src-a6de082421306f85d8d8f8115c3cc1bc1c094dcd.tar.bz2
Enable WorkerTest.WorkerContextMultiPort.
T2 more issues were fixed, PostTask is now used for WTF::callOnMainThread and MessagePort's QueueMessage IPC is queued on main thread to make sure it doesn't arrive in front of OnCreate. BUG=42783 TEST=itself Review URL: http://codereview.chromium.org/1843003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/webmessageportchannel_impl.cc')
-rw-r--r--chrome/common/webmessageportchannel_impl.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/common/webmessageportchannel_impl.cc b/chrome/common/webmessageportchannel_impl.cc
index 4ff8b55..24304fd 100644
--- a/chrome/common/webmessageportchannel_impl.cc
+++ b/chrome/common/webmessageportchannel_impl.cc
@@ -151,6 +151,11 @@ void WebMessagePortChannelImpl::Entangle(
}
void WebMessagePortChannelImpl::QueueMessages() {
+ if (MessageLoop::current() != ChildThread::current()->message_loop()) {
+ ChildThread::current()->message_loop()->PostTask(FROM_HERE,
+ NewRunnableMethod(this, &WebMessagePortChannelImpl::QueueMessages));
+ return;
+ }
// This message port is being sent elsewhere (perhaps to another process).
// The new endpoint needs to receive the queued messages, including ones that
// could still be in-flight. So we tell the browser to queue messages, and it