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