Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / src / public / chrome_main.h
index 3b05a68..ec5ffa0 100644 (file)
@@ -34,8 +34,7 @@ struct NaClValidationCache;
  *   struct NaClChromeMainArgs *args = NaClChromeMainArgsCreate();
  *   // Fill out args...
  *   NaClAppSetDesc(nap, NACL_CHROME_DESC_BASE, NaClDescMakeCustomDesc(...));
- *   NaClChromeMainLoad(nap, args);
- *   NaClChromeMainStart(nap);
+ *   NaClChromeMainStartApp(nap, args);
  */
 
 /*
@@ -191,23 +190,21 @@ void NaClChromeMainSetUrandomFd(int urandom_fd);
 /* Initialize NaCl.  This must be called before NaClAppCreate(). */
 void NaClChromeMainInit(void);
 
-/* Create a new args struct containing default values. */
-struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void);
-
 /*
- * Prepare to launch NaCl. Returns zero on success or a non-zero error code on
- * failure.
+ * Sets a function to be called when a fatal error is logged. When the passed
+ * function is invoked, recent log messages will be passed in the data
+ * parameter, and its length in the bytes parameter.
+ * This function is only safe to call after NaClChromeMainInit().
+ *
+ * If NaClSetFatalErrorCallback() is not called, recent log messages will be
+ * written to the IMC bootstrap channel on a fatal error.
  */
-int NaClChromeMainLoad(struct NaClApp *nap,
-                       struct NaClChromeMainArgs *args);
+void NaClSetFatalErrorCallback(void (*func)(const char *data, size_t bytes));
 
-/* Start NaCl. This does not return. */
-void NaClChromeMainStart(struct NaClApp *nap);
+/* Create a new args struct containing default values. */
+struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void);
 
-/*
- * DEPRECATED. Calls NaClChromeMainLoad and NaClChromeMainStart.
- * TODO(teravest): Remove this old interface after current users are migrated.
- */
+/* Start NaCl. This does not return. */
 void NaClChromeMainStartApp(struct NaClApp *nap,
                             struct NaClChromeMainArgs *args);