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

Unified Diff: media/cdm/aes_decryptor.cc

Issue 2446993003: EME Clear Key: Run Session Closed algorithm before resolving returned promise (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/aes_decryptor.cc
diff --git a/media/cdm/aes_decryptor.cc b/media/cdm/aes_decryptor.cc
index 0ecaa0b690a8d243114ec1e8e58cbb8534832731..932258b3948635157000ea5851f7b39096b3e053 100644
--- a/media/cdm/aes_decryptor.cc
+++ b/media/cdm/aes_decryptor.cc
@@ -396,20 +396,24 @@ void AesDecryptor::UpdateSession(const std::string& session_id,
session_keys_change_cb_.Run(session_id, key_added, std::move(keys_info));
}
+// Runs the parallel steps from https://w3c.github.io/encrypted-media/#close.
void AesDecryptor::CloseSession(const std::string& session_id,
std::unique_ptr<SimpleCdmPromise> promise) {
// Validate that this is a reference to an active session and then forget it.
std::set<std::string>::iterator it = valid_sessions_.find(session_id);
DCHECK(it != valid_sessions_.end());
+ // 5.1. Let cdm be the CDM instance represented by session's cdm instance
+ // value.
+ // 5.2. Use cdm to close the session associated with session.
valid_sessions_.erase(it);
-
- // Close the session.
DeleteKeysForSession(session_id);
- promise->resolve();
- // Resolve the closed attribute.
+ // 5.3. Queue a task to run the following steps:
+ // 5.3.1. Run the Session Closed algorithm on the session.
session_closed_cb_.Run(session_id);
+ // 5.3.2. Resolve promise.
+ promise->resolve();
}
void AesDecryptor::RemoveSession(const std::string& session_id,
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698