0
0
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:
Miciah Dashiel Butler Masters
2009-07-18 23:41:01 +00:00
parent 1208a8dd2a
commit f31cf6f9fe
7 changed files with 201 additions and 5 deletions

View File

@@ -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).