Reviewed by Darin Adler.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Oct 2008 06:07:32 +0000 (06:07 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Oct 2008 06:07:32 +0000 (06:07 +0000)
commit76dfadb7b9de60b2209adb8195b5f47df72cc48f
treea93a5600c53914d7f4a7a1952325be0fc0c237b5
parent137d03d3e6f8e8cc9370d62f1a7e42e0f286d44c
    Reviewed by Darin Adler.

        Test: fast/events/message-channel-gc-3.html

        https://bugs.webkit.org/show_bug.cgi?id=21769
        MessagePort should be GC protected if there are messages to be delivered

        * dom/MessagePort.h: Removed pending activity count. Now we track if a close event is
        pending, and check if the queue is non-empty.
        (WebCore::MessagePort::workerContext): Added a stub implementation for a cross-heap GC bug
        fix (below).

        * dom/MessagePort.cpp:
        (WebCore::CloseMessagePortTimer::fired):
        (WebCore::MessagePort::MessagePort):
        (WebCore::MessagePort::queueCloseEvent):
        (WebCore::MessagePort::dispatchCloseEvent):
        (WebCore::MessagePort::hasPendingActivity):
        Track message and close event activity separately.

        * bindings/js/JSDOMBinding.cpp:
        (WebCore::markCrossHeapDependentObjectsForDocument): Fixed a bug in cross-heap GC that was
        causing same-heap ports to never be deleted.

        * wtf/MessageQueue.h:
        (WTF::::isEmpty): Added. Also added a warning for methods that return a snapshot of queue
        state, thus likely to cause race conditions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@37771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/wtf/MessageQueue.h
LayoutTests/ChangeLog
LayoutTests/fast/events/message-channel-gc-3-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/message-channel-gc-3.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/js/JSDOMBinding.cpp
WebCore/dom/MessagePort.cpp
WebCore/dom/MessagePort.h