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/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/proxy/interface_id.h" | 9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
11 #include "ppapi/c/trusted/ppb_image_data_trusted.h" | |
12 #include "ppapi/proxy/plugin_resource_tracker.h" | 11 #include "ppapi/proxy/plugin_resource_tracker.h" |
13 #include "ppapi/proxy/ppapi_messages.h" | 12 #include "ppapi/proxy/ppapi_messages.h" |
14 #include "ppapi/proxy/ppb_audio_proxy.h" | 13 #include "ppapi/proxy/ppb_audio_proxy.h" |
15 #include "ppapi/proxy/ppb_buffer_proxy.h" | 14 #include "ppapi/proxy/ppb_buffer_proxy.h" |
16 #include "ppapi/proxy/ppb_broker_proxy.h" | 15 #include "ppapi/proxy/ppb_broker_proxy.h" |
17 #include "ppapi/proxy/ppb_context_3d_proxy.h" | 16 #include "ppapi/proxy/ppb_context_3d_proxy.h" |
18 #include "ppapi/proxy/ppb_file_chooser_proxy.h" | 17 #include "ppapi/proxy/ppb_file_chooser_proxy.h" |
19 #include "ppapi/proxy/ppb_file_ref_proxy.h" | 18 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
20 #include "ppapi/proxy/ppb_file_system_proxy.h" | 19 #include "ppapi/proxy/ppb_file_system_proxy.h" |
21 #include "ppapi/proxy/ppb_flash_menu_proxy.h" | 20 #include "ppapi/proxy/ppb_flash_menu_proxy.h" |
22 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" | 21 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" |
23 #include "ppapi/proxy/ppb_flash_tcp_socket_proxy.h" | 22 #include "ppapi/proxy/ppb_flash_tcp_socket_proxy.h" |
24 #include "ppapi/proxy/ppb_flash_udp_socket_proxy.h" | 23 #include "ppapi/proxy/ppb_flash_udp_socket_proxy.h" |
25 #include "ppapi/proxy/ppb_font_proxy.h" | 24 #include "ppapi/proxy/ppb_font_proxy.h" |
26 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" | 25 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" |
27 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" | 26 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" |
28 #include "ppapi/proxy/ppb_image_data_proxy.h" | 27 #include "ppapi/proxy/ppb_image_data_proxy.h" |
29 #include "ppapi/proxy/ppb_surface_3d_proxy.h" | 28 #include "ppapi/proxy/ppb_surface_3d_proxy.h" |
30 #include "ppapi/proxy/ppb_url_loader_proxy.h" | 29 #include "ppapi/proxy/ppb_url_loader_proxy.h" |
31 #include "ppapi/proxy/ppb_video_capture_proxy.h" | 30 #include "ppapi/proxy/ppb_video_capture_proxy.h" |
32 #include "ppapi/proxy/ppb_video_decoder_proxy.h" | 31 #include "ppapi/proxy/ppb_video_decoder_proxy.h" |
| 32 #include "ppapi/shared_impl/api_id.h" |
33 #include "ppapi/shared_impl/audio_config_impl.h" | 33 #include "ppapi/shared_impl/audio_config_impl.h" |
34 #include "ppapi/shared_impl/font_impl.h" | 34 #include "ppapi/shared_impl/font_impl.h" |
35 #include "ppapi/shared_impl/function_group_base.h" | 35 #include "ppapi/shared_impl/function_group_base.h" |
36 #include "ppapi/shared_impl/host_resource.h" | 36 #include "ppapi/shared_impl/host_resource.h" |
37 #include "ppapi/shared_impl/input_event_impl.h" | 37 #include "ppapi/shared_impl/input_event_impl.h" |
38 #include "ppapi/shared_impl/url_request_info_impl.h" | 38 #include "ppapi/shared_impl/url_request_info_impl.h" |
39 #include "ppapi/shared_impl/var.h" | 39 #include "ppapi/shared_impl/var.h" |
40 #include "ppapi/thunk/enter.h" | 40 #include "ppapi/thunk/enter.h" |
41 #include "ppapi/thunk/ppb_image_data_api.h" | 41 #include "ppapi/thunk/ppb_image_data_api.h" |
42 | 42 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 const PP_Size& size, | 183 const PP_Size& size, |
184 PP_Bool init_to_zero) { | 184 PP_Bool init_to_zero) { |
185 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 185 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
186 if (!dispatcher) | 186 if (!dispatcher) |
187 return 0; | 187 return 0; |
188 | 188 |
189 HostResource result; | 189 HostResource result; |
190 std::string image_data_desc; | 190 std::string image_data_desc; |
191 ImageHandle image_handle = ImageData::NullHandle; | 191 ImageHandle image_handle = ImageData::NullHandle; |
192 dispatcher->Send(new PpapiHostMsg_ResourceCreation_ImageData( | 192 dispatcher->Send(new PpapiHostMsg_ResourceCreation_ImageData( |
193 INTERFACE_ID_RESOURCE_CREATION, instance, format, size, init_to_zero, | 193 API_ID_RESOURCE_CREATION, instance, format, size, init_to_zero, |
194 &result, &image_data_desc, &image_handle)); | 194 &result, &image_data_desc, &image_handle)); |
195 | 195 |
196 if (result.is_null() || image_data_desc.size() != sizeof(PP_ImageDataDesc)) | 196 if (result.is_null() || image_data_desc.size() != sizeof(PP_ImageDataDesc)) |
197 return 0; | 197 return 0; |
198 | 198 |
199 // We serialize the PP_ImageDataDesc just by copying to a string. | 199 // We serialize the PP_ImageDataDesc just by copying to a string. |
200 PP_ImageDataDesc desc; | 200 PP_ImageDataDesc desc; |
201 memcpy(&desc, image_data_desc.data(), sizeof(PP_ImageDataDesc)); | 201 memcpy(&desc, image_data_desc.data(), sizeof(PP_ImageDataDesc)); |
202 | 202 |
203 return (new ImageData(result, desc, image_handle))->GetReference(); | 203 return (new ImageData(result, desc, image_handle))->GetReference(); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 *result_image_handle = dispatcher()->ShareHandleWithRemote(ih, false); | 416 *result_image_handle = dispatcher()->ShareHandleWithRemote(ih, false); |
417 #else | 417 #else |
418 *result_image_handle = ImageData::HandleFromInt(handle); | 418 *result_image_handle = ImageData::HandleFromInt(handle); |
419 #endif | 419 #endif |
420 } | 420 } |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 } // namespace proxy | 424 } // namespace proxy |
425 } // namespace ppapi | 425 } // namespace ppapi |
OLD | NEW |