OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_testing_proxy.h" | 5 #include "ppapi/proxy/ppb_testing_proxy.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "ppapi/c/dev/ppb_testing_dev.h" | 8 #include "ppapi/c/dev/ppb_testing_dev.h" |
9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
10 #include "ppapi/proxy/plugin_resource.h" | |
11 #include "ppapi/proxy/plugin_resource_tracker.h" | 10 #include "ppapi/proxy/plugin_resource_tracker.h" |
12 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
| 12 #include "ppapi/shared_impl/resource.h" |
13 | 13 |
14 using ppapi::HostResource; | 14 using ppapi::HostResource; |
| 15 using ppapi::Resource; |
15 | 16 |
16 namespace pp { | 17 namespace pp { |
17 namespace proxy { | 18 namespace proxy { |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 PP_Bool ReadImageData(PP_Resource graphics_2d, | 22 PP_Bool ReadImageData(PP_Resource graphics_2d, |
22 PP_Resource image, | 23 PP_Resource image, |
23 const PP_Point* top_left) { | 24 const PP_Point* top_left) { |
24 PluginResource* image_object = PluginResourceTracker::GetInstance()-> | 25 Resource* image_object = PluginResourceTracker::GetInstance()-> |
25 GetResourceObject(image); | 26 GetResource(image); |
26 if (!image_object) | 27 if (!image_object) |
27 return PP_FALSE; | 28 return PP_FALSE; |
28 PluginResource* graphics_2d_object = | 29 Resource* graphics_2d_object = |
29 PluginResourceTracker::GetInstance()->GetResourceObject(graphics_2d); | 30 PluginResourceTracker::GetInstance()->GetResource(graphics_2d); |
30 if (!graphics_2d_object || | 31 if (!graphics_2d_object || |
31 image_object->instance() != graphics_2d_object->instance()) | 32 image_object->pp_instance() != graphics_2d_object->pp_instance()) |
32 return PP_FALSE; | 33 return PP_FALSE; |
33 | 34 |
34 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance( | 35 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance( |
35 image_object->instance()); | 36 image_object->pp_instance()); |
36 if (!dispatcher) | 37 if (!dispatcher) |
37 return PP_FALSE; | 38 return PP_FALSE; |
38 | 39 |
39 PP_Bool result = PP_FALSE; | 40 PP_Bool result = PP_FALSE; |
40 dispatcher->Send(new PpapiHostMsg_PPBTesting_ReadImageData( | 41 dispatcher->Send(new PpapiHostMsg_PPBTesting_ReadImageData( |
41 INTERFACE_ID_PPB_TESTING, graphics_2d_object->host_resource(), | 42 INTERFACE_ID_PPB_TESTING, graphics_2d_object->host_resource(), |
42 image_object->host_resource(), *top_left, &result)); | 43 image_object->host_resource(), *top_left, &result)); |
43 return result; | 44 return result; |
44 } | 45 } |
45 | 46 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 ppb_testing_target()->QuitMessageLoop(instance); | 129 ppb_testing_target()->QuitMessageLoop(instance); |
129 } | 130 } |
130 | 131 |
131 void PPB_Testing_Proxy::OnMsgGetLiveObjectsForInstance(PP_Instance instance, | 132 void PPB_Testing_Proxy::OnMsgGetLiveObjectsForInstance(PP_Instance instance, |
132 uint32_t* result) { | 133 uint32_t* result) { |
133 *result = ppb_testing_target()->GetLiveObjectsForInstance(instance); | 134 *result = ppb_testing_target()->GetLiveObjectsForInstance(instance); |
134 } | 135 } |
135 | 136 |
136 } // namespace proxy | 137 } // namespace proxy |
137 } // namespace pp | 138 } // namespace pp |
OLD | NEW |