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

Unified Diff: media/cdm/aes_decryptor.cc

Issue 833963003: Pass key_information on SessionKeysChange message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GN changes Created 5 years, 12 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
Index: media/cdm/aes_decryptor.cc
diff --git a/media/cdm/aes_decryptor.cc b/media/cdm/aes_decryptor.cc
index 9938bae2c8df544ffde76f1169697986d9d3e8cf..e23ce6338a8bfcbe335525f8bf61caf1a279dd8e 100644
--- a/media/cdm/aes_decryptor.cc
+++ b/media/cdm/aes_decryptor.cc
@@ -13,6 +13,7 @@
#include "crypto/encryptor.h"
#include "crypto/symmetric_key.h"
#include "media/base/audio_decoder_config.h"
+#include "media/base/cdm_key_information.h"
#include "media/base/cdm_promise.h"
#include "media/base/decoder_buffer.h"
#include "media/base/decrypt_config.h"
@@ -329,9 +330,19 @@ void AesDecryptor::UpdateSession(const std::string& web_session_id,
promise->resolve();
+ // Create the list of all available keys for this session.
+ CdmKeyInformationVector key_information;
+ base::AutoLock auto_lock(key_map_lock_);
+ for (const auto& item : key_map_) {
+ if (item.second->Contains(web_session_id)) {
+ CdmKeyInformation key_id(item.first, CdmKeyInformation::USABLE, 0);
+ key_information.push_back(key_id);
+ }
+ }
+
// Assume that at least 1 new key has been successfully added and thus
- // sending true.
- session_keys_change_cb_.Run(web_session_id, true);
+ // sending true for |has_additional_usable_key|.
+ session_keys_change_cb_.Run(web_session_id, true, key_information);
}
void AesDecryptor::CloseSession(const std::string& web_session_id,

Powered by Google App Engine
This is Rietveld 408576698