On Nov 28, 2009, at 12:09 AM, pattin.shieh wrote:

> Look at this:void Page::setMainFrame(PassRefPtr<Frame> mainFrame). Why use 
> PassRefPtr?

Because the only call to Page::setMainFrame is inside the Frame constructor, 
there is no performance benefit to taking a PassRefPtr.

But it’s arguably a good practice for a function that takes ownership of its 
argument to take a PassRefPtr even in cases where there is no performance 
benefit. It’s how the function states that it will keep a reference.

    -- Darin

_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to