Index: Source/modules/encryptedmedia/MediaKeySession.cpp |
diff --git a/Source/modules/encryptedmedia/MediaKeySession.cpp b/Source/modules/encryptedmedia/MediaKeySession.cpp |
index 4efaea52c1e5178feacf03603217b63a5433ca72..1591077713dee022e452c2aeb1fbc7b4a45b022b 100644 |
--- a/Source/modules/encryptedmedia/MediaKeySession.cpp |
+++ b/Source/modules/encryptedmedia/MediaKeySession.cpp |
@@ -48,7 +48,6 @@ MediaKeySession::MediaKeySession(ExecutionContext* context, ContentDecryptionMod |
, m_asyncEventQueue(GenericEventQueue::create(this)) |
, m_session(cdm->createSession(this)) |
, m_keys(keys) |
- , m_initializeNewSessionTimer(this, &MediaKeySession::initializeNewSessionTimerFired) |
, m_updateTimer(this, &MediaKeySession::updateTimerFired) |
{ |
ScriptWrappable::init(this); |
@@ -80,21 +79,9 @@ String MediaKeySession::sessionId() const |
return m_session->sessionId(); |
} |
-void MediaKeySession::initializeNewSession(const String& mimeType, Uint8Array* initData) |
+void MediaKeySession::initializeNewSession(const String& mimeType, const Uint8Array& initData) |
{ |
- m_pendingInitializeNewSessionData.append(InitializeNewSessionData(mimeType, initData)); |
- m_initializeNewSessionTimer.startOneShot(0); |
-} |
- |
-void MediaKeySession::initializeNewSessionTimerFired(Timer<MediaKeySession>*) |
-{ |
- ASSERT(m_pendingInitializeNewSessionData.size()); |
- |
- while (!m_pendingInitializeNewSessionData.isEmpty()) { |
- InitializeNewSessionData data = m_pendingInitializeNewSessionData.takeFirst(); |
- // FIXME: Refer to the spec to see what needs to be done in blink. |
- m_session->initializeNewSession(data.mimeType, *data.initData); |
- } |
+ m_session->initializeNewSession(mimeType, initData); |
} |
void MediaKeySession::update(Uint8Array* response, ExceptionState& exceptionState) |
@@ -112,7 +99,9 @@ void MediaKeySession::update(Uint8Array* response, ExceptionState& exceptionStat |
// 3. Schedule a task to handle the call, providing response. |
m_pendingKeys.append(response); |
- m_updateTimer.startOneShot(0); |
+ |
+ if (!m_updateTimer.isActive()) |
+ m_updateTimer.startOneShot(0); |
} |
void MediaKeySession::updateTimerFired(Timer<MediaKeySession>*) |