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

Unified Diff: media/cdm/aes_decryptor.cc

Issue 448893002: Update ClearKey to support CDM_6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cdm6
Patch Set: rebase Created 6 years, 4 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 | « media/cdm/aes_decryptor.h ('k') | media/cdm/aes_decryptor_unittest.cc » ('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 3530c3e9de01db991588ba6c93c3f7aa12d0fdd0..daafb1e88d1916e3c4f395e625b98ec323cb8773 100644
--- a/media/cdm/aes_decryptor.cc
+++ b/media/cdm/aes_decryptor.cc
@@ -53,6 +53,10 @@ class AesDecryptor::SessionIdDecryptionKeyMap {
return key_list_.begin()->second;
}
+ bool Contains(const std::string& web_session_id) {
+ return Find(web_session_id) != key_list_.end();
+ }
+
private:
// Searches the list for an element with |web_session_id|.
KeyList::iterator Find(const std::string& web_session_id);
@@ -315,6 +319,23 @@ void AesDecryptor::UpdateSession(const std::string& web_session_id,
promise->resolve();
}
+void AesDecryptor::GetUsableKeyIds(const std::string& web_session_id,
+ scoped_ptr<KeyIdsPromise> promise) {
+ // Since |web_session_id| is not provided by the user, this should never
+ // happen.
+ DCHECK(valid_sessions_.find(web_session_id) != valid_sessions_.end());
+
+ KeyIdsVector keyids;
+ base::AutoLock auto_lock(key_map_lock_);
+ for (KeyIdToSessionKeysMap::iterator it = key_map_.begin();
+ it != key_map_.end();
+ ++it) {
+ if (it->second->Contains(web_session_id))
+ keyids.push_back(std::vector<uint8>(it->first.begin(), it->first.end()));
+ }
+ promise->resolve(keyids);
+}
+
void AesDecryptor::ReleaseSession(const std::string& web_session_id,
scoped_ptr<SimpleCdmPromise> promise) {
// Validate that this is a reference to an active session and then forget it.
« no previous file with comments | « media/cdm/aes_decryptor.h ('k') | media/cdm/aes_decryptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698