Index: Source/core/events/DOMWindowEventQueue.cpp |
diff --git a/Source/core/events/DOMWindowEventQueue.cpp b/Source/core/events/DOMWindowEventQueue.cpp |
index 7f9eac191b195d9f656b7e63f2ebc401d9b45016..64fc172b6db95a7b453b840ac778b8ebe94ad994 100644 |
--- a/Source/core/events/DOMWindowEventQueue.cpp |
+++ b/Source/core/events/DOMWindowEventQueue.cpp |
@@ -34,25 +34,27 @@ |
namespace WebCore { |
-class DOMWindowEventQueueTimer : public SuspendableTimer { |
+class DOMWindowEventQueueTimer : public NoBaseWillBeGarbageCollectedFinalized<DOMWindowEventQueueTimer>, public SuspendableTimer { |
WTF_MAKE_NONCOPYABLE(DOMWindowEventQueueTimer); |
public: |
DOMWindowEventQueueTimer(DOMWindowEventQueue* eventQueue, ExecutionContext* context) |
: SuspendableTimer(context) |
, m_eventQueue(eventQueue) { } |
+ void trace(Visitor* visitor) { visitor->trace(m_eventQueue); } |
private: |
virtual void fired() { m_eventQueue->pendingEventTimerFired(); } |
- DOMWindowEventQueue* m_eventQueue; |
+ |
+ RawPtrWillBeMember<DOMWindowEventQueue> m_eventQueue; |
}; |
-PassRefPtr<DOMWindowEventQueue> DOMWindowEventQueue::create(ExecutionContext* context) |
+PassRefPtrWillBeRawPtr<DOMWindowEventQueue> DOMWindowEventQueue::create(ExecutionContext* context) |
{ |
- return adoptRef(new DOMWindowEventQueue(context)); |
+ return adoptRefWillBeNoop(new DOMWindowEventQueue(context)); |
} |
DOMWindowEventQueue::DOMWindowEventQueue(ExecutionContext* context) |
- : m_pendingEventTimer(adoptPtr(new DOMWindowEventQueueTimer(this, context))) |
+ : m_pendingEventTimer(adoptPtrWillBeNoop(new DOMWindowEventQueueTimer(this, context))) |
, m_isClosed(false) |
{ |
m_pendingEventTimer->suspendIfNeeded(); |
@@ -62,6 +64,13 @@ DOMWindowEventQueue::~DOMWindowEventQueue() |
{ |
} |
+void DOMWindowEventQueue::trace(Visitor* visitor) |
+{ |
+ visitor->trace(m_pendingEventTimer); |
+ visitor->trace(m_queuedEvents); |
+ EventQueue::trace(visitor); |
+} |
+ |
bool DOMWindowEventQueue::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) |
{ |
if (m_isClosed) |
@@ -79,7 +88,7 @@ bool DOMWindowEventQueue::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) |
bool DOMWindowEventQueue::cancelEvent(Event* event) |
{ |
- ListHashSet<RefPtrWillBePersistent<Event>, 16>::iterator it = m_queuedEvents.find(event); |
+ WillBeHeapListHashSet<RefPtrWillBeMember<Event>, 16>::iterator it = m_queuedEvents.find(event); |
bool found = it != m_queuedEvents.end(); |
if (found) |
m_queuedEvents.remove(it); |
@@ -105,10 +114,10 @@ void DOMWindowEventQueue::pendingEventTimerFired() |
bool wasAdded = m_queuedEvents.add(nullptr).isNewEntry; |
ASSERT_UNUSED(wasAdded, wasAdded); // It should not have already been in the list. |
- RefPtr<DOMWindowEventQueue> protector(this); |
+ RefPtrWillBeRawPtr<DOMWindowEventQueue> protector(this); |
while (!m_queuedEvents.isEmpty()) { |
- ListHashSet<RefPtrWillBePersistent<Event>, 16>::iterator iter = m_queuedEvents.begin(); |
+ WillBeHeapListHashSet<RefPtrWillBeMember<Event>, 16>::iterator iter = m_queuedEvents.begin(); |
RefPtrWillBeRawPtr<Event> event = *iter; |
m_queuedEvents.remove(iter); |
if (!event) |