summaryrefslogtreecommitdiffstats
path: root/media/cdm/aes_decryptor.cc
diff options
context:
space:
mode:
authorjrummell <jrummell@chromium.org>2015-01-12 17:28:58 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-13 01:30:22 +0000
commit7dbde2df263b5268ecce114043a6f670cac91c39 (patch)
tree1a9b61251fd336319f4efa85d6308ce3052ed164 /media/cdm/aes_decryptor.cc
parent53ea3b7de97f95ab8f6b516f936ba41331c68d23 (diff)
downloadchromium_src-7dbde2df263b5268ecce114043a6f670cac91c39.zip
chromium_src-7dbde2df263b5268ecce114043a6f670cac91c39.tar.gz
chromium_src-7dbde2df263b5268ecce114043a6f670cac91c39.tar.bz2
Reduce locked scope in AesDecryptor::UpdateSession()
Should not be running a callback inside the locked section. BUG=NONE TEST=existing Clear Key tests pass Review URL: https://codereview.chromium.org/851573002 Cr-Commit-Position: refs/heads/master@{#311169}
Diffstat (limited to 'media/cdm/aes_decryptor.cc')
-rw-r--r--media/cdm/aes_decryptor.cc20
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());
}