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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp

Issue 2454333002: Add EME Layout test for unclosed the key session (Closed)
Patch Set: Call closeTask before MediaKeySession::contextDestroyed Created 4 years, 1 month 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 | « third_party/WebKit/LayoutTests/media/resources/encrypted-media-session-close-and-context-destroyed-iframe.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..59de623df83f24062bca1b130085d850c7bb9e4b 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp
@@ -1033,6 +1033,21 @@ 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.
+ if (m_actionTimer.isActive()) {
haraken 2016/11/01 02:18:33 Do we need to check this?
Dongheun Kang 2016/11/01 03:32:56 I think there seems to be no need.
+ while (!m_pendingActions.isEmpty()) {
+ PendingAction* action = m_pendingActions.takeFirst();
+ if (action->getType() == PendingAction::Close) {
+ closeTask(action->result());
+ break;
haraken 2016/11/01 02:18:33 Isn't it possible that there are more than one pen
Dongheun Kang 2016/11/01 03:32:56 So I can change as like following code. if (!m_
Dongheun Kang 2016/11/01 04:05:37 Sorry. I miss-understand your comments. This patch
+ }
+ }
+ }
+
// Stop the CDM from firing any more events for this session.
m_session.reset();
m_isClosed = true;
« no previous file with comments | « third_party/WebKit/LayoutTests/media/resources/encrypted-media-session-close-and-context-destroyed-iframe.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698