[webkit-reviews] review granted: [Bug 75348] Use HashMap<OwnPtr> for RenderBoxRegionInfo map in RenderRegion : [Attachment 120737] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 8 22:06:18 PST 2012


Darin Adler <darin at apple.com> has granted Caio Marcelo de Oliveira Filho
<cmarcelo at webkit.org>'s request for review:
Bug 75348: Use HashMap<OwnPtr> for RenderBoxRegionInfo map in RenderRegion
https://bugs.webkit.org/show_bug.cgi?id=75348

Attachment 120737: Patch
https://bugs.webkit.org/attachment.cgi?id=120737&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=120737&action=review


This is OK. But a better fix for this code is to change m_renderBoxRegionInfo
to be a HashMap<const RenderBox*, RenderBoxRegionInfo>. There is no reason for
all that heap allocation.

> Source/WebCore/rendering/RenderRegion.cpp:221
>  RenderBoxRegionInfo* RenderRegion::takeRenderBoxRegionInfo(const RenderBox*
box)
>  {
> -    return m_renderBoxRegionInfo.take(box);
> +    return m_renderBoxRegionInfo.take(box).leakPtr();
>  }

If we are going to keep this using pointers, then this function should be
changed so that it returns a PassOwnPtr instead of a raw pointer.


More information about the webkit-reviews mailing list