Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: ppapi/cpp/ppp_entrypoints.cc

Issue 10069035: Add a way to implement GetInterface in the broker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« ppapi/c/ppp.h ('K') | « ppapi/cpp/module_embedder.h ('k') | ppapi/proxy/dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698