| Summary: | [GTK] Add GUniquePtr | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||||||||||
| Component: | Web Template Framework | Assignee: | Nobody <webkit-unassigned> | ||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||
| Severity: | Normal | CC: | andersca, benjamin, cmarcelo, commit-queue, gustavo, pnormand, zan | ||||||||||||||
| Priority: | P2 | Keywords: | Gtk | ||||||||||||||
| Version: | 528+ (Nightly build) | ||||||||||||||||
| Hardware: | Unspecified | ||||||||||||||||
| OS: | Unspecified | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Carlos Garcia Campos
2014-01-17 03:59:04 PST
Created attachment 221454 [details]
Patch
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]
Updated patch
Undef the FOR_EACH_GLIB_DELETER after using it.
Created attachment 221458 [details]
Updated patch
Forgot to git add the tests makefile changes.
Created attachment 221461 [details]
Updated patch
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]
Updated patch
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]
Updated patch
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. *** |