OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/pp_time.h" | 10 #include "ppapi/c/pp_time.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "ppapi/proxy/plugin_dispatcher.h" | 32 #include "ppapi/proxy/plugin_dispatcher.h" |
33 #include "ppapi/proxy/ppapi_messages.h" | 33 #include "ppapi/proxy/ppapi_messages.h" |
34 #include "ppapi/proxy/serialized_var.h" | 34 #include "ppapi/proxy/serialized_var.h" |
35 #include "ppapi/proxy/truetype_font_singleton_resource.h" | 35 #include "ppapi/proxy/truetype_font_singleton_resource.h" |
36 #include "ppapi/proxy/uma_private_resource.h" | 36 #include "ppapi/proxy/uma_private_resource.h" |
37 #include "ppapi/shared_impl/ppapi_globals.h" | 37 #include "ppapi/shared_impl/ppapi_globals.h" |
38 #include "ppapi/shared_impl/ppb_url_util_shared.h" | 38 #include "ppapi/shared_impl/ppb_url_util_shared.h" |
39 #include "ppapi/shared_impl/ppb_view_shared.h" | 39 #include "ppapi/shared_impl/ppb_view_shared.h" |
40 #include "ppapi/shared_impl/var.h" | 40 #include "ppapi/shared_impl/var.h" |
41 #include "ppapi/thunk/enter.h" | 41 #include "ppapi/thunk/enter.h" |
42 #include "ppapi/thunk/ppb_compositor_api.h" | |
43 #include "ppapi/thunk/ppb_graphics_2d_api.h" | 42 #include "ppapi/thunk/ppb_graphics_2d_api.h" |
44 #include "ppapi/thunk/ppb_graphics_3d_api.h" | 43 #include "ppapi/thunk/ppb_graphics_3d_api.h" |
45 #include "ppapi/thunk/thunk.h" | 44 #include "ppapi/thunk/thunk.h" |
46 | 45 |
47 // Windows headers interfere with this file. | 46 // Windows headers interfere with this file. |
48 #ifdef PostMessage | 47 #ifdef PostMessage |
49 #undef PostMessage | 48 #undef PostMessage |
50 #endif | 49 #endif |
51 | 50 |
52 using ppapi::thunk::EnterInstanceNoLock; | 51 using ppapi::thunk::EnterInstanceNoLock; |
53 using ppapi::thunk::EnterResourceNoLock; | 52 using ppapi::thunk::EnterResourceNoLock; |
54 using ppapi::thunk::PPB_Compositor_API; | |
55 using ppapi::thunk::PPB_Graphics2D_API; | 53 using ppapi::thunk::PPB_Graphics2D_API; |
56 using ppapi::thunk::PPB_Graphics3D_API; | 54 using ppapi::thunk::PPB_Graphics3D_API; |
57 using ppapi::thunk::PPB_Instance_API; | 55 using ppapi::thunk::PPB_Instance_API; |
58 | 56 |
59 namespace ppapi { | 57 namespace ppapi { |
60 namespace proxy { | 58 namespace proxy { |
61 | 59 |
62 namespace { | 60 namespace { |
63 | 61 |
64 #if !defined(OS_NACL) | 62 #if !defined(OS_NACL) |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 pp_resource = resource->pp_resource(); | 225 pp_resource = resource->pp_resource(); |
228 } else { | 226 } else { |
229 // Passing 0 means unbinding all devices. | 227 // Passing 0 means unbinding all devices. |
230 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( | 228 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( |
231 API_ID_PPB_INSTANCE, instance, 0)); | 229 API_ID_PPB_INSTANCE, instance, 0)); |
232 return PP_TRUE; | 230 return PP_TRUE; |
233 } | 231 } |
234 | 232 |
235 // We need to pass different resource to Graphics 2D and 3D right now. Once | 233 // We need to pass different resource to Graphics 2D and 3D right now. Once |
236 // 3D is migrated to the new design, we should be able to unify this. | 234 // 3D is migrated to the new design, we should be able to unify this. |
237 EnterResourceNoLock<PPB_Compositor_API> enter_compositor(device, false); | |
238 EnterResourceNoLock<PPB_Graphics2D_API> enter_2d(device, false); | 235 EnterResourceNoLock<PPB_Graphics2D_API> enter_2d(device, false); |
239 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); | 236 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); |
240 if (enter_compositor.succeeded() || enter_2d.succeeded()) { | 237 if (enter_2d.succeeded()) { |
241 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( | 238 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( |
242 API_ID_PPB_INSTANCE, instance, pp_resource)); | 239 API_ID_PPB_INSTANCE, instance, pp_resource)); |
243 return PP_TRUE; | 240 return PP_TRUE; |
244 } else if (enter_3d.succeeded()) { | 241 } else if (enter_3d.succeeded()) { |
245 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( | 242 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( |
246 API_ID_PPB_INSTANCE, instance, host_resource.host_resource())); | 243 API_ID_PPB_INSTANCE, instance, host_resource.host_resource())); |
247 return PP_TRUE; | 244 return PP_TRUE; |
248 } | 245 } |
249 return PP_FALSE; | 246 return PP_FALSE; |
250 } | 247 } |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 PP_Instance instance) { | 1431 PP_Instance instance) { |
1435 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1432 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1436 GetInstanceData(instance); | 1433 GetInstanceData(instance); |
1437 if (!data) | 1434 if (!data) |
1438 return; // Instance was probably deleted. | 1435 return; // Instance was probably deleted. |
1439 data->should_do_request_surrounding_text = false; | 1436 data->should_do_request_surrounding_text = false; |
1440 } | 1437 } |
1441 | 1438 |
1442 } // namespace proxy | 1439 } // namespace proxy |
1443 } // namespace ppapi | 1440 } // namespace ppapi |
OLD | NEW |