The idea is to replace GOwnPtr with a new simpler class derived the std:unique_ptr. Not everything can be replaced, though, because GOwnPtr::outPtr() doesn't seem to be possible to implement with unique_ptr.
Created attachment 221454 [details]
This is a first patch adding support for glib types already supported by GOwnPtr, except GError that is usually used with GOwnPtr::outPtr(). Then, adding support for Soup and GTK/GDK types would be a matter of defining a macro FOR_EACH_SOUP_DELETER, FOR_EACH_GDK_DELETER, etc and call it with DEFINE_DELETER. I'll also start porting existing code to GUniquePtr once/if this patch lands.
Created attachment 221457 [details]
Undef the FOR_EACH_GLIB_DELETER after using it.
Created attachment 221458 [details]
Forgot to git add the tests makefile changes.
Created attachment 221461 [details]
Simply made the operator() of the deleters const.
Created attachment 221470 [details]
Even simpler patch using template alias
This is even simpler now using a template alias as suggested in bug #126255
Created attachment 221754 [details]
Added deleter for GError and prefixed the DEFINE_DELETER macro with WTF since it's public macro to be used by others.
Comment on attachment 221754 [details]
LGTM, pitty we can't extend std::unique_ptr, but then again, not sure how sane that would be.
Committed r162516: <http://trac.webkit.org/changeset/162516>
*** Bug 126255 has been marked as a duplicate of this bug. ***