Chromium Code Reviews| Index: content/renderer/media/crypto/ppapi_decryptor.cc |
| diff --git a/content/renderer/media/crypto/ppapi_decryptor.cc b/content/renderer/media/crypto/ppapi_decryptor.cc |
| index 350bfa199f71c0fd0230991cc94372b2fe425234..23ad31ec9655a3e5223fe6824b9b0badb5d68d5c 100644 |
| --- a/content/renderer/media/crypto/ppapi_decryptor.cc |
| +++ b/content/renderer/media/crypto/ppapi_decryptor.cc |
| @@ -137,12 +137,6 @@ void PpapiDecryptor::UpdateSession(uint32 session_id, |
| ReportFailureToCallPlugin(session_id); |
| return; |
| } |
| - |
| - if (!new_audio_key_cb_.is_null()) |
| - new_audio_key_cb_.Run(); |
| - |
| - if (!new_video_key_cb_.is_null()) |
| - new_video_key_cb_.Run(); |
| } |
| void PpapiDecryptor::ReleaseSession(uint32 session_id) { |
| @@ -352,6 +346,17 @@ void PpapiDecryptor::OnSessionMessage(uint32 session_id, |
| void PpapiDecryptor::OnSessionReady(uint32 session_id) { |
| DCHECK(render_loop_proxy_->BelongsToCurrentThread()); |
| + |
| + // Based on the spec, we need to resume playback when a session is updated, or |
|
ddorwin
2014/02/19 00:38:13
"updated" is a bit ambiguous. It's really when upd
xhwang
2014/02/19 00:46:42
Done.
|
| + // when a session is loaded. In both cases, the CDM fires OnSessionReady() |
|
ddorwin
2014/02/19 00:38:13
same/similar: successfully loaded
xhwang
2014/02/19 00:46:42
Done.
|
| + // event. So we choose to call the NewKeyCBs here. |
| + // TODO(xhwang): Rename OnSessionReady callback to OnSessionUpdated. |
|
ddorwin
2014/02/19 00:38:13
SessionUpdated does not seem to cover the loaded c
xhwang
2014/02/19 00:46:42
Done.
|
| + 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); |
| } |