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 // When used in conjunction with module_embedder.h, this gives a default | 5 // When used in conjunction with module_embedder.h, this gives a default |
6 // implementation of ppp.h for clients of the ppapi C++ interface. Most | 6 // implementation of ppp.h for clients of the ppapi C++ interface. Most |
7 // plugin implementors can export their derivation of Module by just | 7 // plugin implementors can export their derivation of Module by just |
8 // linking to this implementation. | 8 // linking to this implementation. |
9 | 9 |
| 10 #include <stdint.h> |
| 11 |
| 12 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/ppb.h" | 13 #include "ppapi/c/ppb.h" |
11 #include "ppapi/c/ppp.h" | 14 #include "ppapi/c/ppp.h" |
12 #include "ppapi/c/pp_errors.h" | |
13 #include "ppapi/cpp/module.h" | 15 #include "ppapi/cpp/module.h" |
14 #include "ppapi/cpp/module_embedder.h" | 16 #include "ppapi/cpp/module_embedder.h" |
15 | 17 |
16 static pp::Module* g_module_singleton = NULL; | 18 static pp::Module* g_module_singleton = NULL; |
17 static PP_GetInterface_Func g_broker_get_interface = NULL; | 19 static PP_GetInterface_Func g_broker_get_interface = NULL; |
18 | 20 |
19 namespace pp { | 21 namespace pp { |
20 | 22 |
21 // Give a default implementation of Module::Get(). See module.cc for details. | 23 // Give a default implementation of Module::Get(). See module.cc for details. |
22 pp::Module* Module::Get() { | 24 pp::Module* Module::Get() { |
(...skipping 27 matching lines...) Expand all Loading... |
50 g_module_singleton = NULL; | 52 g_module_singleton = NULL; |
51 } | 53 } |
52 | 54 |
53 PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { | 55 PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { |
54 if (g_module_singleton) | 56 if (g_module_singleton) |
55 return g_module_singleton->GetPluginInterface(interface_name); | 57 return g_module_singleton->GetPluginInterface(interface_name); |
56 if (g_broker_get_interface) | 58 if (g_broker_get_interface) |
57 return g_broker_get_interface(interface_name); | 59 return g_broker_get_interface(interface_name); |
58 return NULL; | 60 return NULL; |
59 } | 61 } |
OLD | NEW |