[Webkit-unassigned] [Bug 117153] [GTK] Migrate WebKitWebContext to GTask

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 4 06:37:59 PDT 2013


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





--- Comment #7 from Carlos Garcia Campos <cgarcia at igalia.com>  2013-06-04 06:36:32 PST ---
(In reply to comment #6)
> (From update of attachment 203663 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=203663&action=review
> 
> OK. Belatedly I notice that this has the same issue as the other bug; you're passing back one data structure via the GTask, and then converting it into a different data structure in the _finish function, when you could instead just be creating the final data structure in webkitWebContextGetPluginThread() and returning it directly. You'd still need to write your own GDestroyNotify though, so this wouldn't actually simplify anything, it just moves code around. (But stylistically, my theory was that GTask _finish functions should almost always consist of only a call to g_task_propagate_something().

Thought about it indeed, but tried to reduce the amount of things done in the thread. Also as you say it wouldn't simply the code either.

> > Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp:498
> > +static void deletePluginsVector(void* ptr)
> > +{
> > +    delete static_cast<Vector<PluginModuleInfo>*>(ptr);
> > +}
> 
> Hm... I bet you could do cool code-autogenerating things with GTask and templates, a la GRefPtr... :)

I tried it adding template <typename T*> void deletePtrFunction(T* ptr);. But it doesn't simply the code either, but rather the opposite with more C++ casts everywhere.

-- 
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