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

Unified Diff: Source/core/html/MediaController.cpp

Issue 258563005: Use GenericEventQueue class in MediaController (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/core/html/MediaController.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/MediaController.cpp
diff --git a/Source/core/html/MediaController.cpp b/Source/core/html/MediaController.cpp
index a4143250994c2a7be49dbeefe96c33d8786b3ab1..bd8e259674dd1ef0330aa02e5e808c4c7ddd2592 100644
--- a/Source/core/html/MediaController.cpp
+++ b/Source/core/html/MediaController.cpp
@@ -30,6 +30,7 @@
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "core/dom/ExceptionCode.h"
+#include "core/events/GenericEventQueue.h"
#include "core/html/HTMLMediaElement.h"
#include "core/html/TimeRanges.h"
#include "platform/Clock.h"
@@ -53,7 +54,7 @@ MediaController::MediaController(ExecutionContext* context)
, m_muted(false)
, m_readyState(HTMLMediaElement::HAVE_NOTHING)
, m_playbackState(WAITING)
- , m_asyncEventTimer(this, &MediaController::asyncEventTimerFired)
+ , m_pendingEventsQueue(GenericEventQueue::create(this))
, m_clearPositionTimer(this, &MediaController::clearPositionTimerFired)
, m_clock(Clock::create())
, m_executionContext(context)
@@ -587,19 +588,7 @@ bool MediaController::hasEnded() const
void MediaController::scheduleEvent(const AtomicString& eventName)
{
- m_pendingEvents.append(Event::createCancelable(eventName));
- if (!m_asyncEventTimer.isActive())
- m_asyncEventTimer.startOneShot(0, FROM_HERE);
-}
-
-void MediaController::asyncEventTimerFired(Timer<MediaController>*)
-{
- WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents;
-
- m_pendingEvents.swap(pendingEvents);
- size_t count = pendingEvents.size();
- for (size_t index = 0; index < count; ++index)
- dispatchEvent(pendingEvents[index].release(), IGNORE_EXCEPTION);
+ m_pendingEventsQueue->enqueueEvent(Event::createCancelable(eventName));
}
void MediaController::clearPositionTimerFired(Timer<MediaController>*)
« no previous file with comments | « Source/core/html/MediaController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698