Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(883)

Unified Diff: Source/core/events/DOMWindowEventQueue.cpp

Issue 331623002: Oilpan: Prepare to move EventQueue and its subclasses to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698