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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // Register each proxied interface by calling AddPPB for each supported | 167 // Register each proxied interface by calling AddPPB for each supported |
168 // interface. | 168 // interface. |
169 #define PROXIED_IFACE(api_name, iface_str, iface_struct) \ | 169 #define PROXIED_IFACE(api_name, iface_str, iface_struct) \ |
170 AddPPB(iface_str, PROXY_API_ID(api_name), \ | 170 AddPPB(iface_str, PROXY_API_ID(api_name), \ |
171 INTERFACE_THUNK_NAME(iface_struct)()); | 171 INTERFACE_THUNK_NAME(iface_struct)()); |
172 | 172 |
173 #include "ppapi/thunk/interfaces_ppb_public_stable.h" | 173 #include "ppapi/thunk/interfaces_ppb_public_stable.h" |
174 #include "ppapi/thunk/interfaces_ppb_public_dev.h" | 174 #include "ppapi/thunk/interfaces_ppb_public_dev.h" |
175 #include "ppapi/thunk/interfaces_ppb_private.h" | 175 #include "ppapi/thunk/interfaces_ppb_private.h" |
176 | 176 |
| 177 #if !defined(OS_NACL) |
| 178 #include "ppapi/thunk/interfaces_ppb_private_flash.h" |
| 179 #endif |
| 180 |
177 #undef PROXIED_API | 181 #undef PROXIED_API |
178 #undef PROXIED_IFACE | 182 #undef PROXIED_IFACE |
179 | 183 |
180 // Manually add some special proxies. Some of these don't have interfaces | 184 // Manually add some special proxies. Some of these don't have interfaces |
181 // that they support, so aren't covered by the macros above, but have proxies | 185 // that they support, so aren't covered by the macros above, but have proxies |
182 // for message routing. Others have different implementations between the | 186 // for message routing. Others have different implementations between the |
183 // proxy and the impl and there's no obvious message routing. | 187 // proxy and the impl and there's no obvious message routing. |
184 AddProxy(API_ID_RESOURCE_CREATION, &ResourceCreationProxy::Create); | 188 AddProxy(API_ID_RESOURCE_CREATION, &ResourceCreationProxy::Create); |
185 AddProxy(API_ID_PPP_CLASS, &PPP_Class_Proxy::Create); | 189 AddProxy(API_ID_PPP_CLASS, &PPP_Class_Proxy::Create); |
186 AddPPB(PPB_CORE_INTERFACE_1_0, API_ID_PPB_CORE, | 190 AddPPB(PPB_CORE_INTERFACE_1_0, API_ID_PPB_CORE, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 const void* InterfaceList::GetInterfaceForPPP(const std::string& name) const { | 290 const void* InterfaceList::GetInterfaceForPPP(const std::string& name) const { |
287 NameToInterfaceInfoMap::const_iterator found = | 291 NameToInterfaceInfoMap::const_iterator found = |
288 name_to_plugin_info_.find(name); | 292 name_to_plugin_info_.find(name); |
289 if (found == name_to_plugin_info_.end()) | 293 if (found == name_to_plugin_info_.end()) |
290 return NULL; | 294 return NULL; |
291 return found->second.iface; | 295 return found->second.iface; |
292 } | 296 } |
293 | 297 |
294 void InterfaceList::AddFlashInterfaces() { | 298 void InterfaceList::AddFlashInterfaces() { |
295 #if !defined(OS_NACL) | 299 #if !defined(OS_NACL) |
296 AddProxy(API_ID_PPB_FLASH, &ProxyFactory<PPB_Flash_Proxy>); | |
297 AddPPB(PPB_FLASH_INTERFACE_11_0, API_ID_PPB_FLASH, | |
298 PPB_Flash_Proxy::GetInterface11()); | |
299 AddPPB(PPB_FLASH_INTERFACE_12_0, API_ID_PPB_FLASH, | |
300 PPB_Flash_Proxy::GetInterface12_0()); | |
301 AddPPB(PPB_FLASH_INTERFACE_12_1, API_ID_PPB_FLASH, | |
302 PPB_Flash_Proxy::GetInterface12_1()); | |
303 AddPPB(PPB_FLASH_INTERFACE_12_2, API_ID_PPB_FLASH, | |
304 PPB_Flash_Proxy::GetInterface12_2()); | |
305 | |
306 AddProxy(API_ID_PPB_FLASH_CLIPBOARD, | 300 AddProxy(API_ID_PPB_FLASH_CLIPBOARD, |
307 &ProxyFactory<PPB_Flash_Clipboard_Proxy>); | 301 &ProxyFactory<PPB_Flash_Clipboard_Proxy>); |
308 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_4_0, API_ID_PPB_FLASH_CLIPBOARD, | 302 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_4_0, API_ID_PPB_FLASH_CLIPBOARD, |
309 thunk::GetPPB_Flash_Clipboard_4_0_Thunk()); | 303 thunk::GetPPB_Flash_Clipboard_4_0_Thunk()); |
310 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_3_0, API_ID_PPB_FLASH_CLIPBOARD, | 304 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_3_0, API_ID_PPB_FLASH_CLIPBOARD, |
311 thunk::GetPPB_Flash_Clipboard_3_0_Thunk()); | 305 thunk::GetPPB_Flash_Clipboard_3_0_Thunk()); |
312 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY, API_ID_PPB_FLASH_CLIPBOARD, | 306 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY, API_ID_PPB_FLASH_CLIPBOARD, |
313 thunk::GetPPB_Flash_Clipboard_3_0_Thunk()); | 307 thunk::GetPPB_Flash_Clipboard_3_0_Thunk()); |
314 | 308 |
315 AddProxy(API_ID_PPB_FLASH_FILE_FILEREF, | 309 AddProxy(API_ID_PPB_FLASH_FILE_FILEREF, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 AddPPB(info->name, info->id, info->interface_ptr); | 367 AddPPB(info->name, info->id, info->interface_ptr); |
374 } | 368 } |
375 | 369 |
376 void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { | 370 void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { |
377 AddProxy(info->id, info->create_proxy); | 371 AddProxy(info->id, info->create_proxy); |
378 AddPPP(info->name, info->id, info->interface_ptr); | 372 AddPPP(info->name, info->id, info->interface_ptr); |
379 } | 373 } |
380 | 374 |
381 } // namespace proxy | 375 } // namespace proxy |
382 } // namespace ppapi | 376 } // namespace ppapi |
OLD | NEW |