At the moment, unlike most of WTF smart pointers, PassOwnPtr can take either the pointer type or the pointed-to type. It means that OwnPtr<SomeType> is the same as OwnPtr<SomeType*> which is wrong for the following reasons: 1) It distinguishes OwnPtr behaviour from other WTF (and not only WTF!) smart pointer classes behaviour 2) The code like OwnPtr<SomeType> a; OwnPtr<SomeType*> b = adoptRef(..); a = b.release(); looks weird 3) It is potentially error-prone as it actually modifies the type given by the Client in opaque way.
Created attachment 210616 [details] patch
Comment on attachment 210616 [details] patch Attachment 210616 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/1691867
Created attachment 210625 [details] try fix Win
Comment on attachment 210625 [details] try fix Win Attachment 210625 [details] did not pass win-ews (win): Output: http://webkit-queues.appspot.com/results/1692916
RetainPtr also has this feature.
(In reply to comment #5) > RetainPtr also has this feature. RetainPtr has this for a good reason. OwnPtr has this to support putting GDI objects in OwnPtrs. I think we should add a new smart pointer for GDI objects and make OwnPtr simpler.
(In reply to comment #6) > (In reply to comment #5) > > RetainPtr also has this feature. > > RetainPtr has this for a good reason. OwnPtr has this to support putting GDI objects in OwnPtrs. > > I think we should add a new smart pointer for GDI objects and make OwnPtr simpler. Brent filed https://bugs.webkit.org/show_bug.cgi?id=120778 following our discussion on IRC.
Ah, right. RetainPtr has this so that it can work with both CF style where the typedef is a pointer type and the NS style where the type is an Objective-C object type.
Created attachment 211290 [details] rebased
Comment on attachment 211290 [details] rebased Clearing flags on attachment: 211290 Committed r155527: <http://trac.webkit.org/changeset/155527>
All reviewed patches have been landed. Closing bug.