[Webkit-unassigned] [Bug 75543] [GTK] Add webkit_web_view_run_javascript() to WebKit2 GTK+

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Feb 18 07:55:44 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=75543


Martin Robinson <mrobinson at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrobinson at webkit.org




--- Comment #9 from Martin Robinson <mrobinson at webkit.org>  2012-02-18 07:55:43 PST ---
(In reply to comment #8)

> > It seems that there are three things we want to return for every JavaScript invocation: a JSContextRef, a JSValueRef and a JSValueRef for exceptions. I'm not sure the cleanest way to pass all this to the user with the GIO style API.
> 
> why not?

Sorry. This was a little unclear. What I meant here was that I couldn't quickly find any examples of this kind of situation with the GIO style APIs in devhelp. I guessed that you would just need to implement your own GAsyncResult, but I wasn't confident enough to suggest it. I didn't mean to say that we should do away with GIO style APIs.

> So as I suggested before, we could just return a WebKitJavascriptResult object (or boxed type, maybe) containing the context, the value and the exception.

That sound like a good plan.

> I didn't do that because with the current code the JSValueRef is a temporary value that is no longer alive after the execution of the callback. If we use the WebKitJavascriptResult, we could just store the result. I didn't like having to use a callback either.

Great.

One thing that I think would be useful is to create only one JSGlobalContext for the entire WebKitWebView. Every deserialized JavaScript result could use that same global context. This would be useful because it would allow the user to create other bits of JavaScript and even to pass the return values of these APIs to functions that they create. You could add a getter to WebKitWebView for this global context.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list