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

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: refresh Created 6 years, 11 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') | tools/valgrind/tsan_v2/suppressions.txt » ('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 9f9f0801efbb3a2641954ca11192cb3163dca6a9..c682e026c83d7bc96f63faae3d1acfceeb87a1fb 100644
--- a/media/cdm/aes_decryptor.cc
+++ b/media/cdm/aes_decryptor.cc
@@ -285,11 +285,15 @@ void AesDecryptor::UpdateSession(uint32 session_id,
}
}
- if (!new_audio_key_cb_.is_null())
- new_audio_key_cb_.Run();
+ {
+ base::AutoLock auto_lock(new_key_cb_lock_);
- if (!new_video_key_cb_.is_null())
- new_video_key_cb_.Run();
+ if (!new_audio_key_cb_.is_null())
+ new_audio_key_cb_.Run();
+
+ if (!new_video_key_cb_.is_null())
+ new_video_key_cb_.Run();
+ }
session_ready_cb_.Run(session_id);
}
@@ -310,6 +314,8 @@ Decryptor* AesDecryptor::GetDecryptor() {
void AesDecryptor::RegisterNewKeyCB(StreamType stream_type,
const NewKeyCB& new_key_cb) {
+ base::AutoLock auto_lock(new_key_cb_lock_);
+
switch (stream_type) {
case kAudio:
new_audio_key_cb_ = new_key_cb;
« no previous file with comments | « media/cdm/aes_decryptor.h ('k') | tools/valgrind/tsan_v2/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698