PSA: Plan to remove PassRefPtr

36 views
Skip to first unread message

Bugs Nash

unread,
Aug 25, 2016, 5:49:35 PM8/25/16
to blink-dev, Yuta Kitamura

As per previous threads here and here, PassRefPtr will soon be removed. I have started working on the removal (tracking bug here).


New usage


Soon you will no longer be able to use PassRefPtr to pass ownership of a RefCounted object. Instead, when passing RefCounted objects:

  • If you no longer need access to the object, pass a RefPtr using std::move() (replaces passing a PassRefPtr normally or passing a RefPtr using .release())

  • If you still need access to the object, pass a RefPtr normally (replaces passing a PassRefPtr using .get())


I plan to create a more detailed RefPtr usage guide in future :) Feel free to send me questions/comments.


Cheers

Bugs

Kentaro Hara

unread,
Aug 25, 2016, 9:52:22 PM8/25/16
to Bugs Nash, blink-dev, Yuta Kitamura
This is amazing!

Would there be any way to measure the performance impact of removing PassRefPtr? I do support the replacement but want to make sure that it doesn't regress performance before starting the replacement incrementally :)




--
Kentaro Hara, Tokyo, Japan

Yuta Kitamura

unread,
Aug 26, 2016, 7:04:30 AM8/26/16
to Kentaro Hara, Bugs Nash, blink-dev
On Fri, Aug 26, 2016 at 10:51 AM, Kentaro Hara <har...@chromium.org> wrote:
This is amazing!

Would there be any way to measure the performance impact of removing PassRefPtr? I do support the replacement but want to make sure that it doesn't regress performance before starting the replacement incrementally :)

I'm not concerned about the performance; that should be the same as what I've done during the OwnPtr migration.
Reply all
Reply to author
Forward
0 new messages