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

Unified Diff: native_client_sdk/src/libraries/ppapi_simple/ps_main.h

Issue 412083002: [NaCl SDK] Allow ppapi_simple executables to run in both sel_ldr and in chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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: native_client_sdk/src/libraries/ppapi_simple/ps_main.h
diff --git a/native_client_sdk/src/libraries/ppapi_simple/ps_main.h b/native_client_sdk/src/libraries/ppapi_simple/ps_main.h
index c269d3abaaeba71f256ba8e339eb8a71707fff35..7cddd84e4b5421e812f812cd9f8e317516057020 100644
--- a/native_client_sdk/src/libraries/ppapi_simple/ps_main.h
+++ b/native_client_sdk/src/libraries/ppapi_simple/ps_main.h
@@ -18,8 +18,16 @@ typedef int (*PSMainFunc_t)(int argc, char *argv[]);
* Constructs an instance SimpleInstance and configures it to call into
* the provided "main" function.
*/
-void* PSMainCreate(PP_Instance inst, PSMainFunc_t func);
+void* PSMainCreate(PP_Instance inst);
+/**
+ * PSUserMainGet
+ *
+ * Prototype for the user provided function which retrieves the user's main
+ * function.
+ * This is normally defined using the PPAPI_SIMPLE_REGISTER_MAIN macro.
+ */
+PSMainFunc_t PSUserMainGet();
/**
* PPAPI_SIMPLE_REGISTER_MAIN
@@ -27,8 +35,13 @@ void* PSMainCreate(PP_Instance inst, PSMainFunc_t func);
* Constructs a PSInstance object and configures it to use call the provided
* 'main' function on its own thread once initialization is complete.
*/
-#define PPAPI_SIMPLE_REGISTER_MAIN(main) \
- PPAPI_SIMPLE_USE_MAIN(PSMainCreate, main)
+#define PPAPI_SIMPLE_REGISTER_MAIN(main_func) \
+ void* PSUserCreateInstance(PP_Instance inst) { \
+ return PSMainCreate(inst); \
+ } \
+ PSMainFunc_t PSUserMainGet() { \
+ return main_func; \
+ }
EXTERN_C_END

Powered by Google App Engine
This is Rietveld 408576698