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

Unified Diff: ppapi/proxy/ppp_content_decryptor_private_proxy.cc

Issue 24192004: Changes to the EME Pepper API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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: ppapi/proxy/ppp_content_decryptor_private_proxy.cc
diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc
index f986e7f8d7214dbbb3efbaa9a3751bef30be2ad0..a35f5034d7232b519d63d7cb334f0690e0597b21 100644
--- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc
+++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc
@@ -109,8 +109,24 @@ bool InitializePppDecryptorBuffer(PP_Instance instance,
return true;
}
+void Initialize(PP_Instance instance,
+ PP_Var key_system,
+ PP_Bool can_challenge_platform) {
+ HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
+ if (!dispatcher) {
+ NOTREACHED();
+ return;
+ }
+
+ dispatcher->Send(
+ new PpapiMsg_PPPContentDecryptor_Initialize(
+ API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE,
+ instance,
+ SerializedVarSendInput(dispatcher, key_system),
+ can_challenge_platform));
dmichael (off chromium) 2013/09/19 16:04:20 PP_ToBool?
jrummell 2013/09/19 18:15:15 Done.
+}
+
void GenerateKeyRequest(PP_Instance instance,
- PP_Var key_system,
PP_Var type,
PP_Var init_data) {
HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
@@ -123,7 +139,6 @@ void GenerateKeyRequest(PP_Instance instance,
new PpapiMsg_PPPContentDecryptor_GenerateKeyRequest(
API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE,
instance,
- SerializedVarSendInput(dispatcher, key_system),
SerializedVarSendInput(dispatcher, type),
SerializedVarSendInput(dispatcher, init_data)));
}
@@ -349,6 +364,7 @@ void DecryptAndDecode(PP_Instance instance,
}
static const PPP_ContentDecryptor_Private content_decryptor_interface = {
+ &Initialize,
&GenerateKeyRequest,
&AddKey,
&CancelKeyRequest,
@@ -390,6 +406,8 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived(
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PPP_ContentDecryptor_Private_Proxy, msg)
+ IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Initialize,
+ OnMsgInitialize)
IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_GenerateKeyRequest,
OnMsgGenerateKeyRequest)
IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_AddKey,
@@ -414,15 +432,26 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived(
return handled;
}
-void PPP_ContentDecryptor_Private_Proxy::OnMsgGenerateKeyRequest(
+void PPP_ContentDecryptor_Private_Proxy::OnMsgInitialize(
PP_Instance instance,
SerializedVarReceiveInput key_system,
+ const bool can_challenge_platform) {
+ if (ppp_decryptor_impl_) {
+ CallWhileUnlocked(
+ ppp_decryptor_impl_->Initialize,
+ instance,
+ ExtractReceivedVarAndAddRef(dispatcher(), &key_system),
+ PP_FromBool(can_challenge_platform));
+ }
+}
+
+void PPP_ContentDecryptor_Private_Proxy::OnMsgGenerateKeyRequest(
+ PP_Instance instance,
SerializedVarReceiveInput type,
SerializedVarReceiveInput init_data) {
if (ppp_decryptor_impl_) {
CallWhileUnlocked(ppp_decryptor_impl_->GenerateKeyRequest,
instance,
- ExtractReceivedVarAndAddRef(dispatcher(), &key_system),
ExtractReceivedVarAndAddRef(dispatcher(), &type),
ExtractReceivedVarAndAddRef(dispatcher(), &init_data));
}

Powered by Google App Engine
This is Rietveld 408576698