Commit c943942d authored by slewis@apple.com's avatar slewis@apple.com

https://bugs.webkit.org/show_bug.cgi?id=57997

<rdar://problem/9187856> REGRESSION(r75555): ~5-7 MB increase in memory between iBench runs
Navigating away from a Scrolled page which queues a scroll event that is never dispatched.
Cancel all enqueued events when detaching the Document the events cannot keep the Document
alive.

Reviewed by Darin Adler.

No change in functionality so no new tests.  

* dom/Document.cpp:
(WebCore::Document::detach):
* dom/EventQueue.cpp:
(WebCore::EventQueue::cancelQueuedEvents):
* dom/EventQueue.h:



git-svn-id: svn://svn.chromium.org/blink/trunk@83128 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9045bedd
2011-04-06 Stephanie Lewis <slewis@apple.com>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=57997
<rdar://problem/9187856> REGRESSION(r75555): ~5-7 MB increase in memory between iBench runs
Navigating away from a Scrolled page which queues a scroll event that is never dispatched.
Cancel all enqueued events when detaching the Document the events cannot keep the Document
alive.
No change in functionality so no new tests.
* dom/Document.cpp:
(WebCore::Document::detach):
* dom/EventQueue.cpp:
(WebCore::EventQueue::cancelQueuedEvents):
* dom/EventQueue.h:
2011-04-06 Dan Bernstein <mitz@apple.com> 2011-04-06 Dan Bernstein <mitz@apple.com>
Reviewed by Darin Adler. Reviewed by Darin Adler.
...@@ -1738,6 +1738,7 @@ void Document::detach() ...@@ -1738,6 +1738,7 @@ void Document::detach()
clearAXObjectCache(); clearAXObjectCache();
stopActiveDOMObjects(); stopActiveDOMObjects();
m_eventQueue->cancelQueuedEvents();
#if ENABLE(REQUEST_ANIMATION_FRAME) #if ENABLE(REQUEST_ANIMATION_FRAME)
// FIXME: consider using ActiveDOMObject. // FIXME: consider using ActiveDOMObject.
......
...@@ -92,6 +92,12 @@ bool EventQueue::cancelEvent(Event* event) ...@@ -92,6 +92,12 @@ bool EventQueue::cancelEvent(Event* event)
return found; return found;
} }
void EventQueue::cancelQueuedEvents()
{
m_pendingEventTimer->stop();
m_queuedEvents.clear();
}
void EventQueue::pendingEventTimerFired() void EventQueue::pendingEventTimerFired()
{ {
ASSERT(!m_pendingEventTimer->isActive()); ASSERT(!m_pendingEventTimer->isActive());
......
...@@ -53,6 +53,7 @@ public: ...@@ -53,6 +53,7 @@ public:
void enqueueEvent(PassRefPtr<Event>); void enqueueEvent(PassRefPtr<Event>);
void enqueueScrollEvent(PassRefPtr<Node>, ScrollEventTargetType); void enqueueScrollEvent(PassRefPtr<Node>, ScrollEventTargetType);
bool cancelEvent(Event*); bool cancelEvent(Event*);
void cancelQueuedEvents();
private: private:
explicit EventQueue(ScriptExecutionContext*); explicit EventQueue(ScriptExecutionContext*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment