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

Unified Diff: content/renderer/pepper/content_decryptor_delegate.cc

Issue 555223004: Update MediaKeys interface for EME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: base::Time Created 6 years, 3 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
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 64aa297ff5726d9f28c44d0c76c76cee5515a207..0ac46c1a88311d9fb7f7636a170d4abbb51f5bea 100644
--- a/content/renderer/pepper/content_decryptor_delegate.cc
+++ b/content/renderer/pepper/content_decryptor_delegate.cc
@@ -25,6 +25,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"
@@ -326,6 +327,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::SessionExpirationUpdateCB& session_expiration_update_cb,
const base::Closure& fatal_plugin_error_cb) {
DCHECK(!key_system.empty());
DCHECK(key_system_.empty());
@@ -335,6 +338,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_update_cb_ = session_expiration_update_cb;
fatal_plugin_error_cb_ = fatal_plugin_error_cb;
plugin_decryption_interface_->Initialize(
@@ -826,13 +831,27 @@ 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_update_cb_.is_null())
+ return;
+
+ StringVar* web_session_id_string = StringVar::FromPPVar(web_session_id);
+ DCHECK(web_session_id_string);
+
+ session_expiration_update_cb_.Run(web_session_id_string->value(),
+ ppapi::PPTimeToTime(new_expiry_time));
}
void ContentDecryptorDelegate::OnSessionReady(PP_Var web_session_id) {

Powered by Google App Engine
This is Rietveld 408576698