From a6de082421306f85d8d8f8115c3cc1bc1c094dcd Mon Sep 17 00:00:00 2001 From: "dimich@chromium.org" Date: Wed, 5 May 2010 21:46:21 +0000 Subject: 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 --- chrome/common/webmessageportchannel_impl.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'chrome/common/webmessageportchannel_impl.cc') 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 -- cgit v1.1