| 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/host_resource.h" | 9 #include "ppapi/proxy/host_resource.h" |
| 10 #include "ppapi/proxy/interface_id.h" | 10 #include "ppapi/proxy/interface_id.h" |
| 11 #include "ppapi/proxy/plugin_dispatcher.h" | 11 #include "ppapi/proxy/plugin_dispatcher.h" |
| 12 #include "ppapi/c/trusted/ppb_image_data_trusted.h" | 12 #include "ppapi/c/trusted/ppb_image_data_trusted.h" |
| 13 #include "ppapi/proxy/plugin_resource_tracker.h" | 13 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 14 #include "ppapi/proxy/ppapi_messages.h" | 14 #include "ppapi/proxy/ppapi_messages.h" |
| 15 #include "ppapi/proxy/ppb_audio_config_proxy.h" | 15 #include "ppapi/proxy/ppb_audio_config_proxy.h" |
| 16 #include "ppapi/proxy/ppb_audio_proxy.h" | 16 #include "ppapi/proxy/ppb_audio_proxy.h" |
| 17 #include "ppapi/proxy/ppb_buffer_proxy.h" | 17 #include "ppapi/proxy/ppb_buffer_proxy.h" |
| 18 #include "ppapi/proxy/ppb_broker_proxy.h" | 18 #include "ppapi/proxy/ppb_broker_proxy.h" |
| 19 #include "ppapi/proxy/ppb_context_3d_proxy.h" |
| 19 #include "ppapi/proxy/ppb_file_chooser_proxy.h" | 20 #include "ppapi/proxy/ppb_file_chooser_proxy.h" |
| 20 #include "ppapi/proxy/ppb_file_ref_proxy.h" | 21 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
| 21 #include "ppapi/proxy/ppb_file_system_proxy.h" | 22 #include "ppapi/proxy/ppb_file_system_proxy.h" |
| 22 #include "ppapi/proxy/ppb_flash_menu_proxy.h" | 23 #include "ppapi/proxy/ppb_flash_menu_proxy.h" |
| 23 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" | 24 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" |
| 24 #include "ppapi/proxy/ppb_font_proxy.h" | 25 #include "ppapi/proxy/ppb_font_proxy.h" |
| 25 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" | 26 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" |
| 26 #include "ppapi/proxy/ppb_image_data_proxy.h" | 27 #include "ppapi/proxy/ppb_image_data_proxy.h" |
| 28 #include "ppapi/proxy/ppb_surface_3d_proxy.h" |
| 27 #include "ppapi/proxy/ppb_url_loader_proxy.h" | 29 #include "ppapi/proxy/ppb_url_loader_proxy.h" |
| 28 #include "ppapi/proxy/ppb_url_request_info_proxy.h" | 30 #include "ppapi/proxy/ppb_url_request_info_proxy.h" |
| 29 #include "ppapi/shared_impl/font_impl.h" | 31 #include "ppapi/shared_impl/font_impl.h" |
| 30 #include "ppapi/shared_impl/function_group_base.h" | 32 #include "ppapi/shared_impl/function_group_base.h" |
| 31 #include "ppapi/thunk/enter.h" | 33 #include "ppapi/thunk/enter.h" |
| 32 #include "ppapi/thunk/ppb_image_data_api.h" | 34 #include "ppapi/thunk/ppb_image_data_api.h" |
| 33 | 35 |
| 34 using ppapi::thunk::ResourceCreationAPI; | 36 using ppapi::thunk::ResourceCreationAPI; |
| 35 | 37 |
| 36 namespace pp { | 38 namespace pp { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 73 |
| 72 PP_Resource ResourceCreationProxy::CreateBroker(PP_Instance instance) { | 74 PP_Resource ResourceCreationProxy::CreateBroker(PP_Instance instance) { |
| 73 return PPB_Broker_Proxy::CreateProxyResource(instance); | 75 return PPB_Broker_Proxy::CreateProxyResource(instance); |
| 74 } | 76 } |
| 75 | 77 |
| 76 PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance, | 78 PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance, |
| 77 uint32_t size) { | 79 uint32_t size) { |
| 78 return PPB_Buffer_Proxy::CreateProxyResource(instance, size); | 80 return PPB_Buffer_Proxy::CreateProxyResource(instance, size); |
| 79 } | 81 } |
| 80 | 82 |
| 83 PP_Resource ResourceCreationProxy::CreateContext3D( |
| 84 PP_Instance instance, |
| 85 PP_Config3D_Dev config, |
| 86 PP_Resource share_context, |
| 87 const int32_t* attrib_list) { |
| 88 return PPB_Context3D_Proxy::Create(instance, config, share_context, |
| 89 attrib_list); |
| 90 } |
| 91 |
| 92 PP_Resource ResourceCreationProxy::CreateContext3DRaw( |
| 93 PP_Instance instance, |
| 94 PP_Config3D_Dev config, |
| 95 PP_Resource share_context, |
| 96 const int32_t* attrib_list) { |
| 97 // Not proxied. The raw creation function is used only in the implementation |
| 98 // of the proxy on the host side. |
| 99 return 0; |
| 100 } |
| 101 |
| 81 PP_Resource ResourceCreationProxy::CreateDirectoryReader( | 102 PP_Resource ResourceCreationProxy::CreateDirectoryReader( |
| 82 PP_Resource directory_ref) { | 103 PP_Resource directory_ref) { |
| 83 // Not proxied yet. | 104 NOTIMPLEMENTED(); // Not proxied yet. |
| 84 return 0; | 105 return 0; |
| 85 } | 106 } |
| 86 | 107 |
| 87 PP_Resource ResourceCreationProxy::CreateFileChooser( | 108 PP_Resource ResourceCreationProxy::CreateFileChooser( |
| 88 PP_Instance instance, | 109 PP_Instance instance, |
| 89 const PP_FileChooserOptions_Dev* options) { | 110 const PP_FileChooserOptions_Dev* options) { |
| 90 return PPB_FileChooser_Proxy::CreateProxyResource(instance, options); | 111 return PPB_FileChooser_Proxy::CreateProxyResource(instance, options); |
| 91 } | 112 } |
| 92 | 113 |
| 93 PP_Resource ResourceCreationProxy::CreateFileIO(PP_Instance instance) { | 114 PP_Resource ResourceCreationProxy::CreateFileIO(PP_Instance instance) { |
| 94 // Not proxied yet. | 115 NOTIMPLEMENTED(); // Not proxied yet. |
| 95 return 0; | 116 return 0; |
| 96 } | 117 } |
| 97 | 118 |
| 98 PP_Resource ResourceCreationProxy::CreateFileRef(PP_Resource file_system, | 119 PP_Resource ResourceCreationProxy::CreateFileRef(PP_Resource file_system, |
| 99 const char* path) { | 120 const char* path) { |
| 100 return PPB_FileRef_Proxy::CreateProxyResource(file_system, path); | 121 return PPB_FileRef_Proxy::CreateProxyResource(file_system, path); |
| 101 } | 122 } |
| 102 | 123 |
| 103 PP_Resource ResourceCreationProxy::CreateFileSystem( | 124 PP_Resource ResourceCreationProxy::CreateFileSystem( |
| 104 PP_Instance instance, | 125 PP_Instance instance, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 return 0; | 175 return 0; |
| 155 | 176 |
| 156 // We serialize the PP_ImageDataDesc just by copying to a string. | 177 // We serialize the PP_ImageDataDesc just by copying to a string. |
| 157 PP_ImageDataDesc desc; | 178 PP_ImageDataDesc desc; |
| 158 memcpy(&desc, image_data_desc.data(), sizeof(PP_ImageDataDesc)); | 179 memcpy(&desc, image_data_desc.data(), sizeof(PP_ImageDataDesc)); |
| 159 | 180 |
| 160 linked_ptr<ImageData> object(new ImageData(result, desc, image_handle)); | 181 linked_ptr<ImageData> object(new ImageData(result, desc, image_handle)); |
| 161 return PluginResourceTracker::GetInstance()->AddResource(object); | 182 return PluginResourceTracker::GetInstance()->AddResource(object); |
| 162 } | 183 } |
| 163 | 184 |
| 185 PP_Resource ResourceCreationProxy::CreateGraphics3D( |
| 186 PP_Instance instance, |
| 187 PP_Config3D_Dev config, |
| 188 PP_Resource share_context, |
| 189 const int32_t* attrib_list) { |
| 190 NOTIMPLEMENTED(); // Not proxied yet. |
| 191 return 0; |
| 192 } |
| 193 |
| 164 PP_Resource ResourceCreationProxy::CreateSurface3D( | 194 PP_Resource ResourceCreationProxy::CreateSurface3D( |
| 165 PP_Instance instance, | 195 PP_Instance instance, |
| 166 PP_Config3D_Dev config, | 196 PP_Config3D_Dev config, |
| 167 const int32_t* attrib_list) { | 197 const int32_t* attrib_list) { |
| 168 NOTREACHED(); | 198 return PPB_Surface3D_Proxy::CreateProxyResource(instance, config, |
| 199 attrib_list); |
| 200 } |
| 201 |
| 202 PP_Resource ResourceCreationProxy::CreateTransport(PP_Instance instance, |
| 203 const char* name, |
| 204 const char* proto) { |
| 205 NOTIMPLEMENTED(); // Not proxied yet. |
| 169 return 0; | 206 return 0; |
| 170 } | 207 } |
| 171 | 208 |
| 172 PP_Resource ResourceCreationProxy::CreateURLLoader(PP_Instance instance) { | 209 PP_Resource ResourceCreationProxy::CreateURLLoader(PP_Instance instance) { |
| 173 return PPB_URLLoader_Proxy::CreateProxyResource(instance); | 210 return PPB_URLLoader_Proxy::CreateProxyResource(instance); |
| 174 } | 211 } |
| 175 | 212 |
| 176 PP_Resource ResourceCreationProxy::CreateURLRequestInfo(PP_Instance instance) { | 213 PP_Resource ResourceCreationProxy::CreateURLRequestInfo(PP_Instance instance) { |
| 177 return PPB_URLRequestInfo_Proxy::CreateProxyResource(instance); | 214 return PPB_URLRequestInfo_Proxy::CreateProxyResource(instance); |
| 178 } | 215 } |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 *result_image_handle = dispatcher_->ShareHandleWithRemote(ih, false); | 295 *result_image_handle = dispatcher_->ShareHandleWithRemote(ih, false); |
| 259 #else | 296 #else |
| 260 *result_image_handle = ImageData::HandleFromInt(handle); | 297 *result_image_handle = ImageData::HandleFromInt(handle); |
| 261 #endif | 298 #endif |
| 262 } | 299 } |
| 263 } | 300 } |
| 264 } | 301 } |
| 265 | 302 |
| 266 } // namespace proxy | 303 } // namespace proxy |
| 267 } // namespace pp | 304 } // namespace pp |
| OLD | NEW |