Chromium Code Reviews| 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 eee3871b5098d01643d8c19999aeb6d6db9ee52f..58bb07642170d58c2dbfc1d9106467536da5e9d0 100644 |
| --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc |
| +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc |
| @@ -124,6 +124,22 @@ void Initialize(PP_Instance instance, |
| SerializedVarSendInput(dispatcher, key_system))); |
| } |
| +void SetServerCertificate(PP_Instance instance, |
| + uint32_t promise_id, |
| + PP_Var server_certificate) { |
| + HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| + if (!dispatcher) { |
| + NOTREACHED(); |
| + return; |
| + } |
| + |
| + dispatcher->Send(new PpapiMsg_PPPContentDecryptor_SetServerCertificate( |
| + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| + instance, |
| + promise_id, |
| + SerializedVarSendInput(dispatcher, server_certificate))); |
| +} |
| + |
| void CreateSession(PP_Instance instance, |
| uint32_t promise_id, |
| PP_Var init_data_type, |
| @@ -178,16 +194,48 @@ void UpdateSession(PP_Instance instance, |
| SerializedVarSendInput(dispatcher, response))); |
| } |
| -void ReleaseSession(PP_Instance instance, |
| - uint32_t promise_id, |
| - PP_Var web_session_id) { |
| +void GetUsableKeyIds(PP_Instance instance, |
| + uint32_t promise_id, |
| + PP_Var web_session_id) { |
| + HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| + if (!dispatcher) { |
| + NOTREACHED(); |
| + return; |
| + } |
| + |
| + dispatcher->Send(new PpapiMsg_PPPContentDecryptor_GetUsableKeyIds( |
| + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| + instance, |
| + promise_id, |
| + SerializedVarSendInput(dispatcher, web_session_id))); |
| +} |
| + |
| +void CloseSession(PP_Instance instance, |
| + uint32_t promise_id, |
| + PP_Var web_session_id) { |
| HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| if (!dispatcher) { |
| NOTREACHED(); |
| return; |
| } |
| - dispatcher->Send(new PpapiMsg_PPPContentDecryptor_ReleaseSession( |
| + dispatcher->Send(new PpapiMsg_PPPContentDecryptor_CloseSession( |
| + API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| + instance, |
| + promise_id, |
| + SerializedVarSendInput(dispatcher, web_session_id))); |
| +} |
| + |
| +void RemoveSession(PP_Instance instance, |
| + uint32_t promise_id, |
| + PP_Var web_session_id) { |
| + HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| + if (!dispatcher) { |
| + NOTREACHED(); |
| + return; |
| + } |
| + |
| + dispatcher->Send(new PpapiMsg_PPPContentDecryptor_RemoveSession( |
| API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| instance, |
| promise_id, |
| @@ -382,18 +430,20 @@ void DecryptAndDecode(PP_Instance instance, |
| } |
| static const PPP_ContentDecryptor_Private content_decryptor_interface = { |
| - &Initialize, |
| - &CreateSession, |
| - &LoadSession, |
| - &UpdateSession, |
| - &ReleaseSession, |
| - &Decrypt, |
| - &InitializeAudioDecoder, |
| - &InitializeVideoDecoder, |
| - &DeinitializeDecoder, |
| - &ResetDecoder, |
| - &DecryptAndDecode |
| -}; |
| + &Initialize, |
| + &SetServerCertificate, |
| + &CreateSession, |
| + &LoadSession, |
| + &UpdateSession, |
| + &GetUsableKeyIds, |
|
ddorwin
2014/08/22 20:49:21
ditto
jrummell
2014/08/25 21:54:37
Done.
|
| + &CloseSession, |
| + &RemoveSession, |
| + &Decrypt, |
| + &InitializeAudioDecoder, |
| + &InitializeVideoDecoder, |
| + &DeinitializeDecoder, |
| + &ResetDecoder, |
| + &DecryptAndDecode}; |
| } // namespace |
| @@ -427,14 +477,20 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived( |
| IPC_BEGIN_MESSAGE_MAP(PPP_ContentDecryptor_Private_Proxy, msg) |
| IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Initialize, |
| OnMsgInitialize) |
| + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_SetServerCertificate, |
| + OnMsgSetServerCertificate) |
| IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_CreateSession, |
| OnMsgCreateSession) |
| IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_LoadSession, |
| OnMsgLoadSession) |
| IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_UpdateSession, |
| OnMsgUpdateSession) |
| - IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_ReleaseSession, |
| - OnMsgReleaseSession) |
| + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_GetUsableKeyIds, |
| + OnMsgGetUsableKeyIds) |
| + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_CloseSession, |
| + OnMsgCloseSession) |
| + IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_RemoveSession, |
| + OnMsgRemoveSession) |
| IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Decrypt, |
| OnMsgDecrypt) |
| IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_InitializeAudioDecoder, |
| @@ -464,6 +520,19 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgInitialize( |
| } |
| } |
| +void PPP_ContentDecryptor_Private_Proxy::OnMsgSetServerCertificate( |
| + PP_Instance instance, |
| + uint32_t promise_id, |
| + SerializedVarReceiveInput server_certificate) { |
| + if (ppp_decryptor_impl_) { |
| + CallWhileUnlocked( |
| + ppp_decryptor_impl_->SetServerCertificate, |
| + instance, |
| + promise_id, |
| + ExtractReceivedVarAndAddRef(dispatcher(), &server_certificate)); |
| + } |
| +} |
| + |
| void PPP_ContentDecryptor_Private_Proxy::OnMsgCreateSession( |
| PP_Instance instance, |
| uint32_t promise_id, |
| @@ -509,13 +578,39 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgUpdateSession( |
| } |
| } |
| -void PPP_ContentDecryptor_Private_Proxy::OnMsgReleaseSession( |
| +void PPP_ContentDecryptor_Private_Proxy::OnMsgGetUsableKeyIds( |
| + PP_Instance instance, |
| + uint32_t promise_id, |
| + SerializedVarReceiveInput web_session_id) { |
| + if (ppp_decryptor_impl_) { |
| + CallWhileUnlocked( |
| + ppp_decryptor_impl_->GetUsableKeyIds, |
| + instance, |
| + promise_id, |
| + ExtractReceivedVarAndAddRef(dispatcher(), &web_session_id)); |
| + } |
| +} |
| + |
| +void PPP_ContentDecryptor_Private_Proxy::OnMsgCloseSession( |
| + PP_Instance instance, |
| + uint32_t promise_id, |
| + SerializedVarReceiveInput web_session_id) { |
| + if (ppp_decryptor_impl_) { |
| + CallWhileUnlocked( |
| + ppp_decryptor_impl_->CloseSession, |
| + instance, |
| + promise_id, |
| + ExtractReceivedVarAndAddRef(dispatcher(), &web_session_id)); |
| + } |
| +} |
| + |
| +void PPP_ContentDecryptor_Private_Proxy::OnMsgRemoveSession( |
| PP_Instance instance, |
| uint32_t promise_id, |
| SerializedVarReceiveInput web_session_id) { |
| if (ppp_decryptor_impl_) { |
| CallWhileUnlocked( |
| - ppp_decryptor_impl_->ReleaseSession, |
| + ppp_decryptor_impl_->RemoveSession, |
| instance, |
| promise_id, |
| ExtractReceivedVarAndAddRef(dispatcher(), &web_session_id)); |