Changeset 79834 in webkit
- Timestamp:
- Feb 27, 2011 5:33:53 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r79825 r79834 1 2011-02-27 Benjamin Poulain <benjamin.poulain@nokia.com> 2 3 Reviewed by Sam Weinig. 4 5 Use OwnPtr to handle the memory of RenderBlock::m_floatingObjects and RenderBlock::m_positionedObjects 6 https://bugs.webkit.org/show_bug.cgi?id=55327 7 8 Refactor RenderBlock to use OwnPtr for m_floatingObjects and m_positionedObjects so we do not have 9 to release the memory manually. 10 11 * rendering/RenderBlock.cpp: 12 (WebCore::RenderBlock::~RenderBlock): 13 (WebCore::RenderBlock::selectionGaps): 14 (WebCore::RenderBlock::insertPositionedObject): 15 (WebCore::RenderBlock::insertFloatingObject): 16 (WebCore::RenderBlock::addOverhangingFloats): 17 (WebCore::RenderBlock::addIntrudingFloats): 18 * rendering/RenderBlock.h: 19 (WebCore::RenderBlock::positionedObjects): 20 1 21 2011-02-27 Benjamin Poulain <benjamin.poulain@nokia.com> 2 22 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r79817 r79834 125 125 if (m_floatingObjects) 126 126 deleteAllValues(*m_floatingObjects); 127 delete m_floatingObjects;128 delete m_positionedObjects;129 127 130 128 if (hasColumns()) … … 2753 2751 rootBlock->flipForWritingMode(flippedBlockRect); 2754 2752 flippedBlockRect.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y()); 2755 clipOutPositionedObjects(paintInfo, flippedBlockRect.location(), m_positionedObjects );2753 clipOutPositionedObjects(paintInfo, flippedBlockRect.location(), m_positionedObjects.get()); 2756 2754 if (isBody() || isRoot()) // The <body> must make sure to examine its containingBlock's positioned objects. 2757 2755 for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock()) 2758 clipOutPositionedObjects(paintInfo, IntPoint(cb->x(), cb->y()), cb->m_positionedObjects ); // FIXME: Not right for flipped writing modes.2756 clipOutPositionedObjects(paintInfo, IntPoint(cb->x(), cb->y()), cb->m_positionedObjects.get()); // FIXME: Not right for flipped writing modes. 2759 2757 if (m_floatingObjects) { 2760 2758 FloatingObjectSetIterator end = m_floatingObjects->end(); … … 3018 3016 // Create the list of special objects if we don't aleady have one 3019 3017 if (!m_positionedObjects) 3020 m_positionedObjects = new PositionedObjectsListHashSet;3018 m_positionedObjects = adoptPtr(new PositionedObjectsListHashSet); 3021 3019 3022 3020 m_positionedObjects->add(o); … … 3068 3066 // Create the list of special objects if we don't aleady have one 3069 3067 if (!m_floatingObjects) 3070 m_floatingObjects = new FloatingObjectSet;3068 m_floatingObjects = adoptPtr(new FloatingObjectSet); 3071 3069 else { 3072 3070 // Don't insert the object again if it's already in the list … … 3649 3647 // We create the floating object list lazily. 3650 3648 if (!m_floatingObjects) 3651 m_floatingObjects = new FloatingObjectSet;3649 m_floatingObjects = adoptPtr(new FloatingObjectSet); 3652 3650 3653 3651 m_floatingObjects->add(floatingObj); … … 3708 3706 // We create the floating object list lazily. 3709 3707 if (!m_floatingObjects) 3710 m_floatingObjects = new FloatingObjectSet;3708 m_floatingObjects = adoptPtr(new FloatingObjectSet); 3711 3709 m_floatingObjects->add(floatingObj); 3712 3710 } -
trunk/Source/WebCore/rendering/RenderBlock.h
r79817 r79834 28 28 #include "RenderLineBoxList.h" 29 29 #include "RootInlineBox.h" 30 #include <wtf/OwnPtr.h> 30 31 #include <wtf/ListHashSet.h> 31 32 … … 81 82 82 83 typedef ListHashSet<RenderBox*, 4> PositionedObjectsListHashSet; 83 PositionedObjectsListHashSet* positionedObjects() const { return m_positionedObjects ; }84 PositionedObjectsListHashSet* positionedObjects() const { return m_positionedObjects.get(); } 84 85 85 86 void addPercentHeightDescendant(RenderBox*); … … 713 714 typedef ListHashSet<FloatingObject*, 4, FloatingObjectHashFunctions> FloatingObjectSet; 714 715 typedef FloatingObjectSet::const_iterator FloatingObjectSetIterator; 715 FloatingObjectSet*m_floatingObjects;716 OwnPtr<FloatingObjectSet> m_floatingObjects; 716 717 717 718 typedef PositionedObjectsListHashSet::const_iterator Iterator; 718 PositionedObjectsListHashSet*m_positionedObjects;719 OwnPtr<PositionedObjectsListHashSet> m_positionedObjects; 719 720 720 721 // Allocated only when some of these fields have non-default values
Note: See TracChangeset
for help on using the changeset viewer.