mirror of
https://github.com/rkd77/elinks.git
synced 2025-09-21 19:46:23 -04:00
Heartbeat code using JS_TriggerOperationCallback
Implement new heartbeat code to catch runaway execution of document ECMAScript code. The old code uses JS_SetBranchCallback which is deprecated in new versions of SpiderMonkey. The new code uses setitimer(2) and the JS_SetOperationCallback and JS_TriggerOperationCallback interfaces, introduced in SpiderMonkey 1.8.1. Compatibility with both the old JS_SetBranchCallback and the new interfaces is maintained.
This commit is contained in:
@@ -32,7 +32,11 @@ struct ecmascript_interpreter {
|
||||
/* The code evaluated by setTimeout() */
|
||||
struct string code;
|
||||
|
||||
#if defined(CONFIG_ECMASCRIPT_SMJS_HEARTBEAT)
|
||||
struct heartbeat *heartbeat;
|
||||
#elif defined(HAVE_JS_SETBRANCHCALLBACK)
|
||||
time_t exec_start;
|
||||
#endif
|
||||
|
||||
/* This is a cross-rerenderings accumulator of
|
||||
* @document.onload_snippets (see its description for juicy details).
|
||||
|
Reference in New Issue
Block a user