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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 10827280: Add PPAPI decryptor implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Partially address xhwang's comments, and fix some StringVar crashiness 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
Index: ppapi/proxy/ppb_instance_proxy.cc
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index ea974ef29db254c7426ca35a6f99d264e49bf7f0..f60748a4f480e36231a7ae19ea33ca6d319feabb 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -136,6 +136,21 @@ bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnHostMsgCancelCompositionText)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_UpdateSurroundingText,
OnHostMsgUpdateSurroundingText)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_NeedKey,
+ OnHostMsgNeedKey)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyAdded,
+ OnHostMsgKeyAdded)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyMessage,
+ OnHostMsgKeyMessage)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyError,
+ OnHostMsgKeyError)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock,
+ OnHostMsgDeliverBlock)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverFrame,
+ OnHostMsgDeliverFrame)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverSamples,
+ OnHostMsgDeliverSamples)
+
#if !defined(OS_NACL)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ResolveRelativeToDocument,
OnHostMsgResolveRelativeToDocument)
@@ -530,6 +545,108 @@ void PPB_Instance_Proxy::OnHostMsgGetOwnerElementObject(
}
}
+void PPB_Instance_Proxy::NeedKey(PP_Instance instance,
+ PP_Var key_system,
+ PP_Var session_id,
+ PP_Var init_data) {
+ dispatcher()->Send(
+ new PpapiHostMsg_PPBInstance_NeedKey(
+ API_ID_PPB_INSTANCE,
+ instance,
+ SerializedVarSendInput(dispatcher(), key_system),
+ SerializedVarSendInput(dispatcher(), session_id),
+ SerializedVarSendInput(dispatcher(), init_data)));
+}
+
+void PPB_Instance_Proxy::KeyAdded(PP_Instance instance,
+ PP_Var key_system,
+ PP_Var session_id) {
+ dispatcher()->Send(
+ new PpapiHostMsg_PPBInstance_KeyAdded(
+ API_ID_PPB_INSTANCE,
+ instance,
+ SerializedVarSendInput(dispatcher(), key_system),
+ SerializedVarSendInput(dispatcher(), session_id)));
+}
+
+void PPB_Instance_Proxy::KeyMessage(PP_Instance instance,
+ PP_Var key_system,
+ PP_Var session_id,
+ PP_Resource message,
+ PP_Var default_url) {
+ Resource* object =
+ PpapiGlobals::Get()->GetResourceTracker()->GetResource(message);
+ if (!object || object->pp_instance() != instance)
+ return;
+ dispatcher()->Send(
+ new PpapiHostMsg_PPBInstance_KeyMessage(
+ API_ID_PPB_INSTANCE,
+ instance,
+ SerializedVarSendInput(dispatcher(), key_system),
+ SerializedVarSendInput(dispatcher(), session_id),
+ object->host_resource().host_resource(),
+ SerializedVarSendInput(dispatcher(), default_url)));
+}
+
+void PPB_Instance_Proxy::KeyError(PP_Instance instance,
+ PP_Var key_system,
+ PP_Var session_id,
+ int32_t media_error,
+ int32_t system_code) {
+ dispatcher()->Send(
+ new PpapiHostMsg_PPBInstance_KeyError(
+ API_ID_PPB_INSTANCE,
+ instance,
+ SerializedVarSendInput(dispatcher(), key_system),
+ SerializedVarSendInput(dispatcher(), session_id),
+ media_error,
+ system_code));
+}
+
+void PPB_Instance_Proxy::DeliverBlock(PP_Instance instance,
+ PP_Resource decrypted_block,
+ int32_t request_id) {
+ Resource* object =
+ PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_block);
+ if (!object || object->pp_instance() != instance)
+ return;
+ dispatcher()->Send(
+ new PpapiHostMsg_PPBInstance_DeliverBlock(API_ID_PPB_INSTANCE,
+ instance,
+ object->host_resource().host_resource(),
+ request_id));
+}
+
+void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance,
+ PP_Resource decrypted_frame,
+ int32_t request_id) {
+ Resource* object =
+ PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame);
+ if (!object || object->pp_instance() != instance)
+ return;
+ dispatcher()->Send(new PpapiHostMsg_PPBInstance_DeliverFrame(
+ API_ID_PPB_INSTANCE,
+ instance,
+ object->host_resource().host_resource(),
+ request_id));
+}
+
+void PPB_Instance_Proxy::DeliverSamples(PP_Instance instance,
+ PP_Resource decrypted_samples,
+ int32_t request_id) {
+ Resource* object =
+ PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_samples);
+ if (!object || object->pp_instance() != instance)
+ return;
+ dispatcher()->Send(
+ new PpapiHostMsg_PPBInstance_DeliverSamples(
+ API_ID_PPB_INSTANCE,
+ instance,
+ object->host_resource().host_resource(),
+ request_id));
+}
+
+
void PPB_Instance_Proxy::OnHostMsgBindGraphics(PP_Instance instance,
const HostResource& device,
PP_Bool* result) {
@@ -779,6 +896,87 @@ void PPB_Instance_Proxy::OnHostMsgUpdateSurroundingText(
}
}
+void PPB_Instance_Proxy::OnHostMsgNeedKey(PP_Instance instance,
+ SerializedVarReceiveInput key_system,
+ SerializedVarReceiveInput session_id,
+ SerializedVarReceiveInput init_data) {
+ EnterInstanceNoLock enter(instance);
+ if (enter.succeeded()) {
+ enter.functions()->NeedKey(instance,
+ key_system.Get(dispatcher()),
+ session_id.Get(dispatcher()),
+ init_data.Get(dispatcher()));
+ }
+}
+
+void PPB_Instance_Proxy::OnHostMsgKeyAdded(
+ PP_Instance instance,
+ SerializedVarReceiveInput key_system,
+ SerializedVarReceiveInput session_id) {
+ EnterInstanceNoLock enter(instance);
+ if (enter.succeeded()) {
+ enter.functions()->KeyAdded(instance,
+ key_system.Get(dispatcher()),
+ session_id.Get(dispatcher()));
+ }
+}
+
+void PPB_Instance_Proxy::OnHostMsgKeyMessage(
+ PP_Instance instance,
+ SerializedVarReceiveInput key_system,
+ SerializedVarReceiveInput session_id,
+ PP_Resource message,
+ SerializedVarReceiveInput default_url) {
+ EnterInstanceNoLock enter(instance);
+ if (enter.succeeded()) {
+ enter.functions()->KeyMessage(instance,
+ key_system.Get(dispatcher()),
+ session_id.Get(dispatcher()),
+ message,
+ default_url.Get(dispatcher()));
+ }
+}
+
+void PPB_Instance_Proxy::OnHostMsgKeyError(
+ PP_Instance instance,
+ SerializedVarReceiveInput key_system,
+ SerializedVarReceiveInput session_id,
+ int32_t media_error,
+ int32_t system_error) {
+ EnterInstanceNoLock enter(instance);
+ if (enter.succeeded()) {
+ enter.functions()->KeyError(instance,
+ key_system.Get(dispatcher()),
+ session_id.Get(dispatcher()),
+ media_error,
+ system_error);
+ }
+}
+
+void PPB_Instance_Proxy::OnHostMsgDeliverBlock(PP_Instance instance,
+ PP_Resource decrypted_block,
+ int32_t request_id) {
+ EnterInstanceNoLock enter(instance);
+ if (enter.succeeded())
+ enter.functions()->DeliverBlock(instance, decrypted_block, request_id);
+}
+
+void PPB_Instance_Proxy::OnHostMsgDeliverFrame(PP_Instance instance,
+ PP_Resource decrypted_frame,
+ int32_t request_id) {
+ EnterInstanceNoLock enter(instance);
+ if (enter.succeeded())
+ enter.functions()->DeliverFrame(instance, decrypted_frame, request_id);
+}
+
+void PPB_Instance_Proxy::OnHostMsgDeliverSamples(PP_Instance instance,
+ PP_Resource decrypted_samples,
+ int32_t request_id) {
+ EnterInstanceNoLock enter(instance);
+ if (enter.succeeded())
+ enter.functions()->DeliverSamples(instance, decrypted_samples, request_id);
+}
+
void PPB_Instance_Proxy::OnPluginMsgMouseLockComplete(PP_Instance instance,
int32_t result) {
// Save the mouse callback on the instance data.

Powered by Google App Engine
This is Rietveld 408576698