[webkit-help] Calling JSObjectCallAsFunction from a worker

Dan Minor dminor at cranksoftware.com
Tue Dec 13 08:33:43 PST 2011


Hi Ben,

I was able to get something similar to what you are trying to do working by subclassing 
ScriptExecutionContext::Task and using the ScriptExecutionContext::postTask() method.

You can get the ScriptExecutionContext from the current DOMWindow.

Dan

On 12/13/2011 10:24 AM, demallien wrote:
> Hi Ben,
>
> The short answer is no - you need to call JSObjectCallAsFunction from the same thread that you
> created you JSContextRef in.
>
> Allison
>
>>
>> Message: 1
>> Date: Mon, 12 Dec 2011 21:00:25 +0000
>> From: Ben Short <ben at benshort.co.uk <mailto:ben at benshort.co.uk>>
>> To: webkit-help at lists.webkit.org <mailto:webkit-help at lists.webkit.org>
>> Subject: [webkit-help] Calling JSObjectCallAsFunction from a worker
>> thread
>> Message-ID:
>> <CAOiKr=tSF4ieDRmsFsNNUGGgJWd72yeBaDqVV0GJm6zfi3K1rw at mail.gmail.com
>> <mailto:tSF4ieDRmsFsNNUGGgJWd72yeBaDqVV0GJm6zfi3K1rw at mail.gmail.com>>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> Hi,
>>
>> I have created a custom javascript object using the JavaScriptCore
>> API. My object allows listeners to be registered with it. I need to
>> call these listeners on various events from a worker thread that is
>> created when the object is instantiated.
>>
>> Is it safe to call the JSObjectCallAsFunction function from a worker thread?
>>
>> Regards
>>
>> Ben Short
>>
>>
>
>
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help


More information about the webkit-help mailing list