| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 226 } |
| 221 | 227 |
| 222 PP_Resource ResourceCreationImpl::CreateTCPSocketPrivate(PP_Instance instance) { | 228 PP_Resource ResourceCreationImpl::CreateTCPSocketPrivate(PP_Instance instance) { |
| 223 return PPB_TCPSocket_Private_Impl::CreateResource(instance); | 229 return PPB_TCPSocket_Private_Impl::CreateResource(instance); |
| 224 } | 230 } |
| 225 | 231 |
| 226 PP_Resource ResourceCreationImpl::CreateUDPSocketPrivate(PP_Instance instance) { | 232 PP_Resource ResourceCreationImpl::CreateUDPSocketPrivate(PP_Instance instance) { |
| 227 return 0; // Not supported in-process. | 233 return 0; // Not supported in-process. |
| 228 } | 234 } |
| 229 | 235 |
| 230 PP_Resource ResourceCreationImpl::CreateURLLoader(PP_Instance instance) { | |
| 231 return (new PPB_URLLoader_Impl(instance, false))->GetReference(); | |
| 232 } | |
| 233 | |
| 234 PP_Resource ResourceCreationImpl::CreateVideoCapture(PP_Instance instance) { | 236 PP_Resource ResourceCreationImpl::CreateVideoCapture(PP_Instance instance) { |
| 235 return 0; // VideoCapture is not supported in process now. | 237 return 0; // VideoCapture is not supported in process now. |
| 236 } | 238 } |
| 237 | 239 |
| 238 PP_Resource ResourceCreationImpl::CreateVideoDecoder( | 240 PP_Resource ResourceCreationImpl::CreateVideoDecoder( |
| 239 PP_Instance instance, | 241 PP_Instance instance, |
| 240 PP_Resource graphics3d_id, | 242 PP_Resource graphics3d_id, |
| 241 PP_VideoDecoder_Profile profile) { | 243 PP_VideoDecoder_Profile profile) { |
| 242 return PPB_VideoDecoder_Impl::Create(instance, graphics3d_id, profile); | 244 return PPB_VideoDecoder_Impl::Create(instance, graphics3d_id, profile); |
| 243 } | 245 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 264 wheel_delta, wheel_ticks, scroll_by_page); | 266 wheel_delta, wheel_ticks, scroll_by_page); |
| 265 } | 267 } |
| 266 | 268 |
| 267 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( | 269 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( |
| 268 PP_Instance instance) { | 270 PP_Instance instance) { |
| 269 return PPB_X509Certificate_Private_Impl::CreateResource(instance); | 271 return PPB_X509Certificate_Private_Impl::CreateResource(instance); |
| 270 } | 272 } |
| 271 | 273 |
| 272 } // namespace ppapi | 274 } // namespace ppapi |
| 273 } // namespace webkit | 275 } // namespace webkit |
| OLD | NEW |