Commit 3affb89e authored by levin@chromium.org's avatar levin@chromium.org

JavaScriptCore:

2009-06-21  Drew Wilson  <atwilson@google.com>

        Reviewed by David Levin.

        <https://bugs.webkit.org/show_bug.cgi?id=25043>
        Added support for multi-threaded MessagePorts.

        * wtf/MessageQueue.h:
        (WTF::::appendAndCheckEmpty):
            Added API to test whether the queue was empty before adding an element.

WebCore:

2009-06-21  Drew Wilson  <atwilson@google.com>

        Reviewed by David Levin.

        <https://bugs.webkit.org/show_bug.cgi?id=25043>
        Removed obsolete MessagePort.startConversation(), active and onclose APIs.

        Refactored MessagePortProxy into MessagePortChannel and a platform-dependent PlatformMessagePortChannel
        implementation. Modified APIs to simplify cross-process implementations by moving the messaging code
        entirely into the platform-dependent proxy.

        Created a thread-safe default PlatformMessagePortChannel implementation.

        Changed DOMWindow messaging to create the MessageEvent in the target ScriptExecutionContext to match how
        cross-thread MessagePorts work.

        * GNUMakefile.am:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
            Added MessagePortChannel/PlatformMessagePortChannel files.
        * bindings/js/JSMessagePortCustom.cpp:
        (WebCore::JSMessagePort::mark):
            Changed ports to not mark their entangled pair as reachable, per the spec.
        * bindings/v8/custom/V8MessagePortCustom.cpp:
        * dom/MessageChannel.cpp:
        (WebCore::MessageChannel::MessageChannel):
            Updated to use PlatformMessagePortChannel::createChannel() to entangle the ports.
        * dom/MessagePort.cpp:
        (WebCore::MessagePort::MessagePort):
        (WebCore::MessagePort::~MessagePort):
        (WebCore::MessagePort::postMessage):
        (WebCore::MessagePort::disentangle):
        (WebCore::MessagePort::messageAvailable):
        (WebCore::MessagePort::start):
        (WebCore::MessagePort::close):
        (WebCore::MessagePort::entangle):
        (WebCore::MessagePort::contextDestroyed):
        (WebCore::MessagePort::dispatchMessages):
        (WebCore::MessagePort::setOnmessage):
        (WebCore::MessagePort::hasPendingActivity):
            Changed these APIs to delegate to new PlatformMessagePortChannel APIs.
        * dom/MessagePort.h:
            Renamed isQueueOpen() to started().
        * dom/MessagePort.idl:
            Removed startConversation and onclose.
        * dom/MessagePortProxy.h: Removed.
        * dom/MessagePortChannel.cpp: Added.
        (WebCore::MessagePortChannel::EventData::create):
        (WebCore::MessagePortChannel::EventData::EventData):
        (WebCore::MessagePortChannel::~MessagePortChannel):
        * dom/MessagePortChannel.h: Added.
        (WebCore::MessagePortChannel::EventData::message):
        (WebCore::MessagePortChannel::EventData::channel):
            Changed EventData to hold a reference to a MessagePortChannel object instead of a MessagePort to enable cross-thread messaging.
        (WebCore::MessagePortChannel::MessagePortChannel):
        (WebCore::MessagePortChannel::create):
        * dom/ScriptExecutionContext.cpp:
        (WebCore:ScriptExecutionContext::dispatchMessagePortEvents):
            Renamed isQueueOpen() to started().
        * dom/default/PlatformMessagePortChannel.cpp: Added.
        (WebCore::MessagePortChannel::entangleIfOpen):
        (WebCore::MessagePortChannel::disentangle):
        (WebCore::MessagePortChannel::postMessageToRemote):
        (WebCore::MessagePortChannel::tryGetMessageFromRemote):
        (WebCore::MessagePortChannel::close):
        (WebCore::MessagePortChannel::isConnectedTo):
        (WebCore::MessagePortChannel::hasPendingActivity):
        (WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel):
        (WebCore::PlatformMessagePortChannel::~PlatformMessagePortChannel):
        (WebCore::PlatformMessagePortChannel::createChannel):
        (WebCore::PlatformMessagePortChannel::entangleIfOpen):
        (WebCore::PlatformMessagePortChannel::disentangle):
        (WebCore::PlatformMessagePortChannel::setRemotePort):
        (WebCore::PlatformMessagePortChannel::remotePort):
        (WebCore::PlatformMessagePortChannel::entangledChannel):
        (WebCore::PlatformMessagePortChannel::setEntangledChannel):
        (WebCore::PlatformMessagePortChannel::postMessageToRemote):
        (WebCore::PlatformMessagePortChannel::tryGetMessageFromRemote):
        (WebCore::PlatformMessagePortChannel::isConnectedTo):
        (WebCore::PlatformMessagePortChannel::close):
        (WebCore::PlatformMessagePortChannel::closeInternal):
        (WebCore::PlatformMessagePortChannel::hasPendingActivity):
        * dom/default/PlatformMessagePortChannel.h: Added.
        (WebCore::PlatformMessagePortChannel::MessagePortQueue::create):
        (WebCore::PlatformMessagePortChannel::MessagePortQueue::tryGetMessage):
        (WebCore::PlatformMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
        (WebCore::PlatformMessagePortChannel::MessagePortQueue::isEmpty):
        (WebCore::PlatformMessagePortChannel::MessagePortQueue::MessagePortQueue):
        * page/DOMWindow.cpp:
        (WebCore::PostMessageTimer::PostMessageTimer):
            Changed DOMWindow messaging to create the MessageEvent in the target ScriptExecutionContext to match how cross-thread MessagePorts work.
        (WebCore::PostMessageTimer::event):
        (WebCore::DOMWindow::postMessage):
        (WebCore::DOMWindow::postMessageTimerFired):

LayoutTests:

2009-06-21  Drew Wilson  <atwilson@google.com>

        Reviewed by David Levin.

        <https://bugs.webkit.org/show_bug.cgi?id=25043>
        Updated MessageChannel/MessagePorts tests to reflect latest spec (close event has been removed).
        Added more tests of port cloning.

        * fast/events/message-channel-gc-2-expected.txt:
        * fast/events/message-channel-gc-2.html-disabled:
        * fast/events/message-channel-gc-3-expected.txt:
        * fast/events/message-channel-gc-3.html-disabled:
        * fast/events/message-channel-gc-expected.txt:
        * fast/events/message-channel-gc.html-disabled:
        * fast/events/message-port-clone-expected.txt: Added.
        * fast/events/message-port-clone.html-disabled: Added.
        * fast/events/message-port-expected.txt:
        * fast/events/message-port-no-wrapper-expected.txt: Added.
        * fast/events/message-port-onclose-expected.txt: Removed.
        * fast/events/message-port-onclose.html-disabled: Removed.
        * fast/events/message-port.html-disabled:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0e2df434
2009-06-21 Drew Wilson <atwilson@google.com>
Reviewed by David Levin.
<https://bugs.webkit.org/show_bug.cgi?id=25043>
Added support for multi-threaded MessagePorts.
* wtf/MessageQueue.h:
(WTF::::appendAndCheckEmpty):
Added API to test whether the queue was empty before adding an element.
2009-06-20 David D. Kilzer <ddkilzer@webkit.org>
Fix namespace comment in SegmentedVector.h
......
......@@ -47,9 +47,10 @@ namespace WTF {
template<typename DataType>
class MessageQueue : Noncopyable {
public:
MessageQueue() : m_killed(false) {}
MessageQueue() : m_killed(false) { }
void append(const DataType&);
bool appendAndCheckEmpty(const DataType&);
void prepend(const DataType&);
bool waitForMessage(DataType&);
template<typename Predicate>
......@@ -81,6 +82,17 @@ namespace WTF {
m_condition.signal();
}
// Returns true if the queue was empty before the item was added.
template<typename DataType>
inline bool MessageQueue<DataType>::appendAndCheckEmpty(const DataType& message)
{
MutexLocker lock(m_mutex);
bool wasEmpty = m_queue.isEmpty();
m_queue.append(message);
m_condition.signal();
return wasEmpty;
}
template<typename DataType>
inline void MessageQueue<DataType>::prepend(const DataType& message)
{
......
2009-06-21 Drew Wilson <atwilson@google.com>
Reviewed by David Levin.
<https://bugs.webkit.org/show_bug.cgi?id=25043>
Updated MessageChannel/MessagePorts tests to reflect latest spec (close event has been removed).
Added more tests of port cloning.
* fast/events/message-channel-gc-2-expected.txt:
* fast/events/message-channel-gc-2.html-disabled:
* fast/events/message-channel-gc-3-expected.txt:
* fast/events/message-channel-gc-3.html-disabled:
* fast/events/message-channel-gc-expected.txt:
* fast/events/message-channel-gc.html-disabled:
* fast/events/message-port-clone-expected.txt: Added.
* fast/events/message-port-clone.html-disabled: Added.
* fast/events/message-port-expected.txt:
* fast/events/message-port-no-wrapper-expected.txt: Added.
* fast/events/message-port-onclose-expected.txt: Removed.
* fast/events/message-port-onclose.html-disabled: Removed.
* fast/events/message-port.html-disabled:
2009-06-21 Dan Bernstein <mitz@apple.com>
Reviewed by Sam Weinig.
......
Test that MessagePort close event gets delivered (without crashing) even if the channel object is garbage collected.
onclose
close listener
DONE
......@@ -6,7 +6,6 @@ function gc()
{
if (window.GCController)
return GCController.collect();
for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
var s = new String("abc");
}
......@@ -24,9 +23,6 @@ if (window.layoutTestController) {
var channel = new MessageChannel;
channel.port1.onclose = function() { log("onclose"); setTimeout(function() { if (window.layoutTestController) layoutTestController.notifyDone(); gc(); }, 0) }
channel.port1.addEventListener("close", function() { log("close listener"); gc(); }, false);
gc();
channel.port1.start();
channel.port2.postMessage("msg");
......@@ -35,7 +31,15 @@ gc();
channel.port1.close();
channel.port2.close();
gc();
setTimeout(function() {
log("DONE");
gc();
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 0);
channel = new MessageChannel;
gc();
</script>
</body>
......@@ -3,5 +3,5 @@ Test that MessagePort messages are delivered even if both ports are inaccessible
Should say PASS twice.
PASS: message delivered. Port: [object MessagePort]
PASS: close message delivered. Port: [object MessagePort]
PASS: port closed.
......@@ -28,7 +28,6 @@ function test1()
var channel = new MessageChannel;
channel.port1.onmessage = function(evt) { log("PASS: message delivered. Port: " + evt.target); test2(); }
channel.port1.start();
channel.port2.postMessage("msg");
channel = 0;
......@@ -39,11 +38,13 @@ function test2()
{
var channel = new MessageChannel;
channel.port1.onclose = function(evt) { log("PASS: close message delivered. Port: " + evt.target); if (window.layoutTestController) layoutTestController.notifyDone(); }
channel.port2.close();
channel = 0;
gc();
log("PASS: port closed.");
if (window.layoutTestController)
layoutTestController.notifyDone();
}
test1();
......
......@@ -3,6 +3,5 @@ Test some cases of MessagePort garbage collection.
Should be 'bar': bar
onmessage
message listener
onclose
close listener
DONE
......@@ -29,8 +29,6 @@ gc();
log("Should be 'bar': " + channel.port1.foo);
channel.port1.onmessage = function() { log("onmessage"); }
channel.port1.onclose = function() { log("onclose"); setTimeout(function() { if (window.layoutTestController) layoutTestController.notifyDone() }, 0) }
channel.port1.addEventListener("close", function() { log("close listener"); }, false);
channel.port1.addEventListener("message", function() { log("message listener"); }, false);
gc();
......@@ -42,5 +40,12 @@ channel.port1.close();
channel.port2.close();
gc();
setTimeout(function() {
log("DONE");
if (window.layoutTestController)
layoutTestController.notifyDone()
}, 0);
</script>
</body>
Tests various use cases when cloning MessagePorts.
Should be a series of SUCCESS messages, followed with DONE.
SUCCESS: Posting port to itself: Error: INVALID_STATE_ERR: DOM Exception 11
SUCCESS: Posting entangled port: Error: INVALID_STATE_ERR: DOM Exception 11
SUCCESS: Posting cloned port.
SUCCESS: Posted messages to cloned port.
SUCCESS: Cloned both endpoints of a channel.
SUCCESS: Got closed port with event message closed
DONE
<body>
<p>Tests various use cases when cloning MessagePorts.</p>
<p>Should be a series of SUCCESS messages, followed with DONE.</p>
<pre id=log></pre>
<script>
function gc()
{
if (window.GCController)
return GCController.collect();
for (var i = 0; i < 10000; i++) { // force garbage collection (FF requires about 9K allocations before a collect).
var s = new String("abc");
}
}
function log(message)
{
document.getElementById("log").innerHTML += message + "<br>";
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
var channel = new MessageChannel;
channel.port1.onmessage = channel.port2.onmessage = function(evt) {
fail("FAIL: Should not have received message: " + evt.data);
}
try {
channel.port1.postMessage("msg", channel.port1);
log("FAIL: Posting port to itself should throw an exception.");
} catch (ex) {
log("SUCCESS: Posting port to itself: " + ex);
}
try {
channel.port1.postMessage("msg", channel.port2);
log("FAIL: Posting port to entangled pair should throw an exception.");
} catch (ex) {
log("SUCCESS: Posting entangled port: " + ex);
}
channel = new MessageChannel;
var channel2 = new MessageChannel;
channel.port1.postMessage("msg", channel2.port1);
// Should not be able to post a cloned port.
try {
channel.port1.postMessage("msg", channel2.port1);
log("FAIL: Posting cloned port should throw an exception.");
} catch (ex) {
log("SUCCESS: Posting cloned port.");
}
// Test posting messages to a port in cloned state.
var channel = new MessageChannel;
var channel2 = new MessageChannel;
// Post messages before and after clone to make sure ordering is preserved and all messages are received.
channel2.port2.postMessage("1");
channel.port1.postMessage("msg", channel2.port1);
channel2.port2.postMessage("2");
channel2.port2.postMessage("3");
channel.port2.onmessage = function(evt) {
var messageIndex = 1;
evt.messagePort.onmessage = function(evt) {
if (evt.data != messageIndex)
log("FAIL: Got message " + evt.data + ", expected " + messageIndex);
messageIndex++;
if (messageIndex == 4) {
log("SUCCESS: Posted messages to cloned port.");
testDoublyClonedPort();
}
}
}
function testDoublyClonedPort()
{
var channel = new MessageChannel;
var channel2 = new MessageChannel;
channel.port1.postMessage("msg", channel2.port1);
channel.port2.postMessage("msg", channel2.port2);
gc();
channel.port1.onmessage = function(evt) {
evt.messagePort.postMessage("testme");
}
channel.port2.onmessage = function(evt) {
evt.messagePort.onmessage = function (evt) {
if (evt.data == "testme")
log("SUCCESS: Cloned both endpoints of a channel.");
else
log("FAIL: Invalid message arrived: " + evt.data);
testPostClosePort();
}
}
}
// *Should* be able to post a closed port.
function testPostClosePort()
{
var channel = new MessageChannel;
var channel2 = new MessageChannel;
channel2.port2.close();
channel.port1.postMessage("closed", channel2.port2);
channel.port2.onmessage = function(evt) {
if (!evt.messagePort)
log("FAIL: Closed port not sent.");
else if (evt.data != "closed")
log("FAIL: Unexpected message: " + evt.data);
else
log("SUCCESS: Got closed port with event message " + evt.data);
done();
}
}
function done()
{
log("DONE");
if (window.layoutTestController)
layoutTestController.notifyDone();
}
</script>
</body>
......@@ -4,8 +4,7 @@ Should be a series of SUCCESS messages, followed with DONE.
Simple exchange: SUCCESS
Posted port: SUCCESS
Conversation: SUCCESS
A port is active: SUCCESS
A closed port is inactive: SUCCESS
Event Listener: SUCCESS
Closed port: SUCCESS
DONE
Test that delivering a message to a port that was never referenced from JS doesn't cause a crash.
PASS
Test that close event handler is invoked when a MessagePort is closed.
PASS
<body>
<p>Test that close event handler is invoked when a MessagePort is closed.</p>
<pre id=log></pre>
<script>
function gc()
{
if (window.GCController)
return GCController.collect();
for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
var s = new String("abc");
}
}
function log(message)
{
document.getElementById("log").innerHTML += message + "<br>";
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
function test()
{
// Single frame.
var channel = new MessageChannel;
var closeCount = 0;
function onclose()
{
++closeCount;
if (closeCount == 4)
test2();
}
channel.port1.onclose = onclose;
channel.port2.onclose = onclose;
channel.port1.addEventListener("close", onclose, false);
channel.port2.addEventListener("close", onclose, false);
gc();
channel.port1.start();
channel.port2.start();
channel.port1.close();
}
function test2()
{
// Cross-frame.
var channel = new MessageChannel;
window.frames[0].postMessage("msg", channel.port2, "*");
var mainPort = channel.port1;
mainPort.start();
var closeCount = 0;
function onclose()
{
++closeCount;
if (closeCount == 2)
test3();
}
mainPort.postMessage("closePort");
mainPort.onclose = onclose;
mainPort.addEventListener("close", onclose, false);
gc();
}
function test3()
{
// Document destroyed.
var channel = new MessageChannel;
window.frames[0].postMessage("msg", channel.port2, "*");
var mainPort = channel.port1;
mainPort.start();
var closeCount = 0;
function onclose()
{
++closeCount;
log("FAIL: unexpected close event from document destruction.");
}
mainPort.postMessage("closeFrame");
mainPort.onclose = onclose;
mainPort.addEventListener("close", onclose, false);
setTimeout(function() {
if (closeCount == 0)
log("PASS");
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 50);
gc();
}
</script>
<iframe src="resources/message-port-iframe.html" onload="test()"></iframe>
</body>
......@@ -28,7 +28,6 @@ function test()
log("Simple exchange: FAIL. Got message '" + evt.data + "' from '" + evt.origin + "'.");
test2();
};
mainPort.start();
}
function test2()
......@@ -42,34 +41,53 @@ function test2()
log("Posted port: FAIL. Got message '" + evt.data + "' from '" + evt.origin + "'.");
test3();
};
channel.port1.start();
}
function test3()
{
var port = mainPort.startConversation("newConversation");
port.onmessage = function(evt) {
if (evt.data == "hey" && evt.origin == "")
log("Conversation: SUCCESS");
else
log("Conversation: FAIL. Got message '" + evt.data + "' from '" + evt.origin + "'.");
test4();
};
port.start();
var channel = new MessageChannel;
channel.port1.postMessage("1");
var started = false;
channel.port2.addEventListener("message", function(evt) {
if (started) {
log("Event Listener: SUCCESS");
test4();
} else
log("Event Listener: FAIL. Event listener called before start()");
});
setTimeout(function() {
channel.port2.start();
started = true;
}, 100);
}
function test4()
{
log("A port is active: " + (mainPort.active ? "SUCCESS" : "FAIL"));
mainPort.close();
log("A closed port is inactive: " + (mainPort.active ? "FAIL" : "SUCCESS"));
log("DONE");
var channel = new MessageChannel;
channel.port1.postMessage("1");
channel.port1.close();
channel.port1.postMessage("2");
channel.port2.onmessage = function(evt) {
if (evt.data == "1") {
log("Closed port: SUCCESS");
test5();
} else
log("Closed port: FAIL. Got message: " + evt.data + " after close");
}
}
if (window.layoutTestController)
layoutTestController.notifyDone();
function test5()
{
// Create a channel and put some messages in it which will go undelivered and should not leak
var channel = new MessageChannel;
channel.port1.postMessage("abcde");
// Now wait a short period of time to ensure no messages come in from previous tests.
setTimeout(function() {
log("DONE");
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 100);
}
</script>
......
2009-06-21 Drew Wilson <atwilson@google.com>
Reviewed by David Levin.
<https://bugs.webkit.org/show_bug.cgi?id=25043>
Removed obsolete MessagePort.startConversation(), active and onclose APIs.
Refactored MessagePortProxy into MessagePortChannel and a platform-dependent PlatformMessagePortChannel
implementation. Modified APIs to simplify cross-process implementations by moving the messaging code
entirely into the platform-dependent proxy.
Created a thread-safe default PlatformMessagePortChannel implementation.
Changed DOMWindow messaging to create the MessageEvent in the target ScriptExecutionContext to match how
cross-thread MessagePorts work.
* GNUMakefile.am:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Added MessagePortChannel/PlatformMessagePortChannel files.
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::mark):
Changed ports to not mark their entangled pair as reachable, per the spec.
* bindings/v8/custom/V8MessagePortCustom.cpp:
* dom/MessageChannel.cpp:
(WebCore::MessageChannel::MessageChannel):
Updated to use PlatformMessagePortChannel::createChannel() to entangle the ports.
* dom/MessagePort.cpp:
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::messageAvailable):
(WebCore::MessagePort::start):
(WebCore::MessagePort::close):
(WebCore::MessagePort::entangle):
(WebCore::MessagePort::contextDestroyed):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::setOnmessage):
(WebCore::MessagePort::hasPendingActivity):
Changed these APIs to delegate to new PlatformMessagePortChannel APIs.
* dom/MessagePort.h:
Renamed isQueueOpen() to started().
* dom/MessagePort.idl:
Removed startConversation and onclose.
* dom/MessagePortProxy.h: Removed.
* dom/MessagePortChannel.cpp: Added.
(WebCore::MessagePortChannel::EventData::create):
(WebCore::MessagePortChannel::EventData::EventData):
(WebCore::MessagePortChannel::~MessagePortChannel):
* dom/MessagePortChannel.h: Added.
(WebCore::MessagePortChannel::EventData::message):
(WebCore::MessagePortChannel::EventData::channel):
Changed EventData to hold a reference to a MessagePortChannel object instead of a MessagePort to enable cross-thread messaging.
(WebCore::MessagePortChannel::MessagePortChannel):
(WebCore::MessagePortChannel::create):
* dom/ScriptExecutionContext.cpp:
(WebCore:ScriptExecutionContext::dispatchMessagePortEvents):
Renamed isQueueOpen() to started().
* dom/default/PlatformMessagePortChannel.cpp: Added.
(WebCore::MessagePortChannel::entangleIfOpen):
(WebCore::MessagePortChannel::disentangle):
(WebCore::MessagePortChannel::postMessageToRemote):
(WebCore::MessagePortChannel::tryGetMessageFromRemote):
(WebCore::MessagePortChannel::close):
(WebCore::MessagePortChannel::isConnectedTo):
(WebCore::MessagePortChannel::hasPendingActivity):
(WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel):
(WebCore::PlatformMessagePortChannel::~PlatformMessagePortChannel):
(WebCore::PlatformMessagePortChannel::createChannel):
(WebCore::PlatformMessagePortChannel::entangleIfOpen):
(WebCore::PlatformMessagePortChannel::disentangle):
(WebCore::PlatformMessagePortChannel::setRemotePort):
(WebCore::PlatformMessagePortChannel::remotePort):
(WebCore::PlatformMessagePortChannel::entangledChannel):
(WebCore::PlatformMessagePortChannel::setEntangledChannel):
(WebCore::PlatformMessagePortChannel::postMessageToRemote):
(WebCore::PlatformMessagePortChannel::tryGetMessageFromRemote):
(WebCore::PlatformMessagePortChannel::isConnectedTo):
(WebCore::PlatformMessagePortChannel::close):
(WebCore::PlatformMessagePortChannel::closeInternal):
(WebCore::PlatformMessagePortChannel::hasPendingActivity):
* dom/default/PlatformMessagePortChannel.h: Added.
(WebCore::PlatformMessagePortChannel::MessagePortQueue::create):
(WebCore::PlatformMessagePortChannel::MessagePortQueue::tryGetMessage):
(WebCore::PlatformMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
(WebCore::PlatformMessagePortChannel::MessagePortQueue::isEmpty):
(WebCore::PlatformMessagePortChannel::MessagePortQueue::MessagePortQueue):
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::PostMessageTimer):
Changed DOMWindow messaging to create the MessageEvent in the target ScriptExecutionContext to match how cross-thread MessagePorts work.
(WebCore::PostMessageTimer::event):
(WebCore::DOMWindow::postMessage):
(WebCore::DOMWindow::postMessageTimerFired):
2009-06-21 Dan Bernstein <mitz@apple.com>
Reviewed by Sam Weinig.
......
......@@ -678,7 +678,8 @@ webcore_sources += \
WebCore/dom/MessageEvent.h \
WebCore/dom/MessagePort.cpp \
WebCore/dom/MessagePort.h \
WebCore/dom/MessagePortProxy.h \
WebCore/dom/MessagePortChannel.cpp \
WebCore/dom/MessagePortChannel.h \
WebCore/dom/MouseEvent.cpp \
WebCore/dom/MouseEvent.h \
WebCore/dom/MouseRelatedEvent.cpp \
......@@ -770,6 +771,8 @@ webcore_sources += \
WebCore/dom/XMLTokenizerLibxml2.cpp \
WebCore/dom/XMLTokenizerScope.cpp \
WebCore/dom/XMLTokenizerScope.h \
WebCore/dom/default/PlatformMessagePortChannel.cpp \
WebCore/dom/default/PlatformMessagePortChannel.h \
WebCore/editing/AppendNodeCommand.cpp \
WebCore/editing/AppendNodeCommand.h \
WebCore/editing/ApplyStyleCommand.cpp \
......
......@@ -23263,7 +23263,19 @@
>
</File>
<File