JS: Add concept of thread destroy

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-03-21 18:57:57 +00:00
parent 17b28e85c1
commit 337082f715
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
2 changed files with 18 additions and 0 deletions

View File

@ -96,6 +96,20 @@ void js_destroyheap(jsheap *heap);
*/ */
nserror js_newthread(jsheap *heap, void *win_priv, void *doc_priv, jsthread **thread); 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 * execute some javascript in a context
*/ */

View File

@ -51,6 +51,10 @@ nserror js_newthread(jsheap *heap, void *win_priv, void *doc_priv, jsthread **th
return NSERROR_NOT_IMPLEMENTED; return NSERROR_NOT_IMPLEMENTED;
} }
void js_destroythread(jsthread *thread)
{
}
bool js_exec(jsthread *thread, const uint8_t *txt, size_t txtlen, const char *name) bool js_exec(jsthread *thread, const uint8_t *txt, size_t txtlen, const char *name)
{ {
return true; return true;