diff options
-rw-r--r-- | media/cdm/aes_decryptor.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/media/cdm/aes_decryptor.cc b/media/cdm/aes_decryptor.cc index f4993be..c531175 100644 --- a/media/cdm/aes_decryptor.cc +++ b/media/cdm/aes_decryptor.cc @@ -334,19 +334,21 @@ void AesDecryptor::UpdateSession(const std::string& web_session_id, // Create the list of all available keys for this session. CdmKeysInfo keys_info; - base::AutoLock auto_lock(key_map_lock_); - for (const auto& item : key_map_) { - if (item.second->Contains(web_session_id)) { - scoped_ptr<CdmKeyInformation> key_info(new CdmKeyInformation); - key_info->key_id.assign(item.first.begin(), item.first.end()); - key_info->status = CdmKeyInformation::USABLE; - key_info->system_code = 0; - keys_info.push_back(key_info.release()); + { + base::AutoLock auto_lock(key_map_lock_); + for (const auto& item : key_map_) { + if (item.second->Contains(web_session_id)) { + scoped_ptr<CdmKeyInformation> key_info(new CdmKeyInformation); + key_info->key_id.assign(item.first.begin(), item.first.end()); + key_info->status = CdmKeyInformation::USABLE; + key_info->system_code = 0; + keys_info.push_back(key_info.release()); + } } } // Assume that at least 1 new key has been successfully added and thus - // sending true for |has_additional_usable_key|. + // sending true for |has_additional_usable_key|. http://crbug.com/448219. session_keys_change_cb_.Run(web_session_id, true, keys_info.Pass()); } |