Chromium Code Reviews| Index: third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp |
| diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp |
| index 86a5f8bc181d1d84f3a6dfdadc2fb14cb614dc42..95ce24493b5abf362763df91f7469b82e81bce76 100644 |
| --- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp |
| +++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp |
| @@ -1033,6 +1033,19 @@ bool MediaKeySession::hasPendingActivity() const { |
| } |
| void MediaKeySession::contextDestroyed() { |
| + DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")"; |
| + |
| + // If call contextDestroyed before close session, |
| + // clear session without closeTask. |
| + // So call closeTask if there is a delayed pendingAction::Close. |
|
haraken
2016/11/01 07:21:38
// When the context is destroyed, we need to close
|
| + while (!m_pendingActions.isEmpty()) { |
| + PendingAction* action = m_pendingActions.takeFirst(); |
| + if (action->getType() == PendingAction::Close) { |
| + closeTask(action->result()); |
| + break; |
|
haraken
2016/11/01 06:56:15
Sorry, would you explain why we need 'break' here?
Dongheun Kang
2016/11/01 07:09:29
I think can't add duplicated close action in pendi
|
| + } |
| + } |
| + |
| // Stop the CDM from firing any more events for this session. |
| m_session.reset(); |
| m_isClosed = true; |