Changeset 80054 in webkit


Ignore:
Timestamp:
Mar 1, 2011 3:54:02 PM (13 years ago)
Author:
jorlow@chromium.org
Message:

2011-03-01 Jeremy Orlow <jorlow@chromium.org>

Reviewed by Mihai Parparita.

EventQueue needs to be ref counted
https://bugs.webkit.org/show_bug.cgi?id=55512

EventQueue needs to be ref counted because it's possible for its instance
to be deleted while it's dispatching events. This is the reason why
https://bugs.webkit.org/show_bug.cgi?id=54785 had to be reverted.

No change of behavior, so no tests.

  • dom/Document.h:
  • dom/EventQueue.cpp: (WebCore::EventQueue::create):
  • dom/EventQueue.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80049 r80054  
     12011-03-01  Jeremy Orlow  <jorlow@chromium.org>
     2
     3        Reviewed by Mihai Parparita.
     4
     5        EventQueue needs to be ref counted
     6        https://bugs.webkit.org/show_bug.cgi?id=55512
     7
     8        EventQueue needs to be ref counted because it's possible for its instance
     9        to be deleted while it's dispatching events. This is the reason why
     10        https://bugs.webkit.org/show_bug.cgi?id=54785 had to be reverted.
     11
     12        No change of behavior, so no tests.
     13
     14        * dom/Document.h:
     15        * dom/EventQueue.cpp:
     16        (WebCore::EventQueue::create):
     17        * dom/EventQueue.h:
     18
    1192011-03-01  Helder Correia  <helder@sencha.com>
    220
  • trunk/Source/WebCore/dom/Document.h

    r80030 r80054  
    13941394    bool m_usingGeolocation;
    13951395   
    1396     OwnPtr<EventQueue> m_eventQueue;
     1396    RefPtr<EventQueue> m_eventQueue;
    13971397
    13981398#if ENABLE(WML)
  • trunk/Source/WebCore/dom/EventQueue.cpp

    r80038 r80054  
    4848};
    4949
     50PassRefPtr<EventQueue> EventQueue::create(ScriptExecutionContext* context)
     51{
     52    return adoptRef(new EventQueue(context));
     53}
     54
    5055EventQueue::EventQueue(ScriptExecutionContext* context)
    5156    : m_pendingEventTimer(adoptPtr(new EventQueueTimer(this, context)))
     
    8792    m_nodesWithQueuedScrollEvents.clear();
    8893
     94    RefPtr<EventQueue> protector(this);
     95
    8996    for (size_t i = 0; i < queuedEvents.size(); i++)
    9097        dispatchEvent(queuedEvents[i].release());
  • trunk/Source/WebCore/dom/EventQueue.h

    r80038 r80054  
    2929
    3030#include <wtf/HashSet.h>
    31 #include <wtf/Noncopyable.h>
    3231#include <wtf/OwnPtr.h>
    33 #include <wtf/PassOwnPtr.h>
     32#include <wtf/RefCounted.h>
    3433#include <wtf/RefPtr.h>
    3534#include <wtf/Vector.h>
     
    4241class ScriptExecutionContext;
    4342
    44 class EventQueue {
    45     WTF_MAKE_NONCOPYABLE(EventQueue);
    46 
    47    
     43class EventQueue : public RefCounted<EventQueue> {
    4844public:
    4945    enum ScrollEventTargetType {
     
    5248    };
    5349
    54     static PassOwnPtr<EventQueue> create(ScriptExecutionContext* context)
    55     {
    56         return adoptPtr(new EventQueue(context));
    57     }
    58 
     50    static PassRefPtr<EventQueue> create(ScriptExecutionContext*);
    5951    ~EventQueue();
    6052
Note: See TracChangeset for help on using the changeset viewer.