2011-04-25 James Robinson <jamesr@chromium.org>
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Apr 2011 22:54:02 +0000 (22:54 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Apr 2011 22:54:02 +0000 (22:54 +0000)
        Reviewed by Adam Barth.

        Fix strict OwnPtr violations in Render*.cpp
        https://bugs.webkit.org/show_bug.cgi?id=59361

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::RenderBlock):
        (WebCore::RenderBlock::finishDelayUpdateScrollInfo):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::addLayoutOverflow):
        (WebCore::RenderBox::addVisualOverflow):
        * rendering/RenderButton.cpp:
        (WebCore::RenderButton::styleDidChange):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateTransform):
        (WebCore::RenderLayer::paintChildLayerIntoColumns):
        (WebCore::RenderLayer::hitTestChildLayerColumns):
        (WebCore::RenderLayer::ensureBacking):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::styleDidChange):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::compositor):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::addCachedPseudoStyle):
        (WebCore::RenderStyle::accessCounterDirectives):
        (WebCore::RenderStyle::accessAnimations):
        (WebCore::RenderStyle::accessTransitions):
        * rendering/svg/RenderSVGResourceFilter.cpp:
        (WebCore::RenderSVGResourceFilter::applyResource):
        * rendering/svg/SVGResources.cpp:
        (WebCore::SVGResources::SVGResources):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84815 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderButton.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/SVGResources.cpp

index 8d2e891..0772049 100644 (file)
@@ -1,3 +1,37 @@
+2011-04-25  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Adam Barth.
+
+        Fix strict OwnPtr violations in Render*.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=59361
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::RenderBlock):
+        (WebCore::RenderBlock::finishDelayUpdateScrollInfo):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::addLayoutOverflow):
+        (WebCore::RenderBox::addVisualOverflow):
+        * rendering/RenderButton.cpp:
+        (WebCore::RenderButton::styleDidChange):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateTransform):
+        (WebCore::RenderLayer::paintChildLayerIntoColumns):
+        (WebCore::RenderLayer::hitTestChildLayerColumns):
+        (WebCore::RenderLayer::ensureBacking):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::styleDidChange):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::compositor):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::addCachedPseudoStyle):
+        (WebCore::RenderStyle::accessCounterDirectives):
+        (WebCore::RenderStyle::accessAnimations):
+        (WebCore::RenderStyle::accessTransitions):
+        * rendering/svg/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::applyResource):
+        * rendering/svg/SVGResources.cpp:
+        (WebCore::SVGResources::SVGResources):
+
 2011-04-25  Adam Barth  <abarth@webkit.org>
 
         Attempt to fix the compile.
index f1877d8..db32b55 100644 (file)
@@ -112,9 +112,6 @@ RenderBlock::MarginInfo::MarginInfo(RenderBlock* block, int beforeBorderPadding,
 
 RenderBlock::RenderBlock(Node* node)
       : RenderBox(node)
-      , m_floatingObjects(0)
-      , m_positionedObjects(0)
-      , m_rareData(0)
       , m_lineHeight(-1)
       , m_beingDestroyed(false)
 {
@@ -1092,7 +1089,7 @@ void RenderBlock::finishDelayUpdateScrollInfo()
     if (gDelayUpdateScrollInfo == 0) {
         ASSERT(gDelayedUpdateScrollInfoSet);
 
-        OwnPtr<DelayedUpdateScrollInfoSet> infoSet(gDelayedUpdateScrollInfoSet);
+        OwnPtr<DelayedUpdateScrollInfoSet> infoSet(adoptPtr(gDelayedUpdateScrollInfoSet));
         gDelayedUpdateScrollInfoSet = 0;
 
         for (DelayedUpdateScrollInfoSet::iterator it = infoSet->begin(); it != infoSet->end(); ++it) {
index e23c54e..14d279e 100644 (file)
@@ -3269,7 +3269,7 @@ void RenderBox::addLayoutOverflow(const IntRect& rect)
     }
 
     if (!m_overflow)
-        m_overflow.set(new RenderOverflow(clientBox, borderBoxRect()));
+        m_overflow = adoptPtr(new RenderOverflow(clientBox, borderBoxRect()));
     
     m_overflow->addLayoutOverflow(overflowRect);
 }
@@ -3281,7 +3281,7 @@ void RenderBox::addVisualOverflow(const IntRect& rect)
         return;
         
     if (!m_overflow)
-        m_overflow.set(new RenderOverflow(clientBoxRect(), borderBox));
+        m_overflow = adoptPtr(new RenderOverflow(clientBoxRect(), borderBox));
     
     m_overflow->addVisualOverflow(rect);
 }
index 4bf7c19..84f526d 100644 (file)
@@ -95,7 +95,7 @@ void RenderButton::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
 
     if (!m_default && theme()->isDefault(this)) {
         if (!m_timer)
-            m_timer.set(new Timer<RenderButton>(this, &RenderButton::timerFired));
+            m_timer = adoptPtr(new Timer<RenderButton>(this, &RenderButton::timerFired));
         m_timer->startRepeating(0.03);
         m_default = true;
     } else if (m_default && !theme()->isDefault(this)) {
index 57f305c..8b62f92 100644 (file)
@@ -426,7 +426,7 @@ void RenderLayer::updateTransform()
     bool hadTransform = m_transform;
     if (hasTransform != hadTransform) {
         if (hasTransform)
-            m_transform.set(new TransformationMatrix);
+            m_transform = adoptPtr(new TransformationMatrix);
         else
             m_transform.clear();
     }
@@ -2764,10 +2764,10 @@ void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, RenderLaye
                 TransformationMatrix newTransform(oldTransform);
                 newTransform.translateRight(offset.width(), offset.height());
                 
-                childLayer->m_transform.set(new TransformationMatrix(newTransform));
+                childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform));
                 childLayer->paintLayer(rootLayer, context, localDirtyRect, paintBehavior, paintingRoot, overlapTestRequests, paintFlags);
                 if (oldHasTransform)
-                    childLayer->m_transform.set(new TransformationMatrix(oldTransform));
+                    childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform));
                 else
                     childLayer->m_transform.clear();
             } else {
@@ -3248,10 +3248,10 @@ RenderLayer* RenderLayer::hitTestChildLayerColumns(RenderLayer* childLayer, Rend
                 TransformationMatrix newTransform(oldTransform);
                 newTransform.translateRight(offset.width(), offset.height());
                 
-                childLayer->m_transform.set(new TransformationMatrix(newTransform));
+                childLayer->m_transform = adoptPtr(new TransformationMatrix(newTransform));
                 hitLayer = childLayer->hitTestLayer(rootLayer, columnLayers[0], request, result, localClipRect, hitTestPoint, false, transformState, zOffset);
                 if (oldHasTransform)
-                    childLayer->m_transform.set(new TransformationMatrix(oldTransform));
+                    childLayer->m_transform = adoptPtr(new TransformationMatrix(oldTransform));
                 else
                     childLayer->m_transform.clear();
             } else {
@@ -3609,7 +3609,7 @@ void RenderLayer::clearClipRects()
 RenderLayerBacking* RenderLayer::ensureBacking()
 {
     if (!m_backing)
-        m_backing.set(new RenderLayerBacking(this));
+        m_backing = adoptPtr(new RenderLayerBacking(this));
     return m_backing.get();
 }
 
index 010b9c1..47cd453 100644 (file)
@@ -85,9 +85,9 @@ void RenderTable::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
         // According to the CSS2 spec, you only use fixed table layout if an
         // explicit width is specified on the table.  Auto width implies auto table layout.
         if (style()->tableLayout() == TFIXED && !style()->logicalWidth().isAuto())
-            m_tableLayout.set(new FixedTableLayout(this));
+            m_tableLayout = adoptPtr(new FixedTableLayout(this));
         else
-            m_tableLayout.set(new AutoTableLayout(this));
+            m_tableLayout = adoptPtr(new AutoTableLayout(this));
     }
 }
 
index ed221a5..0cc0eed 100644 (file)
@@ -782,7 +782,7 @@ bool RenderView::usesCompositing() const
 RenderLayerCompositor* RenderView::compositor()
 {
     if (!m_compositor)
-        m_compositor.set(new RenderLayerCompositor(this));
+        m_compositor = adoptPtr(new RenderLayerCompositor(this));
 
     return m_compositor.get();
 }
index 60518f7..6e4c788 100644 (file)
@@ -250,7 +250,7 @@ RenderStyle* RenderStyle::addCachedPseudoStyle(PassRefPtr<RenderStyle> pseudo)
     RenderStyle* result = pseudo.get();
 
     if (!m_cachedPseudoStyles)
-        m_cachedPseudoStyles.set(new PseudoStyleCache);
+        m_cachedPseudoStyles = adoptPtr(new PseudoStyleCache);
 
     m_cachedPseudoStyles->append(pseudo);
 
@@ -849,8 +849,8 @@ CounterDirectiveMap& RenderStyle::accessCounterDirectives()
 {
     OwnPtr<CounterDirectiveMap>& map = rareNonInheritedData.access()->m_counterDirectives;
     if (!map)
-        map.set(new CounterDirectiveMap);
-    return *map.get();
+        map = adoptPtr(new CounterDirectiveMap);
+    return *map;
 }
 
 const AtomicString& RenderStyle::hyphenString() const
@@ -996,14 +996,14 @@ void RenderStyle::adjustTransitions()
 AnimationList* RenderStyle::accessAnimations()
 {
     if (!rareNonInheritedData.access()->m_animations)
-        rareNonInheritedData.access()->m_animations.set(new AnimationList());
+        rareNonInheritedData.access()->m_animations = adoptPtr(new AnimationList());
     return rareNonInheritedData->m_animations.get();
 }
 
 AnimationList* RenderStyle::accessTransitions()
 {
     if (!rareNonInheritedData.access()->m_transitions)
-        rareNonInheritedData.access()->m_transitions.set(new AnimationList());
+        rareNonInheritedData.access()->m_transitions = adoptPtr(new AnimationList());
     return rareNonInheritedData->m_transitions.get();
 }
 
index 09195f5..1d0766c 100644 (file)
@@ -153,7 +153,7 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
         delete m_filter.take(object); // Oops, have to rebuild, go through normal code path
     }
 
-    OwnPtr<FilterData> filterData(new FilterData);
+    OwnPtr<FilterData> filterData(adoptPtr(new FilterData));
     FloatRect targetBoundingBox = object->objectBoundingBox();
 
     SVGFilterElement* filterElement = static_cast<SVGFilterElement*>(node());
index d3cd184..2704443 100644 (file)
 namespace WebCore {
 
 SVGResources::SVGResources()
-    : m_clipperFilterMaskerData(0)
-    , m_markerData(0)
-    , m_fillStrokeData(0)
-    , m_linkedResource(0)
+    : m_linkedResource(0)
 {
 }