| 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/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "ppapi/c/dev/ppb_alarms_dev.h" | 9 #include "ppapi/c/dev/ppb_alarms_dev.h" |
| 10 #include "ppapi/c/dev/ppb_audio_input_dev.h" | 10 #include "ppapi/c/dev/ppb_audio_input_dev.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 &ProxyFactory<PPP_ContentDecryptor_Private_Proxy>); | 254 &ProxyFactory<PPP_ContentDecryptor_Private_Proxy>); |
| 255 AddPPP(PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE, | 255 AddPPP(PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE, |
| 256 PPP_ContentDecryptor_Private_Proxy::GetProxyInterface()); | 256 PPP_ContentDecryptor_Private_Proxy::GetProxyInterface()); |
| 257 #endif | 257 #endif |
| 258 AddProxy(API_ID_PPB_TESTING, &ProxyFactory<PPB_Testing_Proxy>); | 258 AddProxy(API_ID_PPB_TESTING, &ProxyFactory<PPB_Testing_Proxy>); |
| 259 AddPPB(PPB_TESTING_PRIVATE_INTERFACE, | 259 AddPPB(PPB_TESTING_PRIVATE_INTERFACE, |
| 260 PPB_Testing_Proxy::GetProxyInterface(), PERMISSION_TESTING); | 260 PPB_Testing_Proxy::GetProxyInterface(), PERMISSION_TESTING); |
| 261 | 261 |
| 262 // PPP (plugin) interfaces. | 262 // PPP (plugin) interfaces. |
| 263 // TODO(brettw) move these to interface_list*.h | 263 // TODO(brettw) move these to interface_list*.h |
| 264 AddProxy(API_ID_PPP_GRAPHICS_3D, &ProxyFactory<PPP_Graphics3D_Proxy>); |
| 265 AddPPP(PPP_GRAPHICS_3D_INTERFACE, PPP_Graphics3D_Proxy::GetProxyInterface()); |
| 266 AddProxy(API_ID_PPP_INPUT_EVENT, &ProxyFactory<PPP_InputEvent_Proxy>); |
| 267 AddPPP(PPP_INPUT_EVENT_INTERFACE, PPP_InputEvent_Proxy::GetProxyInterface()); |
| 264 AddProxy(API_ID_PPP_INSTANCE, &ProxyFactory<PPP_Instance_Proxy>); | 268 AddProxy(API_ID_PPP_INSTANCE, &ProxyFactory<PPP_Instance_Proxy>); |
| 265 #if !defined(OS_NACL) | 269 #if !defined(OS_NACL) |
| 266 AddPPP(PPP_INSTANCE_INTERFACE_1_1, | 270 AddPPP(PPP_INSTANCE_INTERFACE_1_1, |
| 267 PPP_Instance_Proxy::GetInstanceInterface()); | 271 PPP_Instance_Proxy::GetInstanceInterface()); |
| 268 #endif | 272 AddProxy(API_ID_PPP_INSTANCE_PRIVATE, |
| 273 &ProxyFactory<PPP_Instance_Private_Proxy>); |
| 274 AddPPP(PPP_INSTANCE_PRIVATE_INTERFACE, |
| 275 PPP_Instance_Private_Proxy::GetProxyInterface()); |
| 276 #endif |
| 277 AddProxy(API_ID_PPP_MESSAGING, &ProxyFactory<PPP_Messaging_Proxy>); |
| 278 AddPPP(PPP_MESSAGING_INTERFACE, PPP_Messaging_Proxy::GetProxyInterface()); |
| 279 AddProxy(API_ID_PPP_MOUSE_LOCK, &ProxyFactory<PPP_MouseLock_Proxy>); |
| 280 AddPPP(PPP_MOUSELOCK_INTERFACE, PPP_MouseLock_Proxy::GetProxyInterface()); |
| 269 AddProxy(API_ID_PPP_PRINTING, &ProxyFactory<PPP_Printing_Proxy>); | 281 AddProxy(API_ID_PPP_PRINTING, &ProxyFactory<PPP_Printing_Proxy>); |
| 270 AddPPP(PPP_PRINTING_DEV_INTERFACE, PPP_Printing_Proxy::GetProxyInterface()); | 282 AddPPP(PPP_PRINTING_DEV_INTERFACE, PPP_Printing_Proxy::GetProxyInterface()); |
| 271 AddProxy(API_ID_PPP_TEXT_INPUT, &ProxyFactory<PPP_TextInput_Proxy>); | 283 AddProxy(API_ID_PPP_TEXT_INPUT, &ProxyFactory<PPP_TextInput_Proxy>); |
| 272 AddPPP(PPP_TEXTINPUT_DEV_INTERFACE, PPP_TextInput_Proxy::GetProxyInterface()); | 284 AddPPP(PPP_TEXTINPUT_DEV_INTERFACE, PPP_TextInput_Proxy::GetProxyInterface()); |
| 273 | |
| 274 // Old-style GetInfo PPP interfaces. | |
| 275 // Do not add more stuff here, they should be added to interface_list*.h | |
| 276 // TODO(brettw) remove these. | |
| 277 AddPPP(PPP_InputEvent_Proxy::GetInfo()); | |
| 278 AddPPP(PPP_Messaging_Proxy::GetInfo()); | |
| 279 AddPPP(PPP_MouseLock_Proxy::GetInfo()); | |
| 280 AddPPP(PPP_Graphics3D_Proxy::GetInfo()); | |
| 281 #if !defined(OS_NACL) | 285 #if !defined(OS_NACL) |
| 282 AddPPP(PPP_Instance_Private_Proxy::GetInfo()); | 286 AddProxy(API_ID_PPP_VIDEO_DECODER_DEV, &ProxyFactory<PPP_VideoDecoder_Proxy>); |
| 283 AddPPP(PPP_VideoDecoder_Proxy::GetInfo()); | 287 AddPPP(PPP_VIDEODECODER_DEV_INTERFACE, |
| 288 PPP_VideoDecoder_Proxy::GetProxyInterface()); |
| 284 #endif | 289 #endif |
| 285 } | 290 } |
| 286 | 291 |
| 287 InterfaceList::~InterfaceList() { | 292 InterfaceList::~InterfaceList() { |
| 288 } | 293 } |
| 289 | 294 |
| 290 // static | 295 // static |
| 291 InterfaceList* InterfaceList::GetInstance() { | 296 InterfaceList* InterfaceList::GetInstance() { |
| 292 return Singleton<InterfaceList>::get(); | 297 return Singleton<InterfaceList>::get(); |
| 293 } | 298 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 DCHECK(name_to_browser_info_.find(name) == name_to_browser_info_.end()); | 361 DCHECK(name_to_browser_info_.find(name) == name_to_browser_info_.end()); |
| 357 name_to_browser_info_[name] = InterfaceInfo(iface, perm); | 362 name_to_browser_info_[name] = InterfaceInfo(iface, perm); |
| 358 } | 363 } |
| 359 | 364 |
| 360 void InterfaceList::AddPPP(const char* name, | 365 void InterfaceList::AddPPP(const char* name, |
| 361 const void* iface) { | 366 const void* iface) { |
| 362 DCHECK(name_to_plugin_info_.find(name) == name_to_plugin_info_.end()); | 367 DCHECK(name_to_plugin_info_.find(name) == name_to_plugin_info_.end()); |
| 363 name_to_plugin_info_[name] = InterfaceInfo(iface, PERMISSION_NONE); | 368 name_to_plugin_info_[name] = InterfaceInfo(iface, PERMISSION_NONE); |
| 364 } | 369 } |
| 365 | 370 |
| 366 void InterfaceList::AddPPP(const InterfaceProxy::Info* info) { | |
| 367 AddProxy(info->id, info->create_proxy); | |
| 368 AddPPP(info->name, info->interface_ptr); | |
| 369 } | |
| 370 | |
| 371 } // namespace proxy | 371 } // namespace proxy |
| 372 } // namespace ppapi | 372 } // namespace ppapi |
| OLD | NEW |