Index: ppapi/proxy/ppb_testing_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_testing_proxy.cc (revision 72517) |
+++ ppapi/proxy/ppb_testing_proxy.cc (working copy) |
@@ -15,12 +15,18 @@ |
namespace { |
-PP_Bool ReadImageData(PP_Resource device_context_2d, |
+PP_Bool ReadImageData(PP_Resource graphics_2d, |
PP_Resource image, |
const PP_Point* top_left) { |
ImageData* image_object = PluginResource::GetAs<ImageData>(image); |
if (!image_object) |
return PP_FALSE; |
+ PluginResource* graphics_2d_object = |
+ PluginResourceTracker::GetInstance()->GetResourceObject(graphics_2d); |
+ if (!graphics_2d_object || |
+ image_object->instance() != graphics_2d_object->instance()) |
+ return PP_FALSE; |
+ |
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance( |
image_object->instance()); |
if (!dispatcher) |
@@ -28,7 +34,8 @@ |
PP_Bool result = PP_FALSE; |
dispatcher->Send(new PpapiHostMsg_PPBTesting_ReadImageData( |
- INTERFACE_ID_PPB_TESTING, device_context_2d, image, *top_left, &result)); |
+ INTERFACE_ID_PPB_TESTING, graphics_2d_object->host_resource(), |
+ image_object->host_resource(), *top_left, &result)); |
return result; |
} |
@@ -95,12 +102,12 @@ |
return handled; |
} |
-void PPB_Testing_Proxy::OnMsgReadImageData(PP_Resource device_context_2d, |
- PP_Resource image, |
+void PPB_Testing_Proxy::OnMsgReadImageData(SerializedResource device_context_2d, |
+ SerializedResource image, |
const PP_Point& top_left, |
PP_Bool* result) { |
*result = ppb_testing_target()->ReadImageData( |
- device_context_2d, image, &top_left); |
+ device_context_2d.host_resource(), image.host_resource(), &top_left); |
} |
void PPB_Testing_Proxy::OnMsgRunMessageLoop(bool* dummy) { |
@@ -113,7 +120,7 @@ |
} |
void PPB_Testing_Proxy::OnMsgGetLiveObjectsForInstance(PP_Instance instance, |
- uint32_t* result) { |
+ uint32_t* result) { |
*result = ppb_testing_target()->GetLiveObjectsForInstance(instance); |
} |