summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authortomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-12 05:25:00 +0000
committertomfinegan@chromium.org <tomfinegan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-12 05:25:00 +0000
commita6e4fbfd6c6848be53e04bcd11b097df8399064d (patch)
tree5d2b2b23e3546d06a84aaf05a77492c469a00a6e /ppapi
parent0d2bd8b4c40f047a5c7e8163efd5ca87a9c34094 (diff)
downloadchromium_src-a6e4fbfd6c6848be53e04bcd11b097df8399064d.zip
chromium_src-a6e4fbfd6c6848be53e04bcd11b097df8399064d.tar.gz
chromium_src-a6e4fbfd6c6848be53e04bcd11b097df8399064d.tar.bz2
Change PPB_ContentDecryptor_Private::KeyMessage to pass the message as a PP_Var instead of a PP_Resource.
BUG=164498 TEST=EME decrypt and decode continues to work. Review URL: https://chromiumcodereview.appspot.com/11442029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172534 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/private/ppb_content_decryptor_private.idl9
-rw-r--r--ppapi/c/private/ppb_content_decryptor_private.h11
-rw-r--r--ppapi/cpp/private/content_decryptor_private.cc4
-rw-r--r--ppapi/cpp/private/content_decryptor_private.h5
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c4
-rw-r--r--ppapi/proxy/ppapi_messages.h2
-rw-r--r--ppapi/proxy/ppb_instance_proxy.cc17
-rw-r--r--ppapi/proxy/ppb_instance_proxy.h4
-rw-r--r--ppapi/thunk/ppb_content_decryptor_private_thunk.cc2
-rw-r--r--ppapi/thunk/ppb_instance_api.h2
10 files changed, 26 insertions, 34 deletions
diff --git a/ppapi/api/private/ppb_content_decryptor_private.idl b/ppapi/api/private/ppb_content_decryptor_private.idl
index 6b3dc85..36dbb53 100644
--- a/ppapi/api/private/ppb_content_decryptor_private.idl
+++ b/ppapi/api/private/ppb_content_decryptor_private.idl
@@ -40,7 +40,7 @@ interface PPB_ContentDecryptor_Private {
* <code>PP_VARTYPE_STRING</code> containing the session ID.
*
* @param[in] init_data A <code>PP_Var</code> of type
- * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container-specific
+ * <code>PP_VARTYPE_ARRAY_BUFFER</code> containing container-specific
* initialization data.
*/
void NeedKey(
@@ -93,9 +93,8 @@ interface PPB_ContentDecryptor_Private {
* @param[in] session_id A <code>PP_Var</code> of type
* <code>PP_VARTYPE_STRING</code> containing the session ID.
*
- * @param[in] resource A <code>PP_Resource</code> corresponding to a
- * <code>PPB_Buffer_Dev</code> resource that contains the message. A 0
- * resource is allowed which indicates an empty message.
+ * @param[in] message A <code>PP_Var</code> of type
+ * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the message.
*
* @param[in] default_url A <code>PP_Var</code> of type
* <code>PP_VARTYPE_STRING</code> containing the default URL for the message.
@@ -104,7 +103,7 @@ interface PPB_ContentDecryptor_Private {
[in] PP_Instance instance,
[in] PP_Var key_system,
[in] PP_Var session_id,
- [in] PP_Resource message,
+ [in] PP_Var message,
[in] PP_Var default_url);
/**
diff --git a/ppapi/c/private/ppb_content_decryptor_private.h b/ppapi/c/private/ppb_content_decryptor_private.h
index 9120984..984c6c1 100644
--- a/ppapi/c/private/ppb_content_decryptor_private.h
+++ b/ppapi/c/private/ppb_content_decryptor_private.h
@@ -4,7 +4,7 @@
*/
/* From private/ppb_content_decryptor_private.idl,
- * modified Mon Dec 10 13:46:33 2012.
+ * modified Mon Dec 10 21:43:51 2012.
*/
#ifndef PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_
@@ -63,7 +63,7 @@ struct PPB_ContentDecryptor_Private_0_6 {
* <code>PP_VARTYPE_STRING</code> containing the session ID.
*
* @param[in] init_data A <code>PP_Var</code> of type
- * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container-specific
+ * <code>PP_VARTYPE_ARRAY_BUFFER</code> containing container-specific
* initialization data.
*/
void (*NeedKey)(PP_Instance instance,
@@ -112,9 +112,8 @@ struct PPB_ContentDecryptor_Private_0_6 {
* @param[in] session_id A <code>PP_Var</code> of type
* <code>PP_VARTYPE_STRING</code> containing the session ID.
*
- * @param[in] resource A <code>PP_Resource</code> corresponding to a
- * <code>PPB_Buffer_Dev</code> resource that contains the message. A 0
- * resource is allowed which indicates an empty message.
+ * @param[in] message A <code>PP_Var</code> of type
+ * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the message.
*
* @param[in] default_url A <code>PP_Var</code> of type
* <code>PP_VARTYPE_STRING</code> containing the default URL for the message.
@@ -122,7 +121,7 @@ struct PPB_ContentDecryptor_Private_0_6 {
void (*KeyMessage)(PP_Instance instance,
struct PP_Var key_system,
struct PP_Var session_id,
- PP_Resource message,
+ struct PP_Var message,
struct PP_Var default_url);
/**
* An error occurred in a <code>PPP_ContentDecryptor_Private</code> method,
diff --git a/ppapi/cpp/private/content_decryptor_private.cc b/ppapi/cpp/private/content_decryptor_private.cc
index d15f0bd..de9391b 100644
--- a/ppapi/cpp/private/content_decryptor_private.cc
+++ b/ppapi/cpp/private/content_decryptor_private.cc
@@ -244,7 +244,7 @@ void ContentDecryptor_Private::KeyAdded(const std::string& key_system,
void ContentDecryptor_Private::KeyMessage(const std::string& key_system,
const std::string& session_id,
- pp::Buffer_Dev message,
+ pp::VarArrayBuffer message,
const std::string& default_url) {
if (has_interface<PPB_ContentDecryptor_Private>()) {
pp::Var key_system_var(key_system);
@@ -254,7 +254,7 @@ void ContentDecryptor_Private::KeyMessage(const std::string& key_system,
associated_instance_.pp_instance(),
key_system_var.pp_var(),
session_id_var.pp_var(),
- message.pp_resource(),
+ message.pp_var(),
default_url_var.pp_var());
}
}
diff --git a/ppapi/cpp/private/content_decryptor_private.h b/ppapi/cpp/private/content_decryptor_private.h
index 4e93657..477c6de 100644
--- a/ppapi/cpp/private/content_decryptor_private.h
+++ b/ppapi/cpp/private/content_decryptor_private.h
@@ -18,6 +18,9 @@ namespace pp {
class Instance;
+// TODO(tomfinegan): Remove redundant pp:: usage, and pass VarArrayBuffers as
+// const references.
+
class ContentDecryptor_Private {
public:
explicit ContentDecryptor_Private(Instance* instance);
@@ -62,7 +65,7 @@ class ContentDecryptor_Private {
const std::string& session_id);
void KeyMessage(const std::string& key_system,
const std::string& session_id,
- pp::Buffer_Dev message,
+ pp::VarArrayBuffer message,
const std::string& default_url);
void KeyError(const std::string& key_system,
const std::string& session_id,
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index 6d3e61d..3201d01 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -2243,7 +2243,7 @@ void Pnacl_M24_PPB_ContentDecryptor_Private_KeyAdded(PP_Instance instance, struc
}
static __attribute__((pnaclcall))
-void Pnacl_M24_PPB_ContentDecryptor_Private_KeyMessage(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, PP_Resource message, struct PP_Var default_url) {
+void Pnacl_M24_PPB_ContentDecryptor_Private_KeyMessage(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, struct PP_Var message, struct PP_Var default_url) {
const struct PPB_ContentDecryptor_Private_0_6 *iface = Pnacl_WrapperInfo_PPB_ContentDecryptor_Private_0_6.real_iface;
iface->KeyMessage(instance, key_system, session_id, message, default_url);
}
@@ -4027,7 +4027,7 @@ struct PPP_Selection_Dev_0_3 Pnacl_Wrappers_PPP_Selection_Dev_0_3 = {
struct PPB_ContentDecryptor_Private_0_6 Pnacl_Wrappers_PPB_ContentDecryptor_Private_0_6 = {
.NeedKey = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, struct PP_Var init_data))&Pnacl_M24_PPB_ContentDecryptor_Private_NeedKey,
.KeyAdded = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id))&Pnacl_M24_PPB_ContentDecryptor_Private_KeyAdded,
- .KeyMessage = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, PP_Resource message, struct PP_Var default_url))&Pnacl_M24_PPB_ContentDecryptor_Private_KeyMessage,
+ .KeyMessage = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, struct PP_Var message, struct PP_Var default_url))&Pnacl_M24_PPB_ContentDecryptor_Private_KeyMessage,
.KeyError = (void (*)(PP_Instance instance, struct PP_Var key_system, struct PP_Var session_id, int32_t media_error, int32_t system_code))&Pnacl_M24_PPB_ContentDecryptor_Private_KeyError,
.DeliverBlock = (void (*)(PP_Instance instance, PP_Resource decrypted_block, const struct PP_DecryptedBlockInfo* decrypted_block_info))&Pnacl_M24_PPB_ContentDecryptor_Private_DeliverBlock,
.DecoderInitializeDone = (void (*)(PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, PP_Bool success))&Pnacl_M24_PPB_ContentDecryptor_Private_DecoderInitializeDone,
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 62e2116..87f369d 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -1152,7 +1152,7 @@ IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_KeyMessage,
PP_Instance /* instance */,
ppapi::proxy::SerializedVar /* key_system, String */,
ppapi::proxy::SerializedVar /* session_id, String */,
- PP_Resource /* message, PPB_Buffer_Dev */,
+ ppapi::proxy::SerializedVar /* message, ArrayBuffer */,
ppapi::proxy::SerializedVar /* default_url, String */)
IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_KeyError,
PP_Instance /* instance */,
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index 3fb3e18..f4b0f35 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -543,24 +543,15 @@ void PPB_Instance_Proxy::KeyAdded(PP_Instance instance,
void PPB_Instance_Proxy::KeyMessage(PP_Instance instance,
PP_Var key_system,
PP_Var session_id,
- PP_Resource message,
+ PP_Var message,
PP_Var default_url) {
- PP_Resource host_resource = 0;
- if (message) {
- Resource* object =
- PpapiGlobals::Get()->GetResourceTracker()->GetResource(message);
- if (!object || object->pp_instance() != instance)
- return;
- host_resource = object->host_resource().host_resource();
- }
-
dispatcher()->Send(
new PpapiHostMsg_PPBInstance_KeyMessage(
API_ID_PPB_INSTANCE,
instance,
SerializedVarSendInput(dispatcher(), key_system),
SerializedVarSendInput(dispatcher(), session_id),
- host_resource,
+ SerializedVarSendInput(dispatcher(), message),
SerializedVarSendInput(dispatcher(), default_url)));
}
@@ -1062,7 +1053,7 @@ void PPB_Instance_Proxy::OnHostMsgKeyMessage(
PP_Instance instance,
SerializedVarReceiveInput key_system,
SerializedVarReceiveInput session_id,
- PP_Resource message,
+ SerializedVarReceiveInput message,
SerializedVarReceiveInput default_url) {
if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE))
return;
@@ -1071,7 +1062,7 @@ void PPB_Instance_Proxy::OnHostMsgKeyMessage(
enter.functions()->KeyMessage(instance,
key_system.Get(dispatcher()),
session_id.Get(dispatcher()),
- message,
+ message.Get(dispatcher()),
default_url.Get(dispatcher()));
}
}
diff --git a/ppapi/proxy/ppb_instance_proxy.h b/ppapi/proxy/ppb_instance_proxy.h
index ffd17cc..af52ed9 100644
--- a/ppapi/proxy/ppb_instance_proxy.h
+++ b/ppapi/proxy/ppb_instance_proxy.h
@@ -128,7 +128,7 @@ class PPB_Instance_Proxy : public InterfaceProxy,
virtual void KeyMessage(PP_Instance instance,
PP_Var key_system,
PP_Var session_id,
- PP_Resource message,
+ PP_Var message,
PP_Var default_url) OVERRIDE;
virtual void KeyError(PP_Instance instance,
PP_Var key_system,
@@ -234,7 +234,7 @@ class PPB_Instance_Proxy : public InterfaceProxy,
virtual void OnHostMsgKeyMessage(PP_Instance instance,
SerializedVarReceiveInput key_system,
SerializedVarReceiveInput session_id,
- PP_Resource message,
+ SerializedVarReceiveInput message,
SerializedVarReceiveInput default_url);
virtual void OnHostMsgKeyError(PP_Instance instance,
SerializedVarReceiveInput key_system,
diff --git a/ppapi/thunk/ppb_content_decryptor_private_thunk.cc b/ppapi/thunk/ppb_content_decryptor_private_thunk.cc
index 905d482..2c0d08a 100644
--- a/ppapi/thunk/ppb_content_decryptor_private_thunk.cc
+++ b/ppapi/thunk/ppb_content_decryptor_private_thunk.cc
@@ -32,7 +32,7 @@ void KeyAdded(PP_Instance instance,
void KeyMessage(PP_Instance instance,
PP_Var key_system,
PP_Var session_id,
- PP_Resource message,
+ PP_Var message,
PP_Var default_url) {
EnterInstance enter(instance);
if (enter.succeeded()) {
diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h
index cb52418..68f7a2b 100644
--- a/ppapi/thunk/ppb_instance_api.h
+++ b/ppapi/thunk/ppb_instance_api.h
@@ -160,7 +160,7 @@ class PPB_Instance_API {
virtual void KeyMessage(PP_Instance instance,
PP_Var key_system,
PP_Var session_id,
- PP_Resource message,
+ PP_Var message,
PP_Var default_url) = 0;
virtual void KeyError(PP_Instance instance,
PP_Var key_system,