| 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/resource_creation_proxy.h" | 5 #include "ppapi/proxy/resource_creation_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/pp_size.h" | 8 #include "ppapi/c/pp_size.h" |
| 9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" | 9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" |
| 10 #include "ppapi/proxy/connection.h" | 10 #include "ppapi/proxy/connection.h" |
| 11 #include "ppapi/proxy/file_chooser_resource.h" | 11 #include "ppapi/proxy/file_chooser_resource.h" |
| 12 #include "ppapi/proxy/flash_device_id_resource.h" | 12 #include "ppapi/proxy/flash_device_id_resource.h" |
| 13 #include "ppapi/proxy/graphics_2d_resource.h" |
| 13 #include "ppapi/proxy/plugin_dispatcher.h" | 14 #include "ppapi/proxy/plugin_dispatcher.h" |
| 14 #include "ppapi/proxy/plugin_globals.h" | 15 #include "ppapi/proxy/plugin_globals.h" |
| 15 #include "ppapi/proxy/plugin_proxy_delegate.h" | 16 #include "ppapi/proxy/plugin_proxy_delegate.h" |
| 16 #include "ppapi/proxy/plugin_resource_tracker.h" | 17 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 17 #include "ppapi/proxy/ppapi_messages.h" | 18 #include "ppapi/proxy/ppapi_messages.h" |
| 18 #include "ppapi/proxy/ppb_audio_input_proxy.h" | 19 #include "ppapi/proxy/ppb_audio_input_proxy.h" |
| 19 #include "ppapi/proxy/ppb_audio_proxy.h" | 20 #include "ppapi/proxy/ppb_audio_proxy.h" |
| 20 #include "ppapi/proxy/ppb_buffer_proxy.h" | 21 #include "ppapi/proxy/ppb_buffer_proxy.h" |
| 21 #include "ppapi/proxy/ppb_broker_proxy.h" | 22 #include "ppapi/proxy/ppb_broker_proxy.h" |
| 22 #include "ppapi/proxy/ppb_file_io_proxy.h" | 23 #include "ppapi/proxy/ppb_file_io_proxy.h" |
| 23 #include "ppapi/proxy/ppb_file_ref_proxy.h" | 24 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
| 24 #include "ppapi/proxy/ppb_file_system_proxy.h" | 25 #include "ppapi/proxy/ppb_file_system_proxy.h" |
| 25 #include "ppapi/proxy/ppb_flash_menu_proxy.h" | 26 #include "ppapi/proxy/ppb_flash_menu_proxy.h" |
| 26 #include "ppapi/proxy/ppb_flash_message_loop_proxy.h" | 27 #include "ppapi/proxy/ppb_flash_message_loop_proxy.h" |
| 27 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" | |
| 28 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" | 28 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" |
| 29 #include "ppapi/proxy/ppb_host_resolver_private_proxy.h" | 29 #include "ppapi/proxy/ppb_host_resolver_private_proxy.h" |
| 30 #include "ppapi/proxy/ppb_image_data_proxy.h" | 30 #include "ppapi/proxy/ppb_image_data_proxy.h" |
| 31 #include "ppapi/proxy/ppb_network_monitor_private_proxy.h" | 31 #include "ppapi/proxy/ppb_network_monitor_private_proxy.h" |
| 32 #include "ppapi/proxy/ppb_talk_private_proxy.h" | 32 #include "ppapi/proxy/ppb_talk_private_proxy.h" |
| 33 #include "ppapi/proxy/ppb_tcp_server_socket_private_proxy.h" | 33 #include "ppapi/proxy/ppb_tcp_server_socket_private_proxy.h" |
| 34 #include "ppapi/proxy/ppb_tcp_socket_private_proxy.h" | 34 #include "ppapi/proxy/ppb_tcp_socket_private_proxy.h" |
| 35 #include "ppapi/proxy/ppb_udp_socket_private_proxy.h" | 35 #include "ppapi/proxy/ppb_udp_socket_private_proxy.h" |
| 36 #include "ppapi/proxy/ppb_url_loader_proxy.h" | 36 #include "ppapi/proxy/ppb_url_loader_proxy.h" |
| 37 #include "ppapi/proxy/ppb_video_capture_proxy.h" | 37 #include "ppapi/proxy/ppb_video_capture_proxy.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 PP_Bool init_to_zero) { | 200 PP_Bool init_to_zero) { |
| 201 // These really only are different on the host side. On the plugin side, we | 201 // These really only are different on the host side. On the plugin side, we |
| 202 // always request a "platform" ImageData if we're trusted, or a "NaCl" one | 202 // always request a "platform" ImageData if we're trusted, or a "NaCl" one |
| 203 // if we're untrusted (see PPB_ImageData_Proxy::CreateProxyResource()). | 203 // if we're untrusted (see PPB_ImageData_Proxy::CreateProxyResource()). |
| 204 return CreateImageData(instance, format, size, init_to_zero); | 204 return CreateImageData(instance, format, size, init_to_zero); |
| 205 } | 205 } |
| 206 | 206 |
| 207 PP_Resource ResourceCreationProxy::CreateGraphics2D(PP_Instance instance, | 207 PP_Resource ResourceCreationProxy::CreateGraphics2D(PP_Instance instance, |
| 208 const PP_Size& size, | 208 const PP_Size& size, |
| 209 PP_Bool is_always_opaque) { | 209 PP_Bool is_always_opaque) { |
| 210 return PPB_Graphics2D_Proxy::CreateProxyResource(instance, size, | 210 Graphics2DResource* res = Graphics2DResource::Create( |
| 211 is_always_opaque); | 211 GetConnection(), instance, size, is_always_opaque); |
| 212 return res ? res->GetReference() : 0; |
| 212 } | 213 } |
| 213 | 214 |
| 214 PP_Resource ResourceCreationProxy::CreateGraphics3D( | 215 PP_Resource ResourceCreationProxy::CreateGraphics3D( |
| 215 PP_Instance instance, | 216 PP_Instance instance, |
| 216 PP_Resource share_context, | 217 PP_Resource share_context, |
| 217 const int32_t* attrib_list) { | 218 const int32_t* attrib_list) { |
| 218 return PPB_Graphics3D_Proxy::CreateProxyResource( | 219 return PPB_Graphics3D_Proxy::CreateProxyResource( |
| 219 instance, share_context, attrib_list); | 220 instance, share_context, attrib_list); |
| 220 } | 221 } |
| 221 | 222 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 375 } |
| 375 | 376 |
| 376 Connection ResourceCreationProxy::GetConnection() { | 377 Connection ResourceCreationProxy::GetConnection() { |
| 377 return Connection( | 378 return Connection( |
| 378 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), | 379 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), |
| 379 dispatcher()); | 380 dispatcher()); |
| 380 } | 381 } |
| 381 | 382 |
| 382 } // namespace proxy | 383 } // namespace proxy |
| 383 } // namespace ppapi | 384 } // namespace ppapi |
| OLD | NEW |