summaryrefslogtreecommitdiff
path: root/content/handlers
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-03-21 18:57:57 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-03-21 18:57:57 +0000
commit337082f715951fe9f5b46f1a4710ca415f67e22d (patch)
tree4ce1af4e2451c1af27cf3151a578173447684277 /content/handlers
parent17b28e85c12309d60e3c45acb096b9989a7834ff (diff)
downloadnetsurf-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')
-rw-r--r--content/handlers/javascript/js.h14
-rw-r--r--content/handlers/javascript/none/none.c4
2 files changed, 18 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);
diff --git a/content/handlers/javascript/none/none.c b/content/handlers/javascript/none/none.c
index b79d3242f..ff09f52c9 100644
--- a/content/handlers/javascript/none/none.c
+++ b/content/handlers/javascript/none/none.c
@@ -51,6 +51,10 @@ nserror js_newthread(jsheap *heap, void *win_priv, void *doc_priv, jsthread **th
return NSERROR_NOT_IMPLEMENTED;
}
+void js_destroythread(jsthread *thread)
+{
+}
+
bool js_exec(jsthread *thread, const uint8_t *txt, size_t txtlen, const char *name)
{
return true;