Changeset 37771 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Oct 21, 2008, 11:07:32 PM (17 years ago)
Author:
[email protected]
Message:

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.
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r37763 r37771  
     12008-10-21  Alexey Proskuryakov  <[email protected]>
     2
     3        Reviewed by Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=21769
     6        MessagePort should be GC protected if there are messages to be delivered
     7
     8        * wtf/MessageQueue.h:
     9        (WTF::::isEmpty): Added. Also added a warning for methods that return a snapshot of queue
     10        state, thus likely to cause race conditions.
     11
    1122008-10-21  Darin Adler  <[email protected]>
    213
  • trunk/JavaScriptCore/wtf/MessageQueue.h

    r30811 r37771  
    4545        void prepend(const DataType&);
    4646        bool waitForMessage(DataType&);
     47        void kill();
     48
    4749        bool tryGetMessage(DataType&);
    48         void kill();
    4950        bool killed() const;
     51
     52        // The result of isEmpty() is only valid if no other thread is manipulating the queue at the same time.
     53        bool isEmpty();
    5054
    5155    private:
     
    104108
    105109    template<typename DataType>
     110    inline bool MessageQueue<DataType>::isEmpty()
     111    {
     112        MutexLocker lock(m_mutex);
     113        if (m_killed)
     114            return true;
     115        return m_queue.isEmpty();
     116    }
     117
     118    template<typename DataType>
    106119    inline void MessageQueue<DataType>::kill()
    107120    {
Note: See TracChangeset for help on using the changeset viewer.