[Webkit-unassigned] [Bug 27128] Make Widget Ref-Counted.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 9 14:35:15 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27128


Anders Carlsson <andersca at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andersca at apple.com




--- Comment #4 from Anders Carlsson <andersca at apple.com>  2009-07-09 14:35:15 PDT ---
(In reply to comment #2)
> (From update of attachment 32530 [details])
> 
> > -    const HashSet<Widget*>* viewChildren = children();
> > -    HashSet<Widget*>::const_iterator end = viewChildren->end();
> > -    for (HashSet<Widget*>::const_iterator current = viewChildren->begin(); current != end; ++current)
> > -        if ((*current)->isFrameView())
> > -            static_cast<FrameView*>(*current)->layoutIfNeededRecursive();
> > +    const HashSet<RefPtr<Widget> >* viewChildren = children();
> > +    HashSet<RefPtr<Widget> >::const_iterator end = viewChildren->end();
> > +    for (HashSet<RefPtr<Widget> >::const_iterator current = viewChildren->begin(); current != end; ++current) {
> > +        RefPtr<Widget> widget = (*current);
> > +        if (widget->isFrameView())
> > +            static_cast<FrameView*>(widget.get())->layoutIfNeededRecursive();
> > +    }
> >  
> 
> I don't think the change to use a temporary variable here is helpful, since
> you've created refcounting churn.  I think you should put it back the way it
> was and just use |current|.
> 

It could still be a temporary variable, just as long as you don't make it a
RefPtr.

Widget* widget = (*current).get();

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list