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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 10899021: Add CDM video decoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/proxy/ppp_content_decryptor_private_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_instance_proxy.cc
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index 90dd58693769e9a445c8eb2e5aec27aed09593b4..03b98c940f9dc7cd14da0aad5bdab9f61c5361a9 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -585,10 +585,16 @@ void PPB_Instance_Proxy::DecoderResetDone(PP_Instance instance,
void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance,
PP_Resource decrypted_frame,
const PP_DecryptedFrameInfo* frame_info) {
- Resource* object =
- PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame);
- if (!object || object->pp_instance() != instance)
- return;
+ PP_Resource host_resource = 0;
+ if (decrypted_frame != 0) {
+ ResourceTracker* tracker = PpapiGlobals::Get()->GetResourceTracker();
+ Resource* object = tracker->GetResource(decrypted_frame);
+
+ if (!object || object->pp_instance() != instance)
+ return;
+
+ host_resource = object->host_resource().host_resource();
+ }
std::string serialized_block_info;
if (!SerializeBlockInfo(*frame_info, &serialized_block_info))
@@ -597,19 +603,25 @@ void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance,
dispatcher()->Send(new PpapiHostMsg_PPBInstance_DeliverFrame(
API_ID_PPB_INSTANCE,
instance,
- object->host_resource().host_resource(),
+ host_resource,
serialized_block_info));
}
// TODO(tomfinegan): Handle null audio_frames after landing other patches.
void PPB_Instance_Proxy::DeliverSamples(
PP_Instance instance,
- PP_Resource audio_frames,
+ PP_Resource decrypted_samples,
const PP_DecryptedBlockInfo* block_info) {
- Resource* object =
- PpapiGlobals::Get()->GetResourceTracker()->GetResource(audio_frames);
- if (!object || object->pp_instance() != instance)
- return;
+ PP_Resource host_resource = 0;
+ if (decrypted_samples != 0) {
+ ResourceTracker* tracker = PpapiGlobals::Get()->GetResourceTracker();
+ Resource* object = tracker->GetResource(decrypted_samples);
+
+ if (!object || object->pp_instance() != instance)
+ return;
+
+ host_resource = object->host_resource().host_resource();
+ }
std::string serialized_block_info;
if (!SerializeBlockInfo(*block_info, &serialized_block_info))
@@ -619,7 +631,7 @@ void PPB_Instance_Proxy::DeliverSamples(
new PpapiHostMsg_PPBInstance_DeliverSamples(
API_ID_PPB_INSTANCE,
instance,
- object->host_resource().host_resource(),
+ host_resource,
serialized_block_info));
}
#endif // !defined(OS_NACL)
« no previous file with comments | « no previous file | ppapi/proxy/ppp_content_decryptor_private_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698