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

Unified Diff: ppapi/cpp/private/content_decryptor_private.cc

Issue 10854209: Modify the PPAPI CDM interface to pass more info. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « ppapi/cpp/private/content_decryptor_private.h ('k') | ppapi/proxy/content_decryptor_private_serializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/private/content_decryptor_private.cc
diff --git a/ppapi/cpp/private/content_decryptor_private.cc b/ppapi/cpp/private/content_decryptor_private.cc
index c2d95ed8cbbe1a0a7c4284da59a61a2460c926a4..633215a6d4cfcb0284a7e51d76bf6a9259150d32 100644
--- a/ppapi/cpp/private/content_decryptor_private.cc
+++ b/ppapi/cpp/private/content_decryptor_private.cc
@@ -11,6 +11,7 @@
#include "ppapi/c/private/ppp_content_decryptor_private.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/instance_handle.h"
+#include "ppapi/cpp/logging.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/module_impl.h"
#include "ppapi/cpp/var.h"
@@ -47,7 +48,8 @@ PP_Bool GenerateKeyRequest(PP_Instance instance,
PP_Bool AddKey(PP_Instance instance,
PP_Var session_id_arg,
- PP_Var key_arg) {
+ PP_Var key_arg,
+ PP_Var init_data_arg) {
void* object =
Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface);
if (!object)
@@ -62,10 +64,16 @@ PP_Bool AddKey(PP_Instance instance,
return PP_FALSE;
pp::VarArrayBuffer key(key_var);
+ pp::Var init_data_var(pp::PASS_REF, init_data_arg);
+ if (init_data_var.is_array_buffer() == false)
+ return PP_FALSE;
+ pp::VarArrayBuffer init_data(init_data_var);
+
return PP_FromBool(
static_cast<ContentDecryptor_Private*>(object)->AddKey(
session_id_var.AsString(),
- key));
+ key,
+ init_data));
}
PP_Bool CancelKeyRequest(PP_Instance instance,
@@ -87,7 +95,7 @@ PP_Bool CancelKeyRequest(PP_Instance instance,
PP_Bool Decrypt(PP_Instance instance,
PP_Resource encrypted_resource,
- int32_t request_id) {
+ const PP_EncryptedBlockInfo* encrypted_block_info) {
void* object =
Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface);
if (!object)
@@ -96,13 +104,14 @@ PP_Bool Decrypt(PP_Instance instance,
pp::Buffer_Dev encrypted_block(encrypted_resource);
return PP_FromBool(
- static_cast<ContentDecryptor_Private*>(object)->Decrypt(encrypted_block,
- request_id));
+ static_cast<ContentDecryptor_Private*>(object)->Decrypt(
+ encrypted_block,
+ *encrypted_block_info));
}
PP_Bool DecryptAndDecode(PP_Instance instance,
PP_Resource encrypted_resource,
- int32_t request_id) {
+ const PP_EncryptedBlockInfo* encrypted_block_info) {
void* object =
Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface);
if (!object)
@@ -113,7 +122,7 @@ PP_Bool DecryptAndDecode(PP_Instance instance,
return PP_FromBool(
static_cast<ContentDecryptor_Private*>(object)->DecryptAndDecode(
encrypted_block,
- request_id));
+ *encrypted_block_info));
}
const PPP_ContentDecryptor_Private ppp_content_decryptor = {
@@ -151,8 +160,6 @@ void ContentDecryptor_Private::NeedKey(const std::string& key_system,
pp::Var key_system_var(key_system);
pp::Var session_id_var(session_id);
- // TODO(tomfinegan): Host to plugin stuff needed for init_data?
-
get_interface<PPB_ContentDecryptor_Private>()->NeedKey(
associated_instance_.pp_instance(),
key_system_var.pp_var(),
@@ -206,33 +213,36 @@ void ContentDecryptor_Private::KeyError(const std::string& key_system,
}
}
-void ContentDecryptor_Private::DeliverBlock(pp::Buffer_Dev decrypted_block,
- int32_t request_id) {
+void ContentDecryptor_Private::DeliverBlock(
+ pp::Buffer_Dev decrypted_block,
+ const PP_DecryptedBlockInfo& decrypted_block_info) {
if (has_interface<PPB_ContentDecryptor_Private>()) {
get_interface<PPB_ContentDecryptor_Private>()->DeliverBlock(
associated_instance_.pp_instance(),
decrypted_block.pp_resource(),
- request_id);
+ &decrypted_block_info);
}
}
-void ContentDecryptor_Private::DeliverFrame(pp::Buffer_Dev decrypted_frame,
- int32_t request_id) {
+void ContentDecryptor_Private::DeliverFrame(
+ pp::Buffer_Dev decrypted_frame,
+ const PP_DecryptedBlockInfo& decrypted_block_info) {
if (has_interface<PPB_ContentDecryptor_Private>()) {
get_interface<PPB_ContentDecryptor_Private>()->DeliverFrame(
associated_instance_.pp_instance(),
decrypted_frame.pp_resource(),
- request_id);
+ &decrypted_block_info);
}
}
-void ContentDecryptor_Private::DeliverSamples(pp::Buffer_Dev decrypted_samples,
- int32_t request_id) {
+void ContentDecryptor_Private::DeliverSamples(
+ pp::Buffer_Dev decrypted_samples,
+ const PP_DecryptedBlockInfo& decrypted_block_info) {
if (has_interface<PPB_ContentDecryptor_Private>()) {
get_interface<PPB_ContentDecryptor_Private>()->DeliverSamples(
associated_instance_.pp_instance(),
decrypted_samples.pp_resource(),
- request_id);
+ &decrypted_block_info);
}
}
« no previous file with comments | « ppapi/cpp/private/content_decryptor_private.h ('k') | ppapi/proxy/content_decryptor_private_serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698