diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2020-03-21 18:57:57 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2020-03-21 18:57:57 +0000 |
commit | 337082f715951fe9f5b46f1a4710ca415f67e22d (patch) | |
tree | 4ce1af4e2451c1af27cf3151a578173447684277 /content/handlers/javascript/js.h | |
parent | 17b28e85c12309d60e3c45acb096b9989a7834ff (diff) | |
download | netsurf-337082f715951fe9f5b46f1a4710ca415f67e22d.tar.gz netsurf-337082f715951fe9f5b46f1a4710ca415f67e22d.tar.bz2 |
JS: Add concept of thread destroy
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'content/handlers/javascript/js.h')
-rw-r--r-- | content/handlers/javascript/js.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/content/handlers/javascript/js.h b/content/handlers/javascript/js.h index 126cb7cfb..ce9bb9ba4 100644 --- a/content/handlers/javascript/js.h +++ b/content/handlers/javascript/js.h @@ -97,6 +97,20 @@ void js_destroyheap(jsheap *heap); nserror js_newthread(jsheap *heap, void *win_priv, void *doc_priv, jsthread **thread); /** + * Destroy a javascript thread + * + * This should be called when the browsing context is done with the thread. + * + * Essentially it should be called when the content is about to be destroyed + * but in reality it can be called when the browser window relinquishes its + * handle on the content since nominally the browser window itself owns + * the thread. + * + * \param thread The thread to be destroyed + */ +void js_destroythread(jsthread *thread); + +/** * execute some javascript in a context */ bool js_exec(jsthread *thread, const uint8_t *txt, size_t txtlen, const char *name); |