Chromium Code Reviews| 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 "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/c/trusted/ppb_image_data_trusted.h" | 9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" |
| 10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
| 11 #include "ppapi/proxy/plugin_resource_tracker.h" | 11 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 12 #include "ppapi/proxy/ppapi_messages.h" | 12 #include "ppapi/proxy/ppapi_messages.h" |
| 13 #include "ppapi/proxy/ppb_audio_input_proxy.h" | 13 #include "ppapi/proxy/ppb_audio_input_proxy.h" |
| 14 #include "ppapi/proxy/ppb_audio_proxy.h" | 14 #include "ppapi/proxy/ppb_audio_proxy.h" |
| 15 #include "ppapi/proxy/ppb_buffer_proxy.h" | 15 #include "ppapi/proxy/ppb_buffer_proxy.h" |
| 16 #include "ppapi/proxy/ppb_broker_proxy.h" | 16 #include "ppapi/proxy/ppb_broker_proxy.h" |
| 17 #include "ppapi/proxy/ppb_file_chooser_proxy.h" | 17 #include "ppapi/proxy/ppb_file_chooser_proxy.h" |
| 18 #include "ppapi/proxy/ppb_file_io_proxy.h" | 18 #include "ppapi/proxy/ppb_file_io_proxy.h" |
| 19 #include "ppapi/proxy/ppb_file_ref_proxy.h" | 19 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
| 20 #include "ppapi/proxy/ppb_file_system_proxy.h" | 20 #include "ppapi/proxy/ppb_file_system_proxy.h" |
| 21 #include "ppapi/proxy/ppb_flash_menu_proxy.h" | 21 #include "ppapi/proxy/ppb_flash_menu_proxy.h" |
| 22 #include "ppapi/proxy/ppb_flash_message_loop_proxy.h" | 22 #include "ppapi/proxy/ppb_flash_message_loop_proxy.h" |
| 23 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" | 23 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" |
| 24 #include "ppapi/proxy/ppb_font_proxy.h" | |
| 25 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" | 24 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" |
| 26 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" | 25 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" |
| 27 #include "ppapi/proxy/ppb_image_data_proxy.h" | 26 #include "ppapi/proxy/ppb_image_data_proxy.h" |
| 28 #include "ppapi/proxy/ppb_tcp_socket_private_proxy.h" | 27 #include "ppapi/proxy/ppb_tcp_socket_private_proxy.h" |
| 29 #include "ppapi/proxy/ppb_udp_socket_private_proxy.h" | 28 #include "ppapi/proxy/ppb_udp_socket_private_proxy.h" |
| 30 #include "ppapi/proxy/ppb_url_loader_proxy.h" | 29 #include "ppapi/proxy/ppb_url_loader_proxy.h" |
| 31 #include "ppapi/proxy/ppb_video_capture_proxy.h" | 30 #include "ppapi/proxy/ppb_video_capture_proxy.h" |
| 32 #include "ppapi/proxy/ppb_video_decoder_proxy.h" | 31 #include "ppapi/proxy/ppb_video_decoder_proxy.h" |
| 33 #include "ppapi/shared_impl/api_id.h" | 32 #include "ppapi/shared_impl/api_id.h" |
| 34 #include "ppapi/shared_impl/function_group_base.h" | 33 #include "ppapi/shared_impl/function_group_base.h" |
| 35 #include "ppapi/shared_impl/host_resource.h" | 34 #include "ppapi/shared_impl/host_resource.h" |
| 36 #include "ppapi/shared_impl/ppb_audio_config_shared.h" | 35 #include "ppapi/shared_impl/ppb_audio_config_shared.h" |
| 37 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 36 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
| 38 #include "ppapi/shared_impl/ppb_resource_array_shared.h" | 37 #include "ppapi/shared_impl/ppb_resource_array_shared.h" |
| 39 #include "ppapi/shared_impl/ppb_url_request_info_shared.h" | 38 #include "ppapi/shared_impl/ppb_url_request_info_shared.h" |
| 40 #include "ppapi/shared_impl/private/ppb_font_shared.h" | 39 #include "ppapi/shared_impl/private/ppb_browser_font_trusted_shared.h" |
|
viettrungluu
2012/02/14 22:29:42
Errrr, you forgot to add this to the CL.
brettw
2012/02/14 23:45:05
Uploaded.
| |
| 41 #include "ppapi/shared_impl/var.h" | 40 #include "ppapi/shared_impl/var.h" |
| 42 #include "ppapi/thunk/enter.h" | 41 #include "ppapi/thunk/enter.h" |
| 43 #include "ppapi/thunk/ppb_image_data_api.h" | 42 #include "ppapi/thunk/ppb_image_data_api.h" |
| 44 | 43 |
| 45 using ppapi::thunk::ResourceCreationAPI; | 44 using ppapi::thunk::ResourceCreationAPI; |
| 46 | 45 |
| 47 namespace ppapi { | 46 namespace ppapi { |
| 48 namespace proxy { | 47 namespace proxy { |
| 49 | 48 |
| 50 ResourceCreationProxy::ResourceCreationProxy(Dispatcher* dispatcher) | 49 ResourceCreationProxy::ResourceCreationProxy(Dispatcher* dispatcher) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 PP_Resource ResourceCreationProxy::CreateAudioInputTrusted( | 97 PP_Resource ResourceCreationProxy::CreateAudioInputTrusted( |
| 99 PP_Instance instance) { | 98 PP_Instance instance) { |
| 100 // Proxied plugins can't created trusted audio input devices. | 99 // Proxied plugins can't created trusted audio input devices. |
| 101 return 0; | 100 return 0; |
| 102 } | 101 } |
| 103 | 102 |
| 104 PP_Resource ResourceCreationProxy::CreateBroker(PP_Instance instance) { | 103 PP_Resource ResourceCreationProxy::CreateBroker(PP_Instance instance) { |
| 105 return PPB_Broker_Proxy::CreateProxyResource(instance); | 104 return PPB_Broker_Proxy::CreateProxyResource(instance); |
| 106 } | 105 } |
| 107 | 106 |
| 107 PP_Resource ResourceCreationProxy::CreateBrowserFont( | |
| 108 PP_Instance instance, | |
| 109 const PP_BrowserFont_Trusted_Description* description) { | |
| 110 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | |
| 111 if (!dispatcher) | |
| 112 return 0; | |
| 113 return PPB_BrowserFont_Trusted_Shared::Create( | |
| 114 OBJECT_IS_PROXY, instance, *description, dispatcher->preferences()); | |
| 115 } | |
| 116 | |
| 108 PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance, | 117 PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance, |
| 109 uint32_t size) { | 118 uint32_t size) { |
| 110 return PPB_Buffer_Proxy::CreateProxyResource(instance, size); | 119 return PPB_Buffer_Proxy::CreateProxyResource(instance, size); |
| 111 } | 120 } |
| 112 | 121 |
| 113 PP_Resource ResourceCreationProxy::CreateDirectoryReader( | 122 PP_Resource ResourceCreationProxy::CreateDirectoryReader( |
| 114 PP_Resource directory_ref) { | 123 PP_Resource directory_ref) { |
| 115 NOTIMPLEMENTED(); // Not proxied yet. | 124 NOTIMPLEMENTED(); // Not proxied yet. |
| 116 return 0; | 125 return 0; |
| 117 } | 126 } |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 148 PP_Resource ResourceCreationProxy::CreateFlashMessageLoop( | 157 PP_Resource ResourceCreationProxy::CreateFlashMessageLoop( |
| 149 PP_Instance instance) { | 158 PP_Instance instance) { |
| 150 return PPB_Flash_MessageLoop_Proxy::CreateProxyResource(instance); | 159 return PPB_Flash_MessageLoop_Proxy::CreateProxyResource(instance); |
| 151 } | 160 } |
| 152 | 161 |
| 153 PP_Resource ResourceCreationProxy::CreateFlashNetConnector( | 162 PP_Resource ResourceCreationProxy::CreateFlashNetConnector( |
| 154 PP_Instance instance) { | 163 PP_Instance instance) { |
| 155 return PPB_Flash_NetConnector_Proxy::CreateProxyResource(instance); | 164 return PPB_Flash_NetConnector_Proxy::CreateProxyResource(instance); |
| 156 } | 165 } |
| 157 | 166 |
| 158 PP_Resource ResourceCreationProxy::CreateFontObject( | |
| 159 PP_Instance instance, | |
| 160 const PP_FontDescription_Dev* description) { | |
| 161 PluginDispatcher* dispatcher = | |
| 162 PluginDispatcher::GetForInstance(instance); | |
| 163 if (!dispatcher) | |
| 164 return 0; | |
| 165 return PPB_Font_Shared::Create(OBJECT_IS_PROXY, instance, *description, | |
| 166 dispatcher->preferences()); | |
| 167 } | |
| 168 | |
| 169 PP_Resource ResourceCreationProxy::CreateGraphics2D(PP_Instance instance, | 167 PP_Resource ResourceCreationProxy::CreateGraphics2D(PP_Instance instance, |
| 170 const PP_Size& size, | 168 const PP_Size& size, |
| 171 PP_Bool is_always_opaque) { | 169 PP_Bool is_always_opaque) { |
| 172 return PPB_Graphics2D_Proxy::CreateProxyResource(instance, size, | 170 return PPB_Graphics2D_Proxy::CreateProxyResource(instance, size, |
| 173 is_always_opaque); | 171 is_always_opaque); |
| 174 } | 172 } |
| 175 | 173 |
| 176 PP_Resource ResourceCreationProxy::CreateImageData(PP_Instance instance, | 174 PP_Resource ResourceCreationProxy::CreateImageData(PP_Instance instance, |
| 177 PP_ImageDataFormat format, | 175 PP_ImageDataFormat format, |
| 178 const PP_Size& size, | 176 const PP_Size& size, |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 bool ResourceCreationProxy::Send(IPC::Message* msg) { | 342 bool ResourceCreationProxy::Send(IPC::Message* msg) { |
| 345 return dispatcher()->Send(msg); | 343 return dispatcher()->Send(msg); |
| 346 } | 344 } |
| 347 | 345 |
| 348 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { | 346 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { |
| 349 return false; | 347 return false; |
| 350 } | 348 } |
| 351 | 349 |
| 352 } // namespace proxy | 350 } // namespace proxy |
| 353 } // namespace ppapi | 351 } // namespace ppapi |
| OLD | NEW |