Chromium Code Reviews| 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/interface_list.h" | 5 #include "ppapi/proxy/interface_list.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "ppapi/c/dev/ppb_buffer_dev.h" | 8 #include "ppapi/c/dev/ppb_buffer_dev.h" |
| 9 #include "ppapi/c/dev/ppb_char_set_dev.h" | 9 #include "ppapi/c/dev/ppb_char_set_dev.h" |
| 10 #include "ppapi/c/dev/ppb_console_dev.h" | 10 #include "ppapi/c/dev/ppb_console_dev.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 #include "ppapi/c/ppb_var.h" | 41 #include "ppapi/c/ppb_var.h" |
| 42 #include "ppapi/c/pp_errors.h" | 42 #include "ppapi/c/pp_errors.h" |
| 43 #include "ppapi/c/ppp_instance.h" | 43 #include "ppapi/c/ppp_instance.h" |
| 44 #include "ppapi/c/private/ppb_flash_clipboard.h" | 44 #include "ppapi/c/private/ppb_flash_clipboard.h" |
| 45 #include "ppapi/c/private/ppb_flash_file.h" | 45 #include "ppapi/c/private/ppb_flash_file.h" |
| 46 #include "ppapi/c/private/ppb_flash_fullscreen.h" | 46 #include "ppapi/c/private/ppb_flash_fullscreen.h" |
| 47 #include "ppapi/c/private/ppb_flash.h" | 47 #include "ppapi/c/private/ppb_flash.h" |
| 48 #include "ppapi/c/private/ppb_flash_menu.h" | 48 #include "ppapi/c/private/ppb_flash_menu.h" |
| 49 #include "ppapi/c/private/ppb_flash_net_connector.h" | 49 #include "ppapi/c/private/ppb_flash_net_connector.h" |
| 50 #include "ppapi/c/private/ppb_flash_tcp_socket.h" | 50 #include "ppapi/c/private/ppb_flash_tcp_socket.h" |
| 51 #include "ppapi/c/private/ppb_flash_udp_socket.h" | |
| 52 #include "ppapi/c/private/ppb_net_address_private.h" | 51 #include "ppapi/c/private/ppb_net_address_private.h" |
| 53 #include "ppapi/c/private/ppb_pdf.h" | 52 #include "ppapi/c/private/ppb_pdf.h" |
| 53 #include "ppapi/c/private/ppb_tcp_socket_private.h" | |
| 54 #include "ppapi/c/private/ppb_udp_socket_private.h" | |
| 54 #include "ppapi/c/trusted/ppb_broker_trusted.h" | 55 #include "ppapi/c/trusted/ppb_broker_trusted.h" |
| 55 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" | 56 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" |
| 56 #include "ppapi/proxy/interface_proxy.h" | 57 #include "ppapi/proxy/interface_proxy.h" |
| 57 #include "ppapi/proxy/ppb_audio_proxy.h" | 58 #include "ppapi/proxy/ppb_audio_proxy.h" |
| 58 #include "ppapi/proxy/ppb_broker_proxy.h" | 59 #include "ppapi/proxy/ppb_broker_proxy.h" |
| 59 #include "ppapi/proxy/ppb_buffer_proxy.h" | 60 #include "ppapi/proxy/ppb_buffer_proxy.h" |
| 60 #include "ppapi/proxy/ppb_context_3d_proxy.h" | 61 #include "ppapi/proxy/ppb_context_3d_proxy.h" |
| 61 #include "ppapi/proxy/ppb_core_proxy.h" | 62 #include "ppapi/proxy/ppb_core_proxy.h" |
| 62 #include "ppapi/proxy/ppb_cursor_control_proxy.h" | 63 #include "ppapi/proxy/ppb_cursor_control_proxy.h" |
| 63 #include "ppapi/proxy/ppb_file_chooser_proxy.h" | 64 #include "ppapi/proxy/ppb_file_chooser_proxy.h" |
| 64 #include "ppapi/proxy/ppb_file_ref_proxy.h" | 65 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
| 65 #include "ppapi/proxy/ppb_file_system_proxy.h" | 66 #include "ppapi/proxy/ppb_file_system_proxy.h" |
| 66 #include "ppapi/proxy/ppb_flash_clipboard_proxy.h" | 67 #include "ppapi/proxy/ppb_flash_clipboard_proxy.h" |
| 67 #include "ppapi/proxy/ppb_flash_file_proxy.h" | 68 #include "ppapi/proxy/ppb_flash_file_proxy.h" |
| 68 #include "ppapi/proxy/ppb_flash_menu_proxy.h" | 69 #include "ppapi/proxy/ppb_flash_menu_proxy.h" |
| 69 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" | 70 #include "ppapi/proxy/ppb_flash_net_connector_proxy.h" |
| 70 #include "ppapi/proxy/ppb_flash_proxy.h" | 71 #include "ppapi/proxy/ppb_flash_proxy.h" |
| 71 #include "ppapi/proxy/ppb_flash_tcp_socket_proxy.h" | |
| 72 #include "ppapi/proxy/ppb_flash_udp_socket_proxy.h" | |
| 73 #include "ppapi/proxy/ppb_font_proxy.h" | 72 #include "ppapi/proxy/ppb_font_proxy.h" |
| 74 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" | 73 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" |
| 75 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" | 74 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" |
| 76 #include "ppapi/proxy/ppb_image_data_proxy.h" | 75 #include "ppapi/proxy/ppb_image_data_proxy.h" |
| 77 #include "ppapi/proxy/ppb_instance_proxy.h" | 76 #include "ppapi/proxy/ppb_instance_proxy.h" |
| 78 #include "ppapi/proxy/ppb_pdf_proxy.h" | 77 #include "ppapi/proxy/ppb_pdf_proxy.h" |
| 79 #include "ppapi/proxy/ppb_surface_3d_proxy.h" | 78 #include "ppapi/proxy/ppb_surface_3d_proxy.h" |
| 80 #include "ppapi/proxy/ppb_testing_proxy.h" | 79 #include "ppapi/proxy/ppb_testing_proxy.h" |
| 81 #include "ppapi/proxy/ppb_text_input_proxy.h" | 80 #include "ppapi/proxy/ppb_text_input_proxy.h" |
| 81 #include "ppapi/proxy/ppb_tcp_socket_proxy.h" | |
| 82 #include "ppapi/proxy/ppb_udp_socket_proxy.h" | |
| 82 #include "ppapi/proxy/ppb_url_loader_proxy.h" | 83 #include "ppapi/proxy/ppb_url_loader_proxy.h" |
| 83 #include "ppapi/proxy/ppb_url_response_info_proxy.h" | 84 #include "ppapi/proxy/ppb_url_response_info_proxy.h" |
| 84 #include "ppapi/proxy/ppb_var_deprecated_proxy.h" | 85 #include "ppapi/proxy/ppb_var_deprecated_proxy.h" |
| 85 #include "ppapi/proxy/ppb_var_proxy.h" | 86 #include "ppapi/proxy/ppb_var_proxy.h" |
| 86 #include "ppapi/proxy/ppb_video_capture_proxy.h" | 87 #include "ppapi/proxy/ppb_video_capture_proxy.h" |
| 87 #include "ppapi/proxy/ppb_video_decoder_proxy.h" | 88 #include "ppapi/proxy/ppb_video_decoder_proxy.h" |
| 88 #include "ppapi/proxy/ppp_class_proxy.h" | 89 #include "ppapi/proxy/ppp_class_proxy.h" |
| 89 #include "ppapi/proxy/ppp_graphics_3d_proxy.h" | 90 #include "ppapi/proxy/ppp_graphics_3d_proxy.h" |
| 90 #include "ppapi/proxy/ppp_input_event_proxy.h" | 91 #include "ppapi/proxy/ppp_input_event_proxy.h" |
| 91 #include "ppapi/proxy/ppp_instance_private_proxy.h" | 92 #include "ppapi/proxy/ppp_instance_private_proxy.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 | 155 |
| 155 #undef PROXIED_API | 156 #undef PROXIED_API |
| 156 #undef PROXIED_IFACE | 157 #undef PROXIED_IFACE |
| 157 | 158 |
| 158 // Manually add some special proxies. Some of these don't have interfaces | 159 // Manually add some special proxies. Some of these don't have interfaces |
| 159 // that they support, so aren't covered by the macros above, but have proxies | 160 // that they support, so aren't covered by the macros above, but have proxies |
| 160 // for message routing. Others have different implementations between the | 161 // for message routing. Others have different implementations between the |
| 161 // proxy and the impl and there's no obvious message routing. | 162 // proxy and the impl and there's no obvious message routing. |
| 162 AddProxy(API_ID_RESOURCE_CREATION, &ResourceCreationProxy::Create); | 163 AddProxy(API_ID_RESOURCE_CREATION, &ResourceCreationProxy::Create); |
| 163 AddProxy(API_ID_PPP_CLASS, &PPP_Class_Proxy::Create); | 164 AddProxy(API_ID_PPP_CLASS, &PPP_Class_Proxy::Create); |
| 165 AddProxy(API_ID_PPB_TCPSOCKET, &ProxyFactory<PPB_TCPSocket_Proxy>); | |
|
yzshen1
2011/11/11 21:04:28
If the only concern is the _PRIVATE suffix being t
Dmitry Polukhin
2011/11/14 13:03:02
Done.
| |
| 166 AddProxy(API_ID_PPB_UDPSOCKET, &ProxyFactory<PPB_UDPSocket_Proxy>); | |
| 164 AddPPB(PPB_CORE_INTERFACE, API_ID_PPB_CORE, | 167 AddPPB(PPB_CORE_INTERFACE, API_ID_PPB_CORE, |
| 165 PPB_Core_Proxy::GetPPB_Core_Interface()); | 168 PPB_Core_Proxy::GetPPB_Core_Interface()); |
| 166 AddPPB(PPB_OPENGLES2_INTERFACE, API_ID_NONE, | 169 AddPPB(PPB_OPENGLES2_INTERFACE, API_ID_NONE, |
| 167 OpenGLES2Impl::GetInterface()); | 170 OpenGLES2Impl::GetInterface()); |
| 168 AddPPB(PPB_VAR_INTERFACE, API_ID_NONE, | 171 AddPPB(PPB_VAR_INTERFACE, API_ID_NONE, |
| 169 GetPPB_Var_Interface()); | 172 GetPPB_Var_Interface()); |
| 170 | 173 AddPPB(PPB_TCPSOCKET_PRIVATE_INTERFACE, API_ID_PPB_TCPSOCKET, |
| 174 thunk::GetPPB_TCPSocket_Thunk()); | |
| 175 AddPPB(PPB_UDPSOCKET_PRIVATE_INTERFACE, API_ID_PPB_UDPSOCKET, | |
| 176 thunk::GetPPB_UDPSocket_Thunk()); | |
| 171 AddFlashInterfaces(); | 177 AddFlashInterfaces(); |
| 172 | 178 |
| 173 // PPB (browser) interfaces. | 179 // PPB (browser) interfaces. |
| 174 AddPPB(PPB_FileChooser_Proxy::GetTrustedInfo()); | 180 AddPPB(PPB_FileChooser_Proxy::GetTrustedInfo()); |
| 175 AddPPB(PPB_Instance_Proxy::GetInfoPrivate()); | 181 AddPPB(PPB_Instance_Proxy::GetInfoPrivate()); |
| 176 AddPPB(PPB_PDF_Proxy::GetInfo()); | 182 AddPPB(PPB_PDF_Proxy::GetInfo()); |
| 177 AddPPB(PPB_Testing_Proxy::GetInfo()); | 183 AddPPB(PPB_Testing_Proxy::GetInfo()); |
| 178 AddPPB(PPB_URLLoader_Proxy::GetTrustedInfo()); | 184 AddPPB(PPB_URLLoader_Proxy::GetTrustedInfo()); |
| 179 AddPPB(PPB_Var_Deprecated_Proxy::GetInfo()); | 185 AddPPB(PPB_Var_Deprecated_Proxy::GetInfo()); |
| 180 | 186 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 PPB_Flash_File_FileRef_Proxy::GetInterface()); | 261 PPB_Flash_File_FileRef_Proxy::GetInterface()); |
| 256 | 262 |
| 257 AddProxy(API_ID_PPB_FLASH_MENU, &ProxyFactory<PPB_Flash_Menu_Proxy>); | 263 AddProxy(API_ID_PPB_FLASH_MENU, &ProxyFactory<PPB_Flash_Menu_Proxy>); |
| 258 AddPPB(PPB_FLASH_MENU_INTERFACE, API_ID_PPB_FLASH_MENU, | 264 AddPPB(PPB_FLASH_MENU_INTERFACE, API_ID_PPB_FLASH_MENU, |
| 259 thunk::GetPPB_Flash_Menu_Thunk()); | 265 thunk::GetPPB_Flash_Menu_Thunk()); |
| 260 | 266 |
| 261 AddProxy(API_ID_PPB_FLASH, &ProxyFactory<PPB_Flash_Proxy>); | 267 AddProxy(API_ID_PPB_FLASH, &ProxyFactory<PPB_Flash_Proxy>); |
| 262 AddPPB(PPB_FLASH_INTERFACE, API_ID_PPB_FLASH, | 268 AddPPB(PPB_FLASH_INTERFACE, API_ID_PPB_FLASH, |
| 263 PPB_Flash_Proxy::GetInterface()); | 269 PPB_Flash_Proxy::GetInterface()); |
| 264 | 270 |
| 265 AddProxy(API_ID_PPB_FLASH_TCPSOCKET, | 271 // Only add PPB because proxy for the this API ID was already added. |
| 266 &ProxyFactory<PPB_Flash_TCPSocket_Proxy>); | 272 AddPPB(PPB_FLASH_TCPSOCKET_INTERFACE, API_ID_PPB_TCPSOCKET, |
| 267 AddPPB(PPB_FLASH_TCPSOCKET_INTERFACE, API_ID_PPB_FLASH_TCPSOCKET, | 273 thunk::GetPPB_TCPSocket_Thunk()); |
| 268 thunk::GetPPB_Flash_TCPSocket_Thunk()); | |
| 269 | |
| 270 AddProxy(API_ID_PPB_FLASH_UDPSOCKET, | |
| 271 &ProxyFactory<PPB_Flash_UDPSocket_Proxy>); | |
| 272 AddPPB(PPB_FLASH_UDPSOCKET_INTERFACE, API_ID_PPB_FLASH_UDPSOCKET, | |
| 273 thunk::GetPPB_Flash_UDPSocket_Thunk()); | |
| 274 | 274 |
| 275 #ifdef ENABLE_FLAPPER_HACKS | 275 #ifdef ENABLE_FLAPPER_HACKS |
| 276 AddProxy(API_ID_PPB_FLASH_NETCONNECTOR, | 276 AddProxy(API_ID_PPB_FLASH_NETCONNECTOR, |
| 277 &ProxyFactory<PPB_Flash_NetConnector_Proxy>); | 277 &ProxyFactory<PPB_Flash_NetConnector_Proxy>); |
| 278 AddPPB(PPB_FLASH_NETCONNECTOR_INTERFACE, API_ID_PPB_FLASH_NETCONNECTOR, | 278 AddPPB(PPB_FLASH_NETCONNECTOR_INTERFACE, API_ID_PPB_FLASH_NETCONNECTOR, |
| 279 thunk::GetPPB_Flash_NetConnector_Thunk()); | 279 thunk::GetPPB_Flash_NetConnector_Thunk()); |
| 280 #endif | 280 #endif |
| 281 } | 281 } |
| 282 | 282 |
| 283 void InterfaceList::AddProxy(ApiID id, | 283 void InterfaceList::AddProxy(ApiID id, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 AddPPB(info->name, info->id, info->interface_ptr); | 315 AddPPB(info->name, info->id, info->interface_ptr); |
| 316 } | 316 } |
| 317 | 317 |
| 318 void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { | 318 void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { |
| 319 AddProxy(info->id, info->create_proxy); | 319 AddProxy(info->id, info->create_proxy); |
| 320 AddPPP(info->name, info->id, info->interface_ptr); | 320 AddPPP(info->name, info->id, info->interface_ptr); |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace proxy | 323 } // namespace proxy |
| 324 } // namespace ppapi | 324 } // namespace ppapi |
| OLD | NEW |