| 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..c0d7ffb77e3d0fd2ec4caef319e977fa326701b8 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"
|
| @@ -311,6 +312,8 @@ ContentDecryptorDelegate::~ContentDecryptorDelegate() {
|
| void ContentDecryptorDelegate::Initialize(
|
| const std::string& key_system,
|
| const media::SessionMessageCB& session_message_cb,
|
| + const media::SessionKeysChangeCB& session_keys_change_cb,
|
| + const media::SessionExpirationChangeCB& session_expiration_change_cb,
|
| const media::SessionReadyCB& session_ready_cb,
|
| const media::SessionClosedCB& session_closed_cb,
|
| const media::SessionErrorCB& session_error_cb,
|
| @@ -320,6 +323,8 @@ void ContentDecryptorDelegate::Initialize(
|
| key_system_ = key_system;
|
|
|
| session_message_cb_ = session_message_cb;
|
| + session_keys_change_cb_ = session_keys_change_cb;
|
| + session_expiration_change_cb_ = session_expiration_change_cb;
|
| session_ready_cb_ = session_ready_cb;
|
| session_closed_cb_ = session_closed_cb;
|
| session_error_cb_ = session_error_cb;
|
| @@ -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())
|
| + 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) {
|
|
|