[Webkit-unassigned] [Bug 75543] [GTK] Add webkit_web_view_run_javascript() to WebKit2 GTK+
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Mar 21 01:02:39 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=75543
--- Comment #18 from Carlos Garcia Campos <cgarcia at igalia.com> 2012-03-21 01:02:37 PST ---
(In reply to comment #17)
> (From update of attachment 132244 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=132244&action=review
>
> > Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp:38
> > +struct _WebKitJavascriptResult {
> > + _WebKitJavascriptResult(WebKitWebView* view, WKSerializedScriptValueRef wkSerializedScriptValue)
> > + : webView(view)
> > + , referenceCount(1)
> > + {
> > + value = WKSerializedScriptValueDeserialize(wkSerializedScriptValue, webkit_web_view_get_javascript_global_context(view), 0);
> > + }
> > +
> > + GRefPtr<WebKitWebView> webView;
> > + JSValueRef value;
> > +
> > + int referenceCount;
> > +};
>
> Instead of implementing your own reference counted type you could make this class extend from RefCounted<_WebKitJavaScriptResult> and use ref() and unref().
Is it worth converting that to a class? Is RefCounted better than our own implementation? it seems to use a mutex, while our implementation avoid the use of mutex by using atomic operations. I'll leave our current implementation for now, since it's pretty simple, and I'll write a patch to use RefCounted if it's really worth it and better.
> > Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:1504
> > + g_set_error_literal(&error, WEBKIT_JAVASCRIPT_ERROR, WEBKIT_JAVASCRIPT_ERROR_SCRIPT_FAILED, _("An exception was raised in Javascript"));
>
> Javascript -> JavaScript
Ok.
--
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