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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 #if !defined(OS_NACL) | 174 #if !defined(OS_NACL) |
175 #include "ppapi/thunk/interfaces_ppb_public_dev.h" | 175 #include "ppapi/thunk/interfaces_ppb_public_dev.h" |
176 #include "ppapi/thunk/interfaces_ppb_private.h" | 176 #include "ppapi/thunk/interfaces_ppb_private.h" |
177 #endif | 177 #endif |
178 | 178 |
| 179 #if !defined(OS_NACL) |
| 180 #include "ppapi/thunk/interfaces_ppb_private_flash.h" |
| 181 #endif |
| 182 |
179 #undef PROXIED_API | 183 #undef PROXIED_API |
180 #undef PROXIED_IFACE | 184 #undef PROXIED_IFACE |
181 | 185 |
182 // Manually add some special proxies. Some of these don't have interfaces | 186 // Manually add some special proxies. Some of these don't have interfaces |
183 // that they support, so aren't covered by the macros above, but have proxies | 187 // that they support, so aren't covered by the macros above, but have proxies |
184 // for message routing. Others have different implementations between the | 188 // for message routing. Others have different implementations between the |
185 // proxy and the impl and there's no obvious message routing. | 189 // proxy and the impl and there's no obvious message routing. |
186 AddProxy(API_ID_RESOURCE_CREATION, &ResourceCreationProxy::Create); | 190 AddProxy(API_ID_RESOURCE_CREATION, &ResourceCreationProxy::Create); |
187 AddProxy(API_ID_PPP_CLASS, &PPP_Class_Proxy::Create); | 191 AddProxy(API_ID_PPP_CLASS, &PPP_Class_Proxy::Create); |
188 AddPPB(PPB_CORE_INTERFACE_1_0, API_ID_PPB_CORE, | 192 AddPPB(PPB_CORE_INTERFACE_1_0, API_ID_PPB_CORE, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 const void* InterfaceList::GetInterfaceForPPP(const std::string& name) const { | 298 const void* InterfaceList::GetInterfaceForPPP(const std::string& name) const { |
295 NameToInterfaceInfoMap::const_iterator found = | 299 NameToInterfaceInfoMap::const_iterator found = |
296 name_to_plugin_info_.find(name); | 300 name_to_plugin_info_.find(name); |
297 if (found == name_to_plugin_info_.end()) | 301 if (found == name_to_plugin_info_.end()) |
298 return NULL; | 302 return NULL; |
299 return found->second.iface; | 303 return found->second.iface; |
300 } | 304 } |
301 | 305 |
302 #if !defined(OS_NACL) | 306 #if !defined(OS_NACL) |
303 void InterfaceList::AddFlashInterfaces() { | 307 void InterfaceList::AddFlashInterfaces() { |
304 AddProxy(API_ID_PPB_FLASH, &ProxyFactory<PPB_Flash_Proxy>); | |
305 AddPPB(PPB_FLASH_INTERFACE_11_0, API_ID_PPB_FLASH, | |
306 PPB_Flash_Proxy::GetInterface11()); | |
307 AddPPB(PPB_FLASH_INTERFACE_12_0, API_ID_PPB_FLASH, | |
308 PPB_Flash_Proxy::GetInterface12_0()); | |
309 AddPPB(PPB_FLASH_INTERFACE_12_1, API_ID_PPB_FLASH, | |
310 PPB_Flash_Proxy::GetInterface12_1()); | |
311 AddPPB(PPB_FLASH_INTERFACE_12_2, API_ID_PPB_FLASH, | |
312 PPB_Flash_Proxy::GetInterface12_2()); | |
313 | |
314 AddProxy(API_ID_PPB_FLASH_CLIPBOARD, | 308 AddProxy(API_ID_PPB_FLASH_CLIPBOARD, |
315 &ProxyFactory<PPB_Flash_Clipboard_Proxy>); | 309 &ProxyFactory<PPB_Flash_Clipboard_Proxy>); |
316 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_4_0, API_ID_PPB_FLASH_CLIPBOARD, | 310 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_4_0, API_ID_PPB_FLASH_CLIPBOARD, |
317 thunk::GetPPB_Flash_Clipboard_4_0_Thunk()); | 311 thunk::GetPPB_Flash_Clipboard_4_0_Thunk()); |
318 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_3_0, API_ID_PPB_FLASH_CLIPBOARD, | 312 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_3_0, API_ID_PPB_FLASH_CLIPBOARD, |
319 thunk::GetPPB_Flash_Clipboard_3_0_Thunk()); | 313 thunk::GetPPB_Flash_Clipboard_3_0_Thunk()); |
320 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY, API_ID_PPB_FLASH_CLIPBOARD, | 314 AddPPB(PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY, API_ID_PPB_FLASH_CLIPBOARD, |
321 thunk::GetPPB_Flash_Clipboard_3_0_Thunk()); | 315 thunk::GetPPB_Flash_Clipboard_3_0_Thunk()); |
322 | 316 |
323 AddProxy(API_ID_PPB_FLASH_FILE_FILEREF, | 317 AddProxy(API_ID_PPB_FLASH_FILE_FILEREF, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 AddPPB(info->name, info->id, info->interface_ptr); | 375 AddPPB(info->name, info->id, info->interface_ptr); |
382 } | 376 } |
383 | 377 |
384 void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { | 378 void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { |
385 AddProxy(info->id, info->create_proxy); | 379 AddProxy(info->id, info->create_proxy); |
386 AddPPP(info->name, info->id, info->interface_ptr); | 380 AddPPP(info->name, info->id, info->interface_ptr); |
387 } | 381 } |
388 | 382 |
389 } // namespace proxy | 383 } // namespace proxy |
390 } // namespace ppapi | 384 } // namespace ppapi |
OLD | NEW |