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

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: Fix yet another link error, and rebase once again. 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/proxy/ppb_instance_proxy.h ('k') | ppapi/proxy/ppp_content_decryptor_private_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..698c0012c8e6b2f358726f3331fe8e1fe271f0cd 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -136,6 +136,7 @@ bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnHostMsgCancelCompositionText)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_UpdateSurroundingText,
OnHostMsgUpdateSurroundingText)
+
#if !defined(OS_NACL)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ResolveRelativeToDocument,
OnHostMsgResolveRelativeToDocument)
@@ -147,6 +148,20 @@ bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnHostMsgGetDocumentURL)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginInstanceURL,
OnHostMsgGetPluginInstanceURL)
+ 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)
#endif // !defined(OS_NACL)
// Host -> Plugin messages.
@@ -397,6 +412,108 @@ PP_Var PPB_Instance_Proxy::GetPluginInstanceURL(
result.Return(dispatcher()),
components);
}
+
+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));
+}
+
#endif // !defined(OS_NACL)
void PPB_Instance_Proxy::PostMessage(PP_Instance instance,
@@ -730,6 +847,88 @@ void PPB_Instance_Proxy::OnHostMsgGetPluginInstanceURL(
enter.functions()->GetPluginInstanceURL(instance, NULL));
}
}
+
+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);
+}
+
#endif // !defined(OS_NACL)
void PPB_Instance_Proxy::OnHostMsgSetCursor(
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.h ('k') | ppapi/proxy/ppp_content_decryptor_private_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698