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_file_ref_impl.h" | 16 #include "webkit/plugins/ppapi/ppb_file_ref_impl.h" |
17 #include "webkit/plugins/ppapi/ppb_flash_message_loop_impl.h" | 17 #include "webkit/plugins/ppapi/ppb_flash_message_loop_impl.h" |
18 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" | 18 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" |
19 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 19 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
20 #include "webkit/plugins/ppapi/ppb_network_monitor_private_impl.h" | 20 #include "webkit/plugins/ppapi/ppb_network_monitor_private_impl.h" |
21 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" | 21 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" |
22 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" | 22 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" |
23 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" | 23 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" |
24 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | |
25 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 24 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
26 #include "webkit/plugins/ppapi/ppb_x509_certificate_private_impl.h" | 25 #include "webkit/plugins/ppapi/ppb_x509_certificate_private_impl.h" |
27 #include "webkit/plugins/ppapi/resource_helper.h" | 26 #include "webkit/plugins/ppapi/resource_helper.h" |
28 | 27 |
29 using ppapi::InputEventData; | 28 using ppapi::InputEventData; |
30 using ppapi::PPB_InputEvent_Shared; | 29 using ppapi::PPB_InputEvent_Shared; |
31 using ppapi::PPB_ResourceArray_Shared; | 30 using ppapi::PPB_ResourceArray_Shared; |
32 using ppapi::StringVar; | 31 using ppapi::StringVar; |
33 | 32 |
34 namespace webkit { | 33 namespace webkit { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 76 |
78 PP_Resource ResourceCreationImpl::CreateFileRef( | 77 PP_Resource ResourceCreationImpl::CreateFileRef( |
79 PP_Instance instance, | 78 PP_Instance instance, |
80 PP_Resource file_system, | 79 PP_Resource file_system, |
81 const char* path) { | 80 const char* path) { |
82 PPB_FileRef_Impl* res = PPB_FileRef_Impl::CreateInternal( | 81 PPB_FileRef_Impl* res = PPB_FileRef_Impl::CreateInternal( |
83 instance, file_system, path); | 82 instance, file_system, path); |
84 return res ? res->GetReference() : 0; | 83 return res ? res->GetReference() : 0; |
85 } | 84 } |
86 | 85 |
| 86 PP_Resource ResourceCreationImpl::CreateFileRef( |
| 87 const ::ppapi::PPB_FileRef_CreateInfo& serialized) { |
| 88 // When we're in-process, the host resource in the create info *is* the |
| 89 // resource, so we don't need to do anything. |
| 90 return serialized.resource.host_resource(); |
| 91 } |
| 92 |
87 PP_Resource ResourceCreationImpl::CreateFlashDeviceID(PP_Instance instance) { | 93 PP_Resource ResourceCreationImpl::CreateFlashDeviceID(PP_Instance instance) { |
88 return 0; // Not supported in-process. | 94 return 0; // Not supported in-process. |
89 } | 95 } |
90 | 96 |
91 PP_Resource ResourceCreationImpl::CreateFlashFontFile( | 97 PP_Resource ResourceCreationImpl::CreateFlashFontFile( |
92 PP_Instance instance, | 98 PP_Instance instance, |
93 const PP_BrowserFont_Trusted_Description* description, | 99 const PP_BrowserFont_Trusted_Description* description, |
94 PP_PrivateFontCharset charset) { | 100 PP_PrivateFontCharset charset) { |
95 return 0; // Not supported in-process. | 101 return 0; // Not supported in-process. |
96 } | 102 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 232 } |
227 | 233 |
228 PP_Resource ResourceCreationImpl::CreateTCPSocketPrivate(PP_Instance instance) { | 234 PP_Resource ResourceCreationImpl::CreateTCPSocketPrivate(PP_Instance instance) { |
229 return PPB_TCPSocket_Private_Impl::CreateResource(instance); | 235 return PPB_TCPSocket_Private_Impl::CreateResource(instance); |
230 } | 236 } |
231 | 237 |
232 PP_Resource ResourceCreationImpl::CreateUDPSocketPrivate(PP_Instance instance) { | 238 PP_Resource ResourceCreationImpl::CreateUDPSocketPrivate(PP_Instance instance) { |
233 return 0; // Not supported in-process. | 239 return 0; // Not supported in-process. |
234 } | 240 } |
235 | 241 |
236 PP_Resource ResourceCreationImpl::CreateURLLoader(PP_Instance instance) { | |
237 return (new PPB_URLLoader_Impl(instance, false))->GetReference(); | |
238 } | |
239 | |
240 PP_Resource ResourceCreationImpl::CreateVideoCapture(PP_Instance instance) { | 242 PP_Resource ResourceCreationImpl::CreateVideoCapture(PP_Instance instance) { |
241 return 0; // VideoCapture is not supported in process now. | 243 return 0; // VideoCapture is not supported in process now. |
242 } | 244 } |
243 | 245 |
244 PP_Resource ResourceCreationImpl::CreateVideoDecoder( | 246 PP_Resource ResourceCreationImpl::CreateVideoDecoder( |
245 PP_Instance instance, | 247 PP_Instance instance, |
246 PP_Resource graphics3d_id, | 248 PP_Resource graphics3d_id, |
247 PP_VideoDecoder_Profile profile) { | 249 PP_VideoDecoder_Profile profile) { |
248 return PPB_VideoDecoder_Impl::Create(instance, graphics3d_id, profile); | 250 return PPB_VideoDecoder_Impl::Create(instance, graphics3d_id, profile); |
249 } | 251 } |
(...skipping 20 matching lines...) Expand all Loading... |
270 wheel_delta, wheel_ticks, scroll_by_page); | 272 wheel_delta, wheel_ticks, scroll_by_page); |
271 } | 273 } |
272 | 274 |
273 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( | 275 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( |
274 PP_Instance instance) { | 276 PP_Instance instance) { |
275 return PPB_X509Certificate_Private_Impl::CreateResource(instance); | 277 return PPB_X509Certificate_Private_Impl::CreateResource(instance); |
276 } | 278 } |
277 | 279 |
278 } // namespace ppapi | 280 } // namespace ppapi |
279 } // namespace webkit | 281 } // namespace webkit |
OLD | NEW |