Index: ppapi/cpp/ppp_entrypoints.cc |
diff --git a/ppapi/cpp/ppp_entrypoints.cc b/ppapi/cpp/ppp_entrypoints.cc |
index c3e7568c6b3052e73ad036b6d1dbc19c488aca63..1da045ab106d0322cf0d39e94781ee9bf6ae867d 100644 |
--- a/ppapi/cpp/ppp_entrypoints.cc |
+++ b/ppapi/cpp/ppp_entrypoints.cc |
@@ -14,6 +14,7 @@ |
#include "ppapi/cpp/module_embedder.h" |
static pp::Module* g_module_singleton = NULL; |
+static PP_GetInterface_Func g_broker_get_interface = NULL; |
namespace pp { |
@@ -22,6 +23,10 @@ pp::Module* Module::Get() { |
return g_module_singleton; |
} |
+void SetBrokerGetIntefaceFunc(PP_GetInterface_Func broker_get_interface) { |
+ g_broker_get_interface = broker_get_interface; |
+} |
+ |
} // namespace pp |
// Global PPP functions -------------------------------------------------------- |
@@ -46,7 +51,11 @@ PP_EXPORT void PPP_ShutdownModule() { |
} |
PP_EXPORT const void* PPP_GetInterface(const char* interface_name) { |
- if (!g_module_singleton) |
+ if (!g_module_singleton) { |
viettrungluu
2012/04/12 22:14:07
Nit: Maybe it'd be nicer to write this function as
|
+ // If there's no module, we might be a broker. |
+ if (g_broker_get_interface) |
+ return g_broker_get_interface(interface_name); |
return NULL; |
+ } |
return g_module_singleton->GetPluginInterface(interface_name); |
} |