OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #ifndef NATIVE_CLIENT_SRC_PUBLIC_CHROME_MAIN_H_ | 7 #ifndef NATIVE_CLIENT_SRC_PUBLIC_CHROME_MAIN_H_ |
8 #define NATIVE_CLIENT_SRC_PUBLIC_CHROME_MAIN_H_ 1 | 8 #define NATIVE_CLIENT_SRC_PUBLIC_CHROME_MAIN_H_ 1 |
9 | 9 |
10 #include "native_client/src/include/build_config.h" | 10 #include "native_client/src/include/build_config.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 void NaClChromeMainInit(void); | 227 void NaClChromeMainInit(void); |
228 | 228 |
229 /* | 229 /* |
230 * Sets a function to be called when a fatal error is logged. When the passed | 230 * Sets a function to be called when a fatal error is logged. When the passed |
231 * function is invoked, recent log messages will be passed in the data | 231 * function is invoked, recent log messages will be passed in the data |
232 * parameter, and its length in the bytes parameter. | 232 * parameter, and its length in the bytes parameter. |
233 * This function is only safe to call after NaClChromeMainInit(). | 233 * This function is only safe to call after NaClChromeMainInit(). |
234 */ | 234 */ |
235 void NaClSetFatalErrorCallback(void (*func)(const char *data, size_t bytes)); | 235 void NaClSetFatalErrorCallback(void (*func)(const char *data, size_t bytes)); |
236 | 236 |
237 /* | |
238 * Sets a function to be called when the initial module load status | |
239 * from a call to NaClChromeMainStart is known (load_status is a value from | |
240 * the the NaClErrorCode enumeration and may indicate success or error). | |
241 */ | |
242 void NaClSetLoadStatusCallback(void (*func)(int load_status)); | |
Mark Seaborn
2015/04/17 23:15:54
Can you make this callback a field in NaClChromeMa
jvoung (off chromium)
2015/04/18 00:58:17
Done -- ah, didn't realize why that was global.
| |
243 | |
237 /* Create a new args struct containing default values. */ | 244 /* Create a new args struct containing default values. */ |
238 struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void); | 245 struct NaClChromeMainArgs *NaClChromeMainArgsCreate(void); |
239 | 246 |
240 /* | 247 /* |
241 * Start NaCl. | 248 * Start NaCl. |
242 * On success, returns 1 and sets exit_status to the value that the application | 249 * On success, returns 1 and sets exit_status to the value that the application |
243 * passed to _exit(). | 250 * passed to _exit(). |
244 * Returns 0 if the application fails to start. | 251 * Returns 0 if the application fails to start. |
245 */ | 252 */ |
246 int NaClChromeMainStart(struct NaClApp *nap, | 253 int NaClChromeMainStart(struct NaClApp *nap, |
247 struct NaClChromeMainArgs *args, | 254 struct NaClChromeMainArgs *args, |
248 int *exit_status); | 255 int *exit_status); |
249 | 256 |
250 /* | 257 /* |
251 * NaClExit() is for doing a graceful exit, when no internal errors | 258 * NaClExit() is for doing a graceful exit, when no internal errors |
252 * have been detected, when the caller wants to return a well-defined | 259 * have been detected, when the caller wants to return a well-defined |
253 * exit status. | 260 * exit status. |
254 * | 261 * |
255 * This is safer than exit(), which does some teardown that can cause running | 262 * This is safer than exit(), which does some teardown that can cause running |
256 * threads to crash. | 263 * threads to crash. |
257 */ | 264 */ |
258 void NaClExit(int code); | 265 void NaClExit(int code); |
259 | 266 |
260 EXTERN_C_END | 267 EXTERN_C_END |
261 | 268 |
262 #endif | 269 #endif |
OLD | NEW |