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_file_system_impl.h" | |
18 #include "webkit/plugins/ppapi/ppb_flash_message_loop_impl.h" | 17 #include "webkit/plugins/ppapi/ppb_flash_message_loop_impl.h" |
19 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" | 18 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" |
20 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 19 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
21 #include "webkit/plugins/ppapi/ppb_network_monitor_private_impl.h" | 20 #include "webkit/plugins/ppapi/ppb_network_monitor_private_impl.h" |
22 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" | 21 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" |
23 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" | 22 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" |
24 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" | 23 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" |
25 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" | 24 #include "webkit/plugins/ppapi/ppb_url_loader_impl.h" |
26 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 25 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
27 #include "webkit/plugins/ppapi/ppb_x509_certificate_private_impl.h" | 26 #include "webkit/plugins/ppapi/ppb_x509_certificate_private_impl.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 uint32_t size) { | 74 uint32_t size) { |
76 return PPB_Buffer_Impl::Create(instance, size); | 75 return PPB_Buffer_Impl::Create(instance, size); |
77 } | 76 } |
78 | 77 |
79 PP_Resource ResourceCreationImpl::CreateDirectoryReader( | 78 PP_Resource ResourceCreationImpl::CreateDirectoryReader( |
80 PP_Instance instance, | 79 PP_Instance instance, |
81 PP_Resource directory_ref) { | 80 PP_Resource directory_ref) { |
82 return 0; // Not supported in-process. | 81 return 0; // Not supported in-process. |
83 } | 82 } |
84 | 83 |
85 PP_Resource ResourceCreationImpl::CreateFileRef(PP_Resource file_system, | 84 PP_Resource ResourceCreationImpl::CreateFileRef( |
86 const char* path) { | |
87 PPB_FileRef_Impl* res = PPB_FileRef_Impl::CreateInternal(file_system, path); | |
88 return res ? res->GetReference() : 0; | |
89 } | |
90 | |
91 PP_Resource ResourceCreationImpl::CreateFileSystem( | |
92 PP_Instance instance, | 85 PP_Instance instance, |
93 PP_FileSystemType type) { | 86 PP_Resource file_system, |
94 return PPB_FileSystem_Impl::Create(instance, type); | 87 const char* path) { |
88 PPB_FileRef_Impl* res = PPB_FileRef_Impl::CreateInternal( | |
89 instance, file_system, path); | |
90 if (!res) | |
91 return 0; | |
92 res->AddFileSystemRefCount(); | |
yzshen1
2013/04/11 17:04:57
This method will also get run for the renderer sid
victorhsieh
2013/04/11 18:24:38
I thought this is only used in process (only used
| |
93 return res->GetReference(); | |
95 } | 94 } |
96 | 95 |
97 PP_Resource ResourceCreationImpl::CreateFlashDeviceID(PP_Instance instance) { | 96 PP_Resource ResourceCreationImpl::CreateFlashDeviceID(PP_Instance instance) { |
98 return 0; // Not supported in-process. | 97 return 0; // Not supported in-process. |
99 } | 98 } |
100 | 99 |
101 PP_Resource ResourceCreationImpl::CreateFlashFontFile( | 100 PP_Resource ResourceCreationImpl::CreateFlashFontFile( |
102 PP_Instance instance, | 101 PP_Instance instance, |
103 const PP_BrowserFont_Trusted_Description* description, | 102 const PP_BrowserFont_Trusted_Description* description, |
104 PP_PrivateFontCharset charset) { | 103 PP_PrivateFontCharset charset) { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 wheel_delta, wheel_ticks, scroll_by_page); | 264 wheel_delta, wheel_ticks, scroll_by_page); |
266 } | 265 } |
267 | 266 |
268 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( | 267 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( |
269 PP_Instance instance) { | 268 PP_Instance instance) { |
270 return PPB_X509Certificate_Private_Impl::CreateResource(instance); | 269 return PPB_X509Certificate_Private_Impl::CreateResource(instance); |
271 } | 270 } |
272 | 271 |
273 } // namespace ppapi | 272 } // namespace ppapi |
274 } // namespace webkit | 273 } // namespace webkit |
OLD | NEW |