| 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/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_audio_input_dev.h" | 8 #include "ppapi/c/dev/ppb_audio_input_dev.h" |
| 9 #include "ppapi/c/dev/ppb_buffer_dev.h" | 9 #include "ppapi/c/dev/ppb_buffer_dev.h" |
| 10 #include "ppapi/c/dev/ppb_char_set_dev.h" | 10 #include "ppapi/c/dev/ppb_char_set_dev.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "ppapi/proxy/interface_proxy.h" | 72 #include "ppapi/proxy/interface_proxy.h" |
| 73 #include "ppapi/proxy/ppb_audio_input_proxy.h" | 73 #include "ppapi/proxy/ppb_audio_input_proxy.h" |
| 74 #include "ppapi/proxy/ppb_audio_proxy.h" | 74 #include "ppapi/proxy/ppb_audio_proxy.h" |
| 75 #include "ppapi/proxy/ppb_broker_proxy.h" | 75 #include "ppapi/proxy/ppb_broker_proxy.h" |
| 76 #include "ppapi/proxy/ppb_buffer_proxy.h" | 76 #include "ppapi/proxy/ppb_buffer_proxy.h" |
| 77 #include "ppapi/proxy/ppb_core_proxy.h" | 77 #include "ppapi/proxy/ppb_core_proxy.h" |
| 78 #include "ppapi/proxy/ppb_file_chooser_proxy.h" | 78 #include "ppapi/proxy/ppb_file_chooser_proxy.h" |
| 79 #include "ppapi/proxy/ppb_file_io_proxy.h" | 79 #include "ppapi/proxy/ppb_file_io_proxy.h" |
| 80 #include "ppapi/proxy/ppb_file_ref_proxy.h" | 80 #include "ppapi/proxy/ppb_file_ref_proxy.h" |
| 81 #include "ppapi/proxy/ppb_file_system_proxy.h" | 81 #include "ppapi/proxy/ppb_file_system_proxy.h" |
| 82 #include "ppapi/proxy/ppb_flash_file_proxy.h" | |
| 83 #include "ppapi/proxy/ppb_flash_menu_proxy.h" | 82 #include "ppapi/proxy/ppb_flash_menu_proxy.h" |
| 84 #include "ppapi/proxy/ppb_flash_message_loop_proxy.h" | 83 #include "ppapi/proxy/ppb_flash_message_loop_proxy.h" |
| 85 #include "ppapi/proxy/ppb_flash_proxy.h" | 84 #include "ppapi/proxy/ppb_flash_proxy.h" |
| 86 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" | 85 #include "ppapi/proxy/ppb_graphics_2d_proxy.h" |
| 87 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" | 86 #include "ppapi/proxy/ppb_graphics_3d_proxy.h" |
| 88 #include "ppapi/proxy/ppb_host_resolver_private_proxy.h" | 87 #include "ppapi/proxy/ppb_host_resolver_private_proxy.h" |
| 89 #include "ppapi/proxy/ppb_image_data_proxy.h" | 88 #include "ppapi/proxy/ppb_image_data_proxy.h" |
| 90 #include "ppapi/proxy/ppb_instance_proxy.h" | 89 #include "ppapi/proxy/ppb_instance_proxy.h" |
| 91 #include "ppapi/proxy/ppb_message_loop_proxy.h" | 90 #include "ppapi/proxy/ppb_message_loop_proxy.h" |
| 92 #include "ppapi/proxy/ppb_network_monitor_private_proxy.h" | 91 #include "ppapi/proxy/ppb_network_monitor_private_proxy.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 PPB_OpenGLES2_Shared::GetQueryInterface()); | 207 PPB_OpenGLES2_Shared::GetQueryInterface()); |
| 209 #endif | 208 #endif |
| 210 AddPPB(PPB_VAR_ARRAY_BUFFER_INTERFACE_1_0, API_ID_NONE, | 209 AddPPB(PPB_VAR_ARRAY_BUFFER_INTERFACE_1_0, API_ID_NONE, |
| 211 PPB_Var_Shared::GetVarArrayBufferInterface1_0()); | 210 PPB_Var_Shared::GetVarArrayBufferInterface1_0()); |
| 212 AddPPB(PPB_VAR_INTERFACE_1_1, API_ID_NONE, | 211 AddPPB(PPB_VAR_INTERFACE_1_1, API_ID_NONE, |
| 213 PPB_Var_Shared::GetVarInterface1_1()); | 212 PPB_Var_Shared::GetVarInterface1_1()); |
| 214 AddPPB(PPB_VAR_INTERFACE_1_0, API_ID_NONE, | 213 AddPPB(PPB_VAR_INTERFACE_1_0, API_ID_NONE, |
| 215 PPB_Var_Shared::GetVarInterface1_0()); | 214 PPB_Var_Shared::GetVarInterface1_0()); |
| 216 | 215 |
| 217 #if !defined(OS_NACL) | 216 #if !defined(OS_NACL) |
| 218 AddFlashInterfaces(); | |
| 219 | |
| 220 // PPB (browser) interfaces. | 217 // PPB (browser) interfaces. |
| 221 // Do not add more stuff here, they should be added to interface_list*.h | 218 // Do not add more stuff here, they should be added to interface_list*.h |
| 222 // TODO(brettw) remove these. | 219 // TODO(brettw) remove these. |
| 223 AddPPB(PPB_Instance_Proxy::GetInfoPrivate()); | 220 AddPPB(PPB_Instance_Proxy::GetInfoPrivate()); |
| 224 AddPPB(PPB_PDF_Proxy::GetInfo()); | 221 AddPPB(PPB_PDF_Proxy::GetInfo()); |
| 225 AddPPB(PPB_Testing_Proxy::GetInfo()); | 222 AddPPB(PPB_Testing_Proxy::GetInfo()); |
| 226 AddPPB(PPB_URLLoader_Proxy::GetTrustedInfo()); | 223 AddPPB(PPB_URLLoader_Proxy::GetTrustedInfo()); |
| 227 AddPPB(PPB_Var_Deprecated_Proxy::GetInfo()); | 224 AddPPB(PPB_Var_Deprecated_Proxy::GetInfo()); |
| 228 #endif | 225 #endif |
| 229 | 226 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 291 } |
| 295 | 292 |
| 296 const void* InterfaceList::GetInterfaceForPPP(const std::string& name) const { | 293 const void* InterfaceList::GetInterfaceForPPP(const std::string& name) const { |
| 297 NameToInterfaceInfoMap::const_iterator found = | 294 NameToInterfaceInfoMap::const_iterator found = |
| 298 name_to_plugin_info_.find(name); | 295 name_to_plugin_info_.find(name); |
| 299 if (found == name_to_plugin_info_.end()) | 296 if (found == name_to_plugin_info_.end()) |
| 300 return NULL; | 297 return NULL; |
| 301 return found->second.iface; | 298 return found->second.iface; |
| 302 } | 299 } |
| 303 | 300 |
| 304 #if !defined(OS_NACL) | |
| 305 void InterfaceList::AddFlashInterfaces() { | |
| 306 AddProxy(API_ID_PPB_FLASH_FILE_FILEREF, | |
| 307 &ProxyFactory<PPB_Flash_File_FileRef_Proxy>); | |
| 308 AddPPB(PPB_FLASH_FILE_FILEREF_INTERFACE, API_ID_PPB_FLASH_FILE_FILEREF, | |
| 309 PPB_Flash_File_FileRef_Proxy::GetInterface()); | |
| 310 | |
| 311 AddProxy(API_ID_PPB_FLASH_FILE_MODULELOCAL, | |
| 312 &ProxyFactory<PPB_Flash_File_ModuleLocal_Proxy>); | |
| 313 AddPPB(PPB_FLASH_FILE_MODULELOCAL_INTERFACE, | |
| 314 API_ID_PPB_FLASH_FILE_MODULELOCAL, | |
| 315 PPB_Flash_File_ModuleLocal_Proxy::GetInterface()); | |
| 316 | |
| 317 AddProxy(API_ID_PPB_FLASH_MENU, &ProxyFactory<PPB_Flash_Menu_Proxy>); | |
| 318 AddPPB(PPB_FLASH_MENU_INTERFACE_0_2, API_ID_PPB_FLASH_MENU, | |
| 319 thunk::GetPPB_Flash_Menu_0_2_Thunk()); | |
| 320 | |
| 321 AddProxy(API_ID_PPB_FLASH_MESSAGELOOP, | |
| 322 &ProxyFactory<PPB_Flash_MessageLoop_Proxy>); | |
| 323 AddPPB(PPB_FLASH_MESSAGELOOP_INTERFACE_0_1, API_ID_PPB_FLASH_MESSAGELOOP, | |
| 324 thunk::GetPPB_Flash_MessageLoop_0_1_Thunk()); | |
| 325 | |
| 326 // Only add the interface; PPB_TCPSocket_Private provides the API ID's proxy. | |
| 327 AddPPB(PPB_FLASH_TCPSOCKET_INTERFACE_0_2, API_ID_PPB_TCPSOCKET_PRIVATE, | |
| 328 thunk::GetPPB_TCPSocket_Private_0_3_Thunk()); | |
| 329 } | |
| 330 #endif // !defined(OS_NACL) | |
| 331 | |
| 332 void InterfaceList::AddProxy(ApiID id, | 301 void InterfaceList::AddProxy(ApiID id, |
| 333 InterfaceProxy::Factory factory) { | 302 InterfaceProxy::Factory factory) { |
| 334 // For interfaces with no corresponding _Proxy objects, the macros will | 303 // For interfaces with no corresponding _Proxy objects, the macros will |
| 335 // generate calls to this function with API_ID_NONE. This means we | 304 // generate calls to this function with API_ID_NONE. This means we |
| 336 // should just skip adding a factory for these functions. | 305 // should just skip adding a factory for these functions. |
| 337 if (id == API_ID_NONE) | 306 if (id == API_ID_NONE) |
| 338 return; | 307 return; |
| 339 | 308 |
| 340 // The factory should be an exact dupe of the one we already have if it | 309 // The factory should be an exact dupe of the one we already have if it |
| 341 // has already been registered before. | 310 // has already been registered before. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 364 AddPPB(info->name, info->id, info->interface_ptr); | 333 AddPPB(info->name, info->id, info->interface_ptr); |
| 365 } | 334 } |
| 366 | 335 |
| 367 void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { | 336 void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { |
| 368 AddProxy(info->id, info->create_proxy); | 337 AddProxy(info->id, info->create_proxy); |
| 369 AddPPP(info->name, info->id, info->interface_ptr); | 338 AddPPP(info->name, info->id, info->interface_ptr); |
| 370 } | 339 } |
| 371 | 340 |
| 372 } // namespace proxy | 341 } // namespace proxy |
| 373 } // namespace ppapi | 342 } // namespace ppapi |
| OLD | NEW |