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

Unified Diff: Source/WebCore/dom/GenericEventQueue.cpp

Issue 9968049: Merge 112623 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « Source/WebCore/dom/GenericEventQueue.h ('k') | Source/WebCore/html/HTMLMediaElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/GenericEventQueue.cpp
===================================================================
--- Source/WebCore/dom/GenericEventQueue.cpp (revision 112902)
+++ Source/WebCore/dom/GenericEventQueue.cpp (working copy)
@@ -31,8 +31,14 @@
namespace WebCore {
-GenericEventQueue::GenericEventQueue()
- : m_timer(this, &GenericEventQueue::timerFired)
+PassOwnPtr<GenericEventQueue> GenericEventQueue::create(EventTarget* owner)
+{
+ return adoptPtr(new GenericEventQueue(owner));
+}
+
+GenericEventQueue::GenericEventQueue(EventTarget* owner)
+ : m_owner(owner)
+ , m_timer(this, &GenericEventQueue::timerFired)
, m_isClosed(false)
{
}
@@ -47,6 +53,9 @@
return false;
ASSERT(event->target());
+ if (event->target() == m_owner)
+ event->setTarget(0);
+
m_pendingEvents.append(event);
if (!m_timer.isActive())
@@ -76,8 +85,10 @@
Vector<RefPtr<Event> > pendingEvents;
m_pendingEvents.swap(pendingEvents);
- for (unsigned i = 0; i < pendingEvents.size(); ++i)
- pendingEvents[i]->target()->dispatchEvent(pendingEvents[i].release());
+ for (unsigned i = 0; i < pendingEvents.size(); ++i) {
+ EventTarget* target = pendingEvents[i]->target() ? pendingEvents[i]->target() : m_owner;
+ target->dispatchEvent(pendingEvents[i].release());
+ }
}
void GenericEventQueue::close()
« no previous file with comments | « Source/WebCore/dom/GenericEventQueue.h ('k') | Source/WebCore/html/HTMLMediaElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698