Chromium Code Reviews| Index: content/renderer/pepper/content_decryptor_delegate.cc |
| diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc |
| index 8aac3ba2d30152888c373d64e56ca19902a95db2..f0455a009b42325d5393c896181e5bfd886e6067 100644 |
| --- a/content/renderer/pepper/content_decryptor_delegate.cc |
| +++ b/content/renderer/pepper/content_decryptor_delegate.cc |
| @@ -23,6 +23,7 @@ |
| #include "media/base/video_util.h" |
| #include "ppapi/shared_impl/array_var.h" |
| #include "ppapi/shared_impl/scoped_pp_resource.h" |
| +#include "ppapi/shared_impl/time_conversion.h" |
| #include "ppapi/shared_impl/var.h" |
| #include "ppapi/shared_impl/var_tracker.h" |
| #include "ppapi/thunk/enter.h" |
| @@ -314,6 +315,8 @@ void ContentDecryptorDelegate::Initialize( |
| const media::SessionReadyCB& session_ready_cb, |
| const media::SessionClosedCB& session_closed_cb, |
| const media::SessionErrorCB& session_error_cb, |
| + const media::SessionKeysChangeCB& session_keys_change_cb, |
| + const media::SessionExpirationChangeCB& session_expiration_change_cb, |
| const base::Closure& fatal_plugin_error_cb) { |
| DCHECK(!key_system.empty()); |
| DCHECK(key_system_.empty()); |
| @@ -323,6 +326,8 @@ void ContentDecryptorDelegate::Initialize( |
| session_ready_cb_ = session_ready_cb; |
| session_closed_cb_ = session_closed_cb; |
| session_error_cb_ = session_error_cb; |
| + session_keys_change_cb_ = session_keys_change_cb; |
| + session_expiration_change_cb_ = session_expiration_change_cb; |
| fatal_plugin_error_cb_ = fatal_plugin_error_cb; |
| plugin_decryption_interface_->Initialize( |
| @@ -812,13 +817,28 @@ void ContentDecryptorDelegate::OnSessionMessage(PP_Var web_session_id, |
| void ContentDecryptorDelegate::OnSessionKeysChange( |
| PP_Var web_session_id, |
| PP_Bool has_additional_usable_key) { |
| - // TODO(jrummell): Pass this event on. |
| + if (session_keys_change_cb_.is_null()) |
|
ddorwin
2014/09/12 21:46:30
Why would this happen? I see it above as well.
jrummell
2014/09/15 18:22:40
It shouldn't happen. I just copied the existing pa
ddorwin
2014/09/17 23:54:33
Oh, yes. Good point. We need to handle unexpected
|
| + return; |
| + |
| + StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); |
| + DCHECK(web_session_id_string); |
| + |
| + session_keys_change_cb_.Run(web_session_id_string->value(), |
| + PP_ToBool(has_additional_usable_key)); |
| } |
| void ContentDecryptorDelegate::OnSessionExpirationChange( |
| PP_Var web_session_id, |
| PP_Time new_expiry_time) { |
| - // TODO(jrummell): Pass this event on. |
| + if (session_expiration_change_cb_.is_null()) |
| + return; |
| + |
| + StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id); |
| + DCHECK(web_session_id_string); |
| + |
| + session_expiration_change_cb_.Run( |
| + web_session_id_string->value(), |
| + ppapi::PPTimeToTime(new_expiry_time).ToDoubleT()); |
| } |
| void ContentDecryptorDelegate::OnSessionReady(PP_Var web_session_id) { |