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

Side by Side Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 11106004: Allow null buffer resources to be returned through the PPB_ContentDecryptor_Private proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/ppb_instance_proxy.h" 5 #include "ppapi/proxy/ppb_instance_proxy.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/pp_time.h" 9 #include "ppapi/c/pp_time.h"
10 #include "ppapi/c/pp_var.h" 10 #include "ppapi/c/pp_var.h"
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 instance, 515 instance,
516 SerializedVarSendInput(dispatcher(), key_system), 516 SerializedVarSendInput(dispatcher(), key_system),
517 SerializedVarSendInput(dispatcher(), session_id), 517 SerializedVarSendInput(dispatcher(), session_id),
518 media_error, 518 media_error,
519 system_code)); 519 system_code));
520 } 520 }
521 521
522 void PPB_Instance_Proxy::DeliverBlock(PP_Instance instance, 522 void PPB_Instance_Proxy::DeliverBlock(PP_Instance instance,
523 PP_Resource decrypted_block, 523 PP_Resource decrypted_block,
524 const PP_DecryptedBlockInfo* block_info) { 524 const PP_DecryptedBlockInfo* block_info) {
525 Resource* object = 525 PP_Resource decrypted_block_host_resource = 0;
526 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_block); 526
527 if (!object || object->pp_instance() != instance) 527 if (decrypted_block) {
528 return; 528 Resource* object =
529 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_block);
530 if (!object || object->pp_instance() != instance)
531 return;
532 decrypted_block_host_resource = object->host_resource().host_resource();
533 }
529 534
530 std::string serialized_block_info; 535 std::string serialized_block_info;
531 if (!SerializeBlockInfo(*block_info, &serialized_block_info)) 536 if (!SerializeBlockInfo(*block_info, &serialized_block_info))
532 return; 537 return;
533 538
534 dispatcher()->Send( 539 dispatcher()->Send(
535 new PpapiHostMsg_PPBInstance_DeliverBlock(API_ID_PPB_INSTANCE, 540 new PpapiHostMsg_PPBInstance_DeliverBlock(API_ID_PPB_INSTANCE,
536 instance, 541 instance,
537 object->host_resource().host_resource(), 542 decrypted_block_host_resource,
538 serialized_block_info)); 543 serialized_block_info));
539 } 544 }
540 545
541 void PPB_Instance_Proxy::DecoderInitialized(PP_Instance instance, 546 void PPB_Instance_Proxy::DecoderInitialized(PP_Instance instance,
542 PP_Bool success, 547 PP_Bool success,
543 uint32_t request_id) { 548 uint32_t request_id) {
544 dispatcher()->Send( 549 dispatcher()->Send(
545 new PpapiHostMsg_PPBInstance_DecoderInitialized( 550 new PpapiHostMsg_PPBInstance_DecoderInitialized(
546 API_ID_PPB_INSTANCE, 551 API_ID_PPB_INSTANCE,
547 instance, 552 instance,
(...skipping 17 matching lines...) Expand all
565 PP_DecryptorStreamType decoder_type, 570 PP_DecryptorStreamType decoder_type,
566 uint32_t request_id) { 571 uint32_t request_id) {
567 dispatcher()->Send( 572 dispatcher()->Send(
568 new PpapiHostMsg_PPBInstance_DecoderResetDone( 573 new PpapiHostMsg_PPBInstance_DecoderResetDone(
569 API_ID_PPB_INSTANCE, 574 API_ID_PPB_INSTANCE,
570 instance, 575 instance,
571 decoder_type, 576 decoder_type,
572 request_id)); 577 request_id));
573 } 578 }
574 579
580 // TODO(tomfinegan): Handle null decrypted_frame after landing other patches.
575 void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance, 581 void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance,
576 PP_Resource decrypted_frame, 582 PP_Resource decrypted_frame,
577 const PP_DecryptedFrameInfo* frame_info) { 583 const PP_DecryptedFrameInfo* frame_info) {
578 Resource* object = 584 Resource* object =
579 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame); 585 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame);
580 if (!object || object->pp_instance() != instance) 586 if (!object || object->pp_instance() != instance)
581 return; 587 return;
582 588
583 std::string serialized_block_info; 589 std::string serialized_block_info;
584 if (!SerializeBlockInfo(*frame_info, &serialized_block_info)) 590 if (!SerializeBlockInfo(*frame_info, &serialized_block_info))
585 return; 591 return;
586 592
587 dispatcher()->Send(new PpapiHostMsg_PPBInstance_DeliverFrame( 593 dispatcher()->Send(new PpapiHostMsg_PPBInstance_DeliverFrame(
588 API_ID_PPB_INSTANCE, 594 API_ID_PPB_INSTANCE,
589 instance, 595 instance,
590 object->host_resource().host_resource(), 596 object->host_resource().host_resource(),
591 serialized_block_info)); 597 serialized_block_info));
592 } 598 }
593 599
600 // TODO(tomfinegan): Handle null decrypted_samples after landing other patches.
594 void PPB_Instance_Proxy::DeliverSamples( 601 void PPB_Instance_Proxy::DeliverSamples(
595 PP_Instance instance, 602 PP_Instance instance,
596 PP_Resource decrypted_samples, 603 PP_Resource decrypted_samples,
597 const PP_DecryptedBlockInfo* block_info) { 604 const PP_DecryptedBlockInfo* block_info) {
598 Resource* object = 605 Resource* object =
599 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_samples); 606 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_samples);
600 if (!object || object->pp_instance() != instance) 607 if (!object || object->pp_instance() != instance)
601 return; 608 return;
602 609
603 std::string serialized_block_info; 610 std::string serialized_block_info;
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 PP_Instance instance) { 1127 PP_Instance instance) {
1121 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1128 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1122 GetInstanceData(instance); 1129 GetInstanceData(instance);
1123 if (!data) 1130 if (!data)
1124 return; // Instance was probably deleted. 1131 return; // Instance was probably deleted.
1125 data->should_do_request_surrounding_text = false; 1132 data->should_do_request_surrounding_text = false;
1126 } 1133 }
1127 1134
1128 } // namespace proxy 1135 } // namespace proxy
1129 } // namespace ppapi 1136 } // namespace ppapi
OLDNEW
« no previous file with comments | « no previous file | webkit/media/crypto/ppapi_decryptor.cc » ('j') | webkit/media/crypto/proxy_decryptor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698