Recently there was a need to make the smart pointer wrapping GLib reference-counted types more general. In this case it was to extend it to Cairo. Here is the bug for that: https://bugs.webkit.org/show_bug.cgi?id=44354 It struck me that the name GRefPtr wasn't very applicable to this type any longer, so I changed it to PlatformRefPtr in my patch. That seemed a bit wordy and others have suggested PRefPtr. Since this naming affects more than just the GTK+ port, I thought I would get some opinions on a name that is easy to type and fitting. Martin
Would this then combine with the Mac/Win port's RetainPtr in some way? On Mon, Aug 23, 2010 at 9:49 AM, Martin Robinson <mrobinson@webkit.org> wrote:
Recently there was a need to make the smart pointer wrapping GLib reference-counted types more general. In this case it was to extend it to Cairo.
Here is the bug for that: https://bugs.webkit.org/show_bug.cgi?id=44354
It struck me that the name GRefPtr wasn't very applicable to this type any longer, so I changed it to PlatformRefPtr in my patch. That seemed a bit wordy and others have suggested PRefPtr. Since this naming affects more than just the GTK+ port, I thought I would get some opinions on a name that is easy to type and fitting.
Martin _______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
On Mon, Aug 23, 2010 at 10:06 AM, Eric Seidel <eric@webkit.org> wrote:
Would this then combine with the Mac/Win port's RetainPtr in some way?
I think it makes a lot of sense to gradually combine our duplicate smart pointer logic into one base or templated class. They all seem to be in WTF, so even more so. Martin
On Aug 23, 2010, at 10:17 AM, Martin Robinson wrote:
On Mon, Aug 23, 2010 at 10:06 AM, Eric Seidel <eric@webkit.org> wrote:
Would this then combine with the Mac/Win port's RetainPtr in some way?
I think it makes a lot of sense to gradually combine our duplicate smart pointer logic into one base or templated class. They all seem to be in WTF, so even more so.
One reason I have not pursued this up until this point is that template classes with multiple arguments result in very unpleasant function names in crash traces and the debugger. See HashMap. At one point I wanted to teach OwnPtr about all the appropriate ways to delete different objects on Windows, but I abandoned that. Enough of it was left behind that the OwnPtr class can be used that way now. If overloading can be used to determine how to do the "take a ref" and "release a ref" functions, then many different subsystems can share a single PassRefPtr/RefPtr class. -- Darin
On Tue, Aug 24, 2010 at 5:31 PM, Darin Adler <darin@apple.com> wrote:
If overloading can be used to determine how to do the "take a ref" and "release a ref" functions, then many different subsystems can share a single PassRefPtr/RefPtr class.
One complication in the GObject case, is that the argument type for g_object_ref(...) and g_object_unref(..) is void*. Perhaps there is some way to engineer around this. Martin
participants (3)
-
Darin Adler
-
Eric Seidel
-
Martin Robinson