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

Unified Diff: media/cdm/aes_decryptor.cc

Issue 105933004: AesDecryptor callbacks now used in a thread-safe manner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 de6f83474f0febf766d07c9795273720ce2d4834..17f1e5b8454f9382bee3603ebe234ee123118d06 100644
--- a/media/cdm/aes_decryptor.cc
+++ b/media/cdm/aes_decryptor.cc
@@ -288,6 +288,8 @@ void AesDecryptor::UpdateSession(uint32 session_id,
}
}
+ base::AutoLock auto_lock(key_cb_lock_);
ddorwin 2013/12/19 19:34:16 Should we put this in {} down to 298 so session_re
jrummell 2013/12/19 23:15:40 Done.
+
if (!new_audio_key_cb_.is_null())
new_audio_key_cb_.Run();
@@ -313,6 +315,8 @@ Decryptor* AesDecryptor::GetDecryptor() {
void AesDecryptor::RegisterNewKeyCB(StreamType stream_type,
const NewKeyCB& new_key_cb) {
+ base::AutoLock auto_lock(key_cb_lock_);
+
switch (stream_type) {
case kAudio:
new_audio_key_cb_ = new_key_cb;

Powered by Google App Engine
This is Rietveld 408576698