RESOLVED FIXED 78740
Made Weak<T> single-owner, adding PassWeak<T>
https://bugs.webkit.org/show_bug.cgi?id=78740
Summary Made Weak<T> single-owner, adding PassWeak<T>
Geoffrey Garen
Reported 2012-02-15 14:06:14 PST
Made Weak<T> single-owner, adding PassWeak<T>
Attachments
Patch (27.87 KB, patch)
2012-02-15 14:52 PST, Geoffrey Garen
sam: review+
webkit-ews: commit-queue-
Geoffrey Garen
Comment 1 2012-02-15 14:52:37 PST
Geoffrey Garen
Comment 2 2012-02-15 14:58:26 PST
*** Bug 76335 has been marked as a duplicate of this bug. ***
Sam Weinig
Comment 3 2012-02-15 15:51:13 PST
Comment on attachment 127241 [details] Patch One idiom we have been adopting with other smart pointers in WebKit is that you never explicitly construct the Pass type, but rather have a friend function that does it, e.g. adoptPtr() and adoptRef(). Not sure that is necessary here but wanted to mention it.
Early Warning System Bot
Comment 4 2012-02-15 18:39:26 PST
Geoffrey Garen
Comment 5 2012-02-16 17:12:03 PST
> One idiom we have been adopting with other smart pointers in WebKit is that you never explicitly construct the Pass type, but rather have a friend function that does it, e.g. adoptPtr() and adoptRef(). Not sure that is necessary here but wanted to mention it. Why do we do that? I might be able to replicate something similar for PassWeak<T> if I understand the intention. It's not trivial replicable, though, because a PassWeak<T> needs to allocate a backing handle, which the client doesn't initially have available for adoption.
Geoffrey Garen
Comment 6 2012-02-16 17:26:47 PST
... I might be able to make it work in a future patch that makes the backing for a *Weak<T> an explicit object.
Geoffrey Garen
Comment 7 2012-02-16 17:56:19 PST
Note You need to log in before you can comment on or make changes to this bug.