[webkit-help] how to get ExecState from ScriptExecutionContext

JaeBok Lee jaebok.lee at gmail.com
Wed Oct 12 17:34:41 PDT 2011


I think you can find the answer in JSEventListener::handleEvent method.

JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext,
> m_isolatedWorld.get());
> ...
> ExecState* exec = globalObject->globalExec();


2011/10/12 Per Bothner <per.bothner at oracle.com>

> In our WebNode implementation (part of JavaFX) we have a class
> JavaEventListener, which extends WebCore::EventListener.
> The virtual handleEvent method takes a ScriptExecutionContext*
> and an Event*, as in the parent class.  This methods needs to map the
> WebKit Event to a Java Event.
>
> The Java Event object needs access to the ExecState.  (The reason is
> that the Java Event object has methods like getSrcElement, which
> return a Java Node object, and for convenience this Node object also
> has access to the corresponding JavaScript object.  The various
> JavaScript operations make use of JSGlobalContextRef which is the
> same as ExecState.)
>
> So the question is there an approved way to get from a
> ScriptExecutionContext
> to an ExecState/CallFrame/**JSGlobalContextRef?  I've looked through the
> source code, but haven't found the solution.
> --
>        --Per Bothner
> per.bothner at oracle.com   per at bothner.com   http://per.bothner.com/
> ______________________________**_________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/**mailman/listinfo.cgi/webkit-**help<http://lists.webkit.org/mailman/listinfo.cgi/webkit-help>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20111013/047b6ed2/attachment.html>


More information about the webkit-help mailing list