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 "webkit/plugins/ppapi/resource_creation_impl.h" | 5 #include "webkit/plugins/ppapi/resource_creation_impl.h" |
6 | 6 |
7 #include "ppapi/c/pp_size.h" | 7 #include "ppapi/c/pp_size.h" |
8 #include "ppapi/shared_impl/ppb_audio_config_shared.h" | 8 #include "ppapi/shared_impl/ppb_audio_config_shared.h" |
9 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 9 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
10 #include "ppapi/shared_impl/ppb_resource_array_shared.h" | 10 #include "ppapi/shared_impl/ppb_resource_array_shared.h" |
11 #include "ppapi/shared_impl/var.h" | 11 #include "ppapi/shared_impl/var.h" |
12 #include "webkit/plugins/ppapi/common.h" | 12 #include "webkit/plugins/ppapi/common.h" |
13 #include "webkit/plugins/ppapi/ppb_audio_impl.h" | 13 #include "webkit/plugins/ppapi/ppb_audio_impl.h" |
14 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 14 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
15 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" | 15 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" |
16 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" | 16 #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" |
17 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | 17 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
18 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" | 18 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" |
19 #include "webkit/plugins/ppapi/ppb_file_system_impl.h" | 19 #include "webkit/plugins/ppapi/ppb_file_system_impl.h" |
20 #include "webkit/plugins/ppapi/ppb_flash_message_loop_impl.h" | 20 #include "webkit/plugins/ppapi/ppb_flash_message_loop_impl.h" |
21 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" | 21 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" |
22 #include "webkit/plugins/ppapi/ppb_host_resolver_private_impl.h" | 22 #include "webkit/plugins/ppapi/ppb_host_resolver_private_impl.h" |
23 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 23 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
24 #include "webkit/plugins/ppapi/ppb_network_monitor_private_impl.h" | 24 #include "webkit/plugins/ppapi/ppb_network_monitor_private_impl.h" |
25 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" | 25 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" |
26 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" | 26 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" |
27 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" | 27 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" |
28 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" | 28 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" |
29 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | |
30 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 29 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
31 #include "webkit/plugins/ppapi/ppb_x509_certificate_private_impl.h" | 30 #include "webkit/plugins/ppapi/ppb_x509_certificate_private_impl.h" |
32 #include "webkit/plugins/ppapi/resource_helper.h" | 31 #include "webkit/plugins/ppapi/resource_helper.h" |
33 | 32 |
34 using ppapi::InputEventData; | 33 using ppapi::InputEventData; |
35 using ppapi::PPB_InputEvent_Shared; | 34 using ppapi::PPB_InputEvent_Shared; |
36 using ppapi::PPB_ResourceArray_Shared; | 35 using ppapi::PPB_ResourceArray_Shared; |
37 using ppapi::StringVar; | 36 using ppapi::StringVar; |
38 | 37 |
39 namespace webkit { | 38 namespace webkit { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 PP_Resource ResourceCreationImpl::CreateFileIO(PP_Instance instance) { | 87 PP_Resource ResourceCreationImpl::CreateFileIO(PP_Instance instance) { |
89 return (new PPB_FileIO_Impl(instance))->GetReference(); | 88 return (new PPB_FileIO_Impl(instance))->GetReference(); |
90 } | 89 } |
91 | 90 |
92 PP_Resource ResourceCreationImpl::CreateFileRef(PP_Resource file_system, | 91 PP_Resource ResourceCreationImpl::CreateFileRef(PP_Resource file_system, |
93 const char* path) { | 92 const char* path) { |
94 PPB_FileRef_Impl* res = PPB_FileRef_Impl::CreateInternal(file_system, path); | 93 PPB_FileRef_Impl* res = PPB_FileRef_Impl::CreateInternal(file_system, path); |
95 return res ? res->GetReference() : 0; | 94 return res ? res->GetReference() : 0; |
96 } | 95 } |
97 | 96 |
| 97 PP_Resource ResourceCreationImpl::CreateFileRef( |
| 98 const ::ppapi::PPB_FileRef_CreateInfo& serialized) { |
| 99 // When we're in-process, the host resource in the create info *is* the |
| 100 // resource, so we don't need to do anything. |
| 101 return serialized.resource.host_resource(); |
| 102 } |
| 103 |
98 PP_Resource ResourceCreationImpl::CreateFileSystem( | 104 PP_Resource ResourceCreationImpl::CreateFileSystem( |
99 PP_Instance instance, | 105 PP_Instance instance, |
100 PP_FileSystemType type) { | 106 PP_FileSystemType type) { |
101 return PPB_FileSystem_Impl::Create(instance, type); | 107 return PPB_FileSystem_Impl::Create(instance, type); |
102 } | 108 } |
103 | 109 |
104 PP_Resource ResourceCreationImpl::CreateFlashDeviceID(PP_Instance instance) { | 110 PP_Resource ResourceCreationImpl::CreateFlashDeviceID(PP_Instance instance) { |
105 return 0; // Not supported in-process. | 111 return 0; // Not supported in-process. |
106 } | 112 } |
107 | 113 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 244 } |
239 | 245 |
240 PP_Resource ResourceCreationImpl::CreateTCPSocketPrivate(PP_Instance instance) { | 246 PP_Resource ResourceCreationImpl::CreateTCPSocketPrivate(PP_Instance instance) { |
241 return PPB_TCPSocket_Private_Impl::CreateResource(instance); | 247 return PPB_TCPSocket_Private_Impl::CreateResource(instance); |
242 } | 248 } |
243 | 249 |
244 PP_Resource ResourceCreationImpl::CreateUDPSocketPrivate(PP_Instance instance) { | 250 PP_Resource ResourceCreationImpl::CreateUDPSocketPrivate(PP_Instance instance) { |
245 return PPB_UDPSocket_Private_Impl::CreateResource(instance); | 251 return PPB_UDPSocket_Private_Impl::CreateResource(instance); |
246 } | 252 } |
247 | 253 |
248 PP_Resource ResourceCreationImpl::CreateURLLoader(PP_Instance instance) { | |
249 return (new PPB_URLLoader_Impl(instance, false))->GetReference(); | |
250 } | |
251 | |
252 PP_Resource ResourceCreationImpl::CreateVideoCapture(PP_Instance instance) { | 254 PP_Resource ResourceCreationImpl::CreateVideoCapture(PP_Instance instance) { |
253 return 0; // VideoCapture is not supported in process now. | 255 return 0; // VideoCapture is not supported in process now. |
254 } | 256 } |
255 | 257 |
256 PP_Resource ResourceCreationImpl::CreateVideoDecoder( | 258 PP_Resource ResourceCreationImpl::CreateVideoDecoder( |
257 PP_Instance instance, | 259 PP_Instance instance, |
258 PP_Resource graphics3d_id, | 260 PP_Resource graphics3d_id, |
259 PP_VideoDecoder_Profile profile) { | 261 PP_VideoDecoder_Profile profile) { |
260 return PPB_VideoDecoder_Impl::Create(instance, graphics3d_id, profile); | 262 return PPB_VideoDecoder_Impl::Create(instance, graphics3d_id, profile); |
261 } | 263 } |
(...skipping 10 matching lines...) Expand all Loading... |
272 wheel_delta, wheel_ticks, scroll_by_page); | 274 wheel_delta, wheel_ticks, scroll_by_page); |
273 } | 275 } |
274 | 276 |
275 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( | 277 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( |
276 PP_Instance instance) { | 278 PP_Instance instance) { |
277 return PPB_X509Certificate_Private_Impl::CreateResource(instance); | 279 return PPB_X509Certificate_Private_Impl::CreateResource(instance); |
278 } | 280 } |
279 | 281 |
280 } // namespace ppapi | 282 } // namespace ppapi |
281 } // namespace webkit | 283 } // namespace webkit |
OLD | NEW |