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_tracker.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
11 #include "ppapi/shared_impl/ppapi_globals.h" | |
12 #include "ppapi/shared_impl/resource.h" | 12 #include "ppapi/shared_impl/resource.h" |
13 #include "ppapi/shared_impl/resource_tracker.h" | |
14 | 13 |
15 namespace ppapi { | 14 namespace ppapi { |
16 namespace proxy { | 15 namespace proxy { |
17 | 16 |
18 namespace { | 17 namespace { |
19 | 18 |
20 PP_Bool ReadImageData(PP_Resource graphics_2d, | 19 PP_Bool ReadImageData(PP_Resource graphics_2d, |
21 PP_Resource image, | 20 PP_Resource image, |
22 const PP_Point* top_left) { | 21 const PP_Point* top_left) { |
23 Resource* image_object = | 22 Resource* image_object = PluginResourceTracker::GetInstance()-> |
24 PpapiGlobals::Get()->GetResourceTracker()->GetResource(image); | 23 GetResource(image); |
25 if (!image_object) | 24 if (!image_object) |
26 return PP_FALSE; | 25 return PP_FALSE; |
27 Resource* graphics_2d_object = | 26 Resource* graphics_2d_object = |
28 PpapiGlobals::Get()->GetResourceTracker()->GetResource(graphics_2d); | 27 PluginResourceTracker::GetInstance()->GetResource(graphics_2d); |
29 if (!graphics_2d_object || | 28 if (!graphics_2d_object || |
30 image_object->pp_instance() != graphics_2d_object->pp_instance()) | 29 image_object->pp_instance() != graphics_2d_object->pp_instance()) |
31 return PP_FALSE; | 30 return PP_FALSE; |
32 | 31 |
33 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance( | 32 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance( |
34 image_object->pp_instance()); | 33 image_object->pp_instance()); |
35 if (!dispatcher) | 34 if (!dispatcher) |
36 return PP_FALSE; | 35 return PP_FALSE; |
37 | 36 |
38 PP_Bool result = PP_FALSE; | 37 PP_Bool result = PP_FALSE; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 ppb_testing_impl_->QuitMessageLoop(instance); | 134 ppb_testing_impl_->QuitMessageLoop(instance); |
136 } | 135 } |
137 | 136 |
138 void PPB_Testing_Proxy::OnMsgGetLiveObjectsForInstance(PP_Instance instance, | 137 void PPB_Testing_Proxy::OnMsgGetLiveObjectsForInstance(PP_Instance instance, |
139 uint32_t* result) { | 138 uint32_t* result) { |
140 *result = ppb_testing_impl_->GetLiveObjectsForInstance(instance); | 139 *result = ppb_testing_impl_->GetLiveObjectsForInstance(instance); |
141 } | 140 } |
142 | 141 |
143 } // namespace proxy | 142 } // namespace proxy |
144 } // namespace ppapi | 143 } // namespace ppapi |
OLD | NEW |