| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/proxy/ppp_content_decryptor_private_proxy.h" | 5 #include "ppapi/proxy/ppp_content_decryptor_private_proxy.h" |
| 6 | 6 |
| 7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "media/base/limits.h" |
| 8 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/ppb_core.h" | 10 #include "ppapi/c/ppb_core.h" |
| 10 #include "ppapi/proxy/content_decryptor_private_serializer.h" | 11 #include "ppapi/proxy/content_decryptor_private_serializer.h" |
| 11 #include "ppapi/proxy/host_dispatcher.h" | 12 #include "ppapi/proxy/host_dispatcher.h" |
| 12 #include "ppapi/proxy/plugin_globals.h" | 13 #include "ppapi/proxy/plugin_globals.h" |
| 13 #include "ppapi/proxy/plugin_resource_tracker.h" | 14 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 14 #include "ppapi/proxy/ppapi_messages.h" | 15 #include "ppapi/proxy/ppapi_messages.h" |
| 15 #include "ppapi/proxy/ppb_buffer_proxy.h" | 16 #include "ppapi/proxy/ppb_buffer_proxy.h" |
| 16 #include "ppapi/proxy/serialized_var.h" | 17 #include "ppapi/proxy/serialized_var.h" |
| 17 #include "ppapi/shared_impl/scoped_pp_resource.h" | 18 #include "ppapi/shared_impl/scoped_pp_resource.h" |
| 19 #include "ppapi/shared_impl/scoped_pp_var.h" |
| 18 #include "ppapi/shared_impl/var_tracker.h" | 20 #include "ppapi/shared_impl/var_tracker.h" |
| 19 #include "ppapi/thunk/enter.h" | 21 #include "ppapi/thunk/enter.h" |
| 20 #include "ppapi/thunk/ppb_buffer_api.h" | 22 #include "ppapi/thunk/ppb_buffer_api.h" |
| 21 #include "ppapi/thunk/ppb_instance_api.h" | 23 #include "ppapi/thunk/ppb_instance_api.h" |
| 22 #include "ppapi/thunk/thunk.h" | 24 #include "ppapi/thunk/thunk.h" |
| 23 | 25 |
| 24 using ppapi::thunk::EnterResourceNoLock; | 26 using ppapi::thunk::EnterResourceNoLock; |
| 25 using ppapi::thunk::PPB_Buffer_API; | 27 using ppapi::thunk::PPB_Buffer_API; |
| 26 using ppapi::thunk::PPB_Instance_API; | 28 using ppapi::thunk::PPB_Instance_API; |
| 27 | 29 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return; | 119 return; |
| 118 } | 120 } |
| 119 | 121 |
| 120 dispatcher->Send( | 122 dispatcher->Send( |
| 121 new PpapiMsg_PPPContentDecryptor_Initialize( | 123 new PpapiMsg_PPPContentDecryptor_Initialize( |
| 122 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, | 124 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| 123 instance, | 125 instance, |
| 124 SerializedVarSendInput(dispatcher, key_system))); | 126 SerializedVarSendInput(dispatcher, key_system))); |
| 125 } | 127 } |
| 126 | 128 |
| 129 void SetServerCertificate(PP_Instance instance, |
| 130 uint32_t promise_id, |
| 131 PP_Var server_certificate) { |
| 132 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| 133 if (!dispatcher) { |
| 134 NOTREACHED(); |
| 135 return; |
| 136 } |
| 137 |
| 138 ArrayBufferVar* server_certificate_buffer = |
| 139 ArrayBufferVar::FromPPVar(server_certificate); |
| 140 if (!server_certificate_buffer || |
| 141 server_certificate_buffer->ByteLength() < |
| 142 media::limits::kMinCertificateLength || |
| 143 server_certificate_buffer->ByteLength() > |
| 144 media::limits::kMaxCertificateLength) { |
| 145 NOTREACHED(); |
| 146 return; |
| 147 } |
| 148 |
| 149 const uint8_t* server_certificate_ptr = |
| 150 static_cast<const uint8_t*>(server_certificate_buffer->Map()); |
| 151 const uint32_t server_certificate_size = |
| 152 server_certificate_buffer->ByteLength(); |
| 153 std::vector<uint8_t> server_certificate_vector( |
| 154 server_certificate_ptr, server_certificate_ptr + server_certificate_size); |
| 155 |
| 156 dispatcher->Send(new PpapiMsg_PPPContentDecryptor_SetServerCertificate( |
| 157 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| 158 instance, |
| 159 promise_id, |
| 160 server_certificate_vector)); |
| 161 } |
| 162 |
| 127 void CreateSession(PP_Instance instance, | 163 void CreateSession(PP_Instance instance, |
| 128 uint32_t promise_id, | 164 uint32_t promise_id, |
| 129 PP_Var init_data_type, | 165 PP_Var init_data_type, |
| 130 PP_Var init_data, | 166 PP_Var init_data, |
| 131 PP_SessionType session_type) { | 167 PP_SessionType session_type) { |
| 132 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); | 168 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| 133 if (!dispatcher) { | 169 if (!dispatcher) { |
| 134 NOTREACHED(); | 170 NOTREACHED(); |
| 135 return; | 171 return; |
| 136 } | 172 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 207 } |
| 172 | 208 |
| 173 dispatcher->Send(new PpapiMsg_PPPContentDecryptor_UpdateSession( | 209 dispatcher->Send(new PpapiMsg_PPPContentDecryptor_UpdateSession( |
| 174 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, | 210 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| 175 instance, | 211 instance, |
| 176 promise_id, | 212 promise_id, |
| 177 SerializedVarSendInput(dispatcher, web_session_id), | 213 SerializedVarSendInput(dispatcher, web_session_id), |
| 178 SerializedVarSendInput(dispatcher, response))); | 214 SerializedVarSendInput(dispatcher, response))); |
| 179 } | 215 } |
| 180 | 216 |
| 181 void ReleaseSession(PP_Instance instance, | 217 void CloseSession(PP_Instance instance, |
| 182 uint32_t promise_id, | 218 uint32_t promise_id, |
| 183 PP_Var web_session_id) { | 219 PP_Var web_session_id) { |
| 184 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); | 220 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| 185 if (!dispatcher) { | 221 if (!dispatcher) { |
| 186 NOTREACHED(); | 222 NOTREACHED(); |
| 187 return; | 223 return; |
| 188 } | 224 } |
| 189 | 225 |
| 190 dispatcher->Send(new PpapiMsg_PPPContentDecryptor_ReleaseSession( | 226 StringVar* session_id = StringVar::FromPPVar(web_session_id); |
| 227 if (!session_id || |
| 228 session_id->value().length() > media::limits::kMaxWebSessionIdLength) { |
| 229 NOTREACHED(); |
| 230 return; |
| 231 } |
| 232 |
| 233 dispatcher->Send(new PpapiMsg_PPPContentDecryptor_CloseSession( |
| 191 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, | 234 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| 192 instance, | 235 instance, |
| 193 promise_id, | 236 promise_id, |
| 194 SerializedVarSendInput(dispatcher, web_session_id))); | 237 session_id->value())); |
| 238 } |
| 239 |
| 240 void RemoveSession(PP_Instance instance, |
| 241 uint32_t promise_id, |
| 242 PP_Var web_session_id) { |
| 243 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| 244 if (!dispatcher) { |
| 245 NOTREACHED(); |
| 246 return; |
| 247 } |
| 248 |
| 249 StringVar* session_id = StringVar::FromPPVar(web_session_id); |
| 250 if (!session_id || |
| 251 session_id->value().length() > media::limits::kMaxWebSessionIdLength) { |
| 252 NOTREACHED(); |
| 253 return; |
| 254 } |
| 255 |
| 256 dispatcher->Send(new PpapiMsg_PPPContentDecryptor_RemoveSession( |
| 257 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| 258 instance, |
| 259 promise_id, |
| 260 session_id->value())); |
| 261 } |
| 262 |
| 263 void GetUsableKeyIds(PP_Instance instance, |
| 264 uint32_t promise_id, |
| 265 PP_Var web_session_id) { |
| 266 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| 267 if (!dispatcher) { |
| 268 NOTREACHED(); |
| 269 return; |
| 270 } |
| 271 |
| 272 StringVar* session_id = StringVar::FromPPVar(web_session_id); |
| 273 if (!session_id || |
| 274 session_id->value().length() > media::limits::kMaxWebSessionIdLength) { |
| 275 NOTREACHED(); |
| 276 return; |
| 277 } |
| 278 |
| 279 dispatcher->Send(new PpapiMsg_PPPContentDecryptor_GetUsableKeyIds( |
| 280 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| 281 instance, |
| 282 promise_id, |
| 283 session_id->value())); |
| 195 } | 284 } |
| 196 | 285 |
| 197 void Decrypt(PP_Instance instance, | 286 void Decrypt(PP_Instance instance, |
| 198 PP_Resource encrypted_block, | 287 PP_Resource encrypted_block, |
| 199 const PP_EncryptedBlockInfo* encrypted_block_info) { | 288 const PP_EncryptedBlockInfo* encrypted_block_info) { |
| 200 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); | 289 HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance); |
| 201 if (!dispatcher) { | 290 if (!dispatcher) { |
| 202 NOTREACHED(); | 291 NOTREACHED(); |
| 203 return; | 292 return; |
| 204 } | 293 } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 dispatcher->Send( | 464 dispatcher->Send( |
| 376 new PpapiMsg_PPPContentDecryptor_DecryptAndDecode( | 465 new PpapiMsg_PPPContentDecryptor_DecryptAndDecode( |
| 377 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, | 466 API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE, |
| 378 instance, | 467 instance, |
| 379 decoder_type, | 468 decoder_type, |
| 380 buffer, | 469 buffer, |
| 381 serialized_block_info)); | 470 serialized_block_info)); |
| 382 } | 471 } |
| 383 | 472 |
| 384 static const PPP_ContentDecryptor_Private content_decryptor_interface = { | 473 static const PPP_ContentDecryptor_Private content_decryptor_interface = { |
| 385 &Initialize, | 474 &Initialize, |
| 386 &CreateSession, | 475 &SetServerCertificate, |
| 387 &LoadSession, | 476 &CreateSession, |
| 388 &UpdateSession, | 477 &LoadSession, |
| 389 &ReleaseSession, | 478 &UpdateSession, |
| 390 &Decrypt, | 479 &CloseSession, |
| 391 &InitializeAudioDecoder, | 480 &RemoveSession, |
| 392 &InitializeVideoDecoder, | 481 &GetUsableKeyIds, |
| 393 &DeinitializeDecoder, | 482 &Decrypt, |
| 394 &ResetDecoder, | 483 &InitializeAudioDecoder, |
| 395 &DecryptAndDecode | 484 &InitializeVideoDecoder, |
| 396 }; | 485 &DeinitializeDecoder, |
| 486 &ResetDecoder, |
| 487 &DecryptAndDecode}; |
| 397 | 488 |
| 398 } // namespace | 489 } // namespace |
| 399 | 490 |
| 400 PPP_ContentDecryptor_Private_Proxy::PPP_ContentDecryptor_Private_Proxy( | 491 PPP_ContentDecryptor_Private_Proxy::PPP_ContentDecryptor_Private_Proxy( |
| 401 Dispatcher* dispatcher) | 492 Dispatcher* dispatcher) |
| 402 : InterfaceProxy(dispatcher), | 493 : InterfaceProxy(dispatcher), |
| 403 ppp_decryptor_impl_(NULL) { | 494 ppp_decryptor_impl_(NULL) { |
| 404 if (dispatcher->IsPlugin()) { | 495 if (dispatcher->IsPlugin()) { |
| 405 ppp_decryptor_impl_ = static_cast<const PPP_ContentDecryptor_Private*>( | 496 ppp_decryptor_impl_ = static_cast<const PPP_ContentDecryptor_Private*>( |
| 406 dispatcher->local_get_interface()( | 497 dispatcher->local_get_interface()( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 420 bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived( | 511 bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived( |
| 421 const IPC::Message& msg) { | 512 const IPC::Message& msg) { |
| 422 if (!dispatcher()->IsPlugin()) | 513 if (!dispatcher()->IsPlugin()) |
| 423 return false; // These are only valid from host->plugin. | 514 return false; // These are only valid from host->plugin. |
| 424 // Don't allow the plugin to send these to the host. | 515 // Don't allow the plugin to send these to the host. |
| 425 | 516 |
| 426 bool handled = true; | 517 bool handled = true; |
| 427 IPC_BEGIN_MESSAGE_MAP(PPP_ContentDecryptor_Private_Proxy, msg) | 518 IPC_BEGIN_MESSAGE_MAP(PPP_ContentDecryptor_Private_Proxy, msg) |
| 428 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Initialize, | 519 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Initialize, |
| 429 OnMsgInitialize) | 520 OnMsgInitialize) |
| 521 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_SetServerCertificate, |
| 522 OnMsgSetServerCertificate) |
| 430 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_CreateSession, | 523 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_CreateSession, |
| 431 OnMsgCreateSession) | 524 OnMsgCreateSession) |
| 432 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_LoadSession, | 525 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_LoadSession, |
| 433 OnMsgLoadSession) | 526 OnMsgLoadSession) |
| 434 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_UpdateSession, | 527 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_UpdateSession, |
| 435 OnMsgUpdateSession) | 528 OnMsgUpdateSession) |
| 436 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_ReleaseSession, | 529 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_CloseSession, |
| 437 OnMsgReleaseSession) | 530 OnMsgCloseSession) |
| 531 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_RemoveSession, |
| 532 OnMsgRemoveSession) |
| 533 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_GetUsableKeyIds, |
| 534 OnMsgGetUsableKeyIds) |
| 438 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Decrypt, | 535 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Decrypt, |
| 439 OnMsgDecrypt) | 536 OnMsgDecrypt) |
| 440 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_InitializeAudioDecoder, | 537 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_InitializeAudioDecoder, |
| 441 OnMsgInitializeAudioDecoder) | 538 OnMsgInitializeAudioDecoder) |
| 442 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_InitializeVideoDecoder, | 539 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_InitializeVideoDecoder, |
| 443 OnMsgInitializeVideoDecoder) | 540 OnMsgInitializeVideoDecoder) |
| 444 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DeinitializeDecoder, | 541 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DeinitializeDecoder, |
| 445 OnMsgDeinitializeDecoder) | 542 OnMsgDeinitializeDecoder) |
| 446 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_ResetDecoder, | 543 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_ResetDecoder, |
| 447 OnMsgResetDecoder) | 544 OnMsgResetDecoder) |
| 448 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DecryptAndDecode, | 545 IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DecryptAndDecode, |
| 449 OnMsgDecryptAndDecode) | 546 OnMsgDecryptAndDecode) |
| 450 IPC_MESSAGE_UNHANDLED(handled = false) | 547 IPC_MESSAGE_UNHANDLED(handled = false) |
| 451 IPC_END_MESSAGE_MAP() | 548 IPC_END_MESSAGE_MAP() |
| 452 DCHECK(handled); | 549 DCHECK(handled); |
| 453 return handled; | 550 return handled; |
| 454 } | 551 } |
| 455 | 552 |
| 456 void PPP_ContentDecryptor_Private_Proxy::OnMsgInitialize( | 553 void PPP_ContentDecryptor_Private_Proxy::OnMsgInitialize( |
| 457 PP_Instance instance, | 554 PP_Instance instance, |
| 458 SerializedVarReceiveInput key_system) { | 555 SerializedVarReceiveInput key_system) { |
| 459 if (ppp_decryptor_impl_) { | 556 if (ppp_decryptor_impl_) { |
| 460 CallWhileUnlocked( | 557 CallWhileUnlocked( |
| 461 ppp_decryptor_impl_->Initialize, | 558 ppp_decryptor_impl_->Initialize, |
| 462 instance, | 559 instance, |
| 463 ExtractReceivedVarAndAddRef(dispatcher(), &key_system)); | 560 ExtractReceivedVarAndAddRef(dispatcher(), &key_system)); |
| 464 } | 561 } |
| 465 } | 562 } |
| 466 | 563 |
| 564 void PPP_ContentDecryptor_Private_Proxy::OnMsgSetServerCertificate( |
| 565 PP_Instance instance, |
| 566 uint32_t promise_id, |
| 567 std::vector<uint8_t> server_certificate) { |
| 568 if (server_certificate.size() < media::limits::kMinCertificateLength || |
| 569 server_certificate.size() > media::limits::kMaxCertificateLength) { |
| 570 NOTREACHED(); |
| 571 return; |
| 572 } |
| 573 |
| 574 if (ppp_decryptor_impl_) { |
| 575 ScopedPPVar server_certificate_var( |
| 576 ScopedPPVar::PassRef(), |
| 577 PpapiGlobals::Get() |
| 578 ->GetVarTracker() |
| 579 ->MakeArrayBufferPPVar(server_certificate.size(), |
| 580 &server_certificate[0])); |
| 581 CallWhileUnlocked(ppp_decryptor_impl_->SetServerCertificate, |
| 582 instance, |
| 583 promise_id, |
| 584 server_certificate_var.get()); |
| 585 } |
| 586 } |
| 587 |
| 467 void PPP_ContentDecryptor_Private_Proxy::OnMsgCreateSession( | 588 void PPP_ContentDecryptor_Private_Proxy::OnMsgCreateSession( |
| 468 PP_Instance instance, | 589 PP_Instance instance, |
| 469 uint32_t promise_id, | 590 uint32_t promise_id, |
| 470 SerializedVarReceiveInput init_data_type, | 591 SerializedVarReceiveInput init_data_type, |
| 471 SerializedVarReceiveInput init_data, | 592 SerializedVarReceiveInput init_data, |
| 472 PP_SessionType session_type) { | 593 PP_SessionType session_type) { |
| 473 if (ppp_decryptor_impl_) { | 594 if (ppp_decryptor_impl_) { |
| 474 CallWhileUnlocked( | 595 CallWhileUnlocked( |
| 475 ppp_decryptor_impl_->CreateSession, | 596 ppp_decryptor_impl_->CreateSession, |
| 476 instance, | 597 instance, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 502 if (ppp_decryptor_impl_) { | 623 if (ppp_decryptor_impl_) { |
| 503 CallWhileUnlocked( | 624 CallWhileUnlocked( |
| 504 ppp_decryptor_impl_->UpdateSession, | 625 ppp_decryptor_impl_->UpdateSession, |
| 505 instance, | 626 instance, |
| 506 promise_id, | 627 promise_id, |
| 507 ExtractReceivedVarAndAddRef(dispatcher(), &web_session_id), | 628 ExtractReceivedVarAndAddRef(dispatcher(), &web_session_id), |
| 508 ExtractReceivedVarAndAddRef(dispatcher(), &response)); | 629 ExtractReceivedVarAndAddRef(dispatcher(), &response)); |
| 509 } | 630 } |
| 510 } | 631 } |
| 511 | 632 |
| 512 void PPP_ContentDecryptor_Private_Proxy::OnMsgReleaseSession( | 633 void PPP_ContentDecryptor_Private_Proxy::OnMsgCloseSession( |
| 513 PP_Instance instance, | 634 PP_Instance instance, |
| 514 uint32_t promise_id, | 635 uint32_t promise_id, |
| 515 SerializedVarReceiveInput web_session_id) { | 636 const std::string& web_session_id) { |
| 516 if (ppp_decryptor_impl_) { | 637 if (ppp_decryptor_impl_) { |
| 517 CallWhileUnlocked( | 638 ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), |
| 518 ppp_decryptor_impl_->ReleaseSession, | 639 StringVar::StringToPPVar(web_session_id)); |
| 519 instance, | 640 CallWhileUnlocked(ppp_decryptor_impl_->CloseSession, |
| 520 promise_id, | 641 instance, |
| 521 ExtractReceivedVarAndAddRef(dispatcher(), &web_session_id)); | 642 promise_id, |
| 643 web_session_id_var.get()); |
| 522 } | 644 } |
| 523 } | 645 } |
| 524 | 646 |
| 647 void PPP_ContentDecryptor_Private_Proxy::OnMsgRemoveSession( |
| 648 PP_Instance instance, |
| 649 uint32_t promise_id, |
| 650 const std::string& web_session_id) { |
| 651 if (ppp_decryptor_impl_) { |
| 652 ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), |
| 653 StringVar::StringToPPVar(web_session_id)); |
| 654 CallWhileUnlocked(ppp_decryptor_impl_->RemoveSession, |
| 655 instance, |
| 656 promise_id, |
| 657 web_session_id_var.get()); |
| 658 } |
| 659 } |
| 660 |
| 661 void PPP_ContentDecryptor_Private_Proxy::OnMsgGetUsableKeyIds( |
| 662 PP_Instance instance, |
| 663 uint32_t promise_id, |
| 664 const std::string& web_session_id) { |
| 665 if (ppp_decryptor_impl_) { |
| 666 ScopedPPVar web_session_id_var(ScopedPPVar::PassRef(), |
| 667 StringVar::StringToPPVar(web_session_id)); |
| 668 CallWhileUnlocked(ppp_decryptor_impl_->GetUsableKeyIds, |
| 669 instance, |
| 670 promise_id, |
| 671 web_session_id_var.get()); |
| 672 } |
| 673 } |
| 674 |
| 525 void PPP_ContentDecryptor_Private_Proxy::OnMsgDecrypt( | 675 void PPP_ContentDecryptor_Private_Proxy::OnMsgDecrypt( |
| 526 PP_Instance instance, | 676 PP_Instance instance, |
| 527 const PPPDecryptor_Buffer& encrypted_buffer, | 677 const PPPDecryptor_Buffer& encrypted_buffer, |
| 528 const std::string& serialized_block_info) { | 678 const std::string& serialized_block_info) { |
| 529 ScopedPPResource plugin_resource( | 679 ScopedPPResource plugin_resource( |
| 530 ScopedPPResource::PassRef(), | 680 ScopedPPResource::PassRef(), |
| 531 PPB_Buffer_Proxy::AddProxyResource(encrypted_buffer.resource, | 681 PPB_Buffer_Proxy::AddProxyResource(encrypted_buffer.resource, |
| 532 encrypted_buffer.handle, | 682 encrypted_buffer.handle, |
| 533 encrypted_buffer.size)); | 683 encrypted_buffer.size)); |
| 534 if (ppp_decryptor_impl_) { | 684 if (ppp_decryptor_impl_) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 ppp_decryptor_impl_->DecryptAndDecode, | 792 ppp_decryptor_impl_->DecryptAndDecode, |
| 643 instance, | 793 instance, |
| 644 decoder_type, | 794 decoder_type, |
| 645 plugin_resource.get(), | 795 plugin_resource.get(), |
| 646 const_cast<const PP_EncryptedBlockInfo*>(&block_info)); | 796 const_cast<const PP_EncryptedBlockInfo*>(&block_info)); |
| 647 } | 797 } |
| 648 } | 798 } |
| 649 | 799 |
| 650 } // namespace proxy | 800 } // namespace proxy |
| 651 } // namespace ppapi | 801 } // namespace ppapi |
| OLD | NEW |