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

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: 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 instance, 509 instance,
510 SerializedVarSendInput(dispatcher(), key_system), 510 SerializedVarSendInput(dispatcher(), key_system),
511 SerializedVarSendInput(dispatcher(), session_id), 511 SerializedVarSendInput(dispatcher(), session_id),
512 media_error, 512 media_error,
513 system_code)); 513 system_code));
514 } 514 }
515 515
516 void PPB_Instance_Proxy::DeliverBlock(PP_Instance instance, 516 void PPB_Instance_Proxy::DeliverBlock(PP_Instance instance,
517 PP_Resource decrypted_block, 517 PP_Resource decrypted_block,
518 const PP_DecryptedBlockInfo* block_info) { 518 const PP_DecryptedBlockInfo* block_info) {
519 Resource* object = 519 PP_Resource decrypted_block_host_resource = 0;
520 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_block); 520
521 if (!object || object->pp_instance() != instance) 521 if (decrypted_block) {
522 return; 522 Resource* object =
523 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_block);
524 if (!object || object->pp_instance() != instance)
525 return;
526 decrypted_block_host_resource = object->host_resource().host_resource();
527 }
523 528
524 std::string serialized_block_info; 529 std::string serialized_block_info;
525 if (!SerializeBlockInfo(*block_info, &serialized_block_info)) 530 if (!SerializeBlockInfo(*block_info, &serialized_block_info))
526 return; 531 return;
527 532
528 dispatcher()->Send( 533 dispatcher()->Send(
529 new PpapiHostMsg_PPBInstance_DeliverBlock(API_ID_PPB_INSTANCE, 534 new PpapiHostMsg_PPBInstance_DeliverBlock(API_ID_PPB_INSTANCE,
530 instance, 535 instance,
531 object->host_resource().host_resource(), 536 decrypted_block_host_resource,
532 serialized_block_info)); 537 serialized_block_info));
533 } 538 }
534 539
540 // TODO(tomfinegan): Handle null decrypted_frame after landing other patches.
535 void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance, 541 void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance,
536 PP_Resource decrypted_frame, 542 PP_Resource decrypted_frame,
537 const PP_DecryptedFrameInfo* frame_info) { 543 const PP_DecryptedFrameInfo* frame_info) {
538 Resource* object = 544 Resource* object =
539 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame); 545 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame);
540 if (!object || object->pp_instance() != instance) 546 if (!object || object->pp_instance() != instance)
541 return; 547 return;
542 548
543 std::string serialized_block_info; 549 std::string serialized_block_info;
544 if (!SerializeBlockInfo(*frame_info, &serialized_block_info)) 550 if (!SerializeBlockInfo(*frame_info, &serialized_block_info))
545 return; 551 return;
546 552
547 dispatcher()->Send(new PpapiHostMsg_PPBInstance_DeliverFrame( 553 dispatcher()->Send(new PpapiHostMsg_PPBInstance_DeliverFrame(
548 API_ID_PPB_INSTANCE, 554 API_ID_PPB_INSTANCE,
549 instance, 555 instance,
550 object->host_resource().host_resource(), 556 object->host_resource().host_resource(),
551 serialized_block_info)); 557 serialized_block_info));
552 } 558 }
553 559
560 // TODO(tomfinegan): Handle null decrypted_frame after landing other patches.
Tom Finegan 2012/10/11 23:57:56 s/decrypted_frame/decrypted_samples/
ddorwin 2012/10/12 00:21:16 Done.
554 void PPB_Instance_Proxy::DeliverSamples( 561 void PPB_Instance_Proxy::DeliverSamples(
555 PP_Instance instance, 562 PP_Instance instance,
556 PP_Resource decrypted_samples, 563 PP_Resource decrypted_samples,
557 const PP_DecryptedBlockInfo* block_info) { 564 const PP_DecryptedBlockInfo* block_info) {
558 Resource* object = 565 Resource* object =
559 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_samples); 566 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_samples);
560 if (!object || object->pp_instance() != instance) 567 if (!object || object->pp_instance() != instance)
561 return; 568 return;
562 569
563 std::string serialized_block_info; 570 std::string serialized_block_info;
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 PP_Instance instance) { 1058 PP_Instance instance) {
1052 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1059 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1053 GetInstanceData(instance); 1060 GetInstanceData(instance);
1054 if (!data) 1061 if (!data)
1055 return; // Instance was probably deleted. 1062 return; // Instance was probably deleted.
1056 data->should_do_request_surrounding_text = false; 1063 data->should_do_request_surrounding_text = false;
1057 } 1064 }
1058 1065
1059 } // namespace proxy 1066 } // namespace proxy
1060 } // namespace ppapi 1067 } // namespace ppapi
OLDNEW
« no previous file with comments | « no previous file | webkit/media/crypto/ppapi/cdm_wrapper.cc » ('j') | webkit/media/crypto/ppapi/cdm_wrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698