https://bugs.webkit.org/show_bug.cgi?id=99111
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Oct 2012 23:48:53 +0000 (23:48 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Oct 2012 23:48:53 +0000 (23:48 +0000)
ScrollingStateNode should keep its Vector of children in an OwnPtr

Reviewed by Ada Chan.

Vector<OwnPtr<ScrollingStateNode> >* m_children; is now:
 OwnPtr<Vector<OwnPtr<ScrollingStateNode> > > m_children;
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::ScrollingStateNode):
(WebCore::ScrollingStateNode::~ScrollingStateNode):
(WebCore::ScrollingStateNode::appendChild):
* page/scrolling/ScrollingStateNode.h:
(ScrollingStateNode):

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

Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ScrollingStateNode.cpp
Source/WebCore/page/scrolling/ScrollingStateNode.h

index 14ba1ff..c7f0f98 100644 (file)
@@ -1,3 +1,19 @@
+2012-10-11  Beth Dakin  <bdakin@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=99111
+        ScrollingStateNode should keep its Vector of children in an OwnPtr
+
+        Reviewed by Ada Chan.
+
+        Vector<OwnPtr<ScrollingStateNode> >* m_children; is now:
+         OwnPtr<Vector<OwnPtr<ScrollingStateNode> > > m_children;
+        * page/scrolling/ScrollingStateNode.cpp:
+        (WebCore::ScrollingStateNode::ScrollingStateNode):
+        (WebCore::ScrollingStateNode::~ScrollingStateNode):
+        (WebCore::ScrollingStateNode::appendChild):
+        * page/scrolling/ScrollingStateNode.h:
+        (ScrollingStateNode):
+
 2012-10-11  Levi Weintraub  <leviw@chromium.org>
 
         [Sub pixel layout] Fast-path iframe scrolling can picks up an extra pixel
index 26bf974..495b97d 100644 (file)
@@ -35,7 +35,6 @@ namespace WebCore {
 ScrollingStateNode::ScrollingStateNode(ScrollingStateTree* scrollingStateTree)
     : m_scrollingStateTree(scrollingStateTree)
     , m_parent(0)
-    , m_children(0)
     , m_scrollLayerDidChange(false)
 {
 }
@@ -46,7 +45,6 @@ ScrollingStateNode::ScrollingStateNode(ScrollingStateTree* scrollingStateTree)
 ScrollingStateNode::ScrollingStateNode(ScrollingStateNode* stateNode)
     : m_scrollingStateTree(0)
     , m_parent(0)
-    , m_children(0)
     , m_scrollLayerDidChange(stateNode->scrollLayerDidChange())
 {
     setScrollLayer(stateNode->platformScrollLayer());
@@ -54,7 +52,6 @@ ScrollingStateNode::ScrollingStateNode(ScrollingStateNode* stateNode)
 
 ScrollingStateNode::~ScrollingStateNode()
 {
-    delete m_children;
 }
 
 void ScrollingStateNode::cloneAndResetChildNodes(ScrollingStateNode* clone)
@@ -72,7 +69,7 @@ void ScrollingStateNode::appendChild(PassOwnPtr<ScrollingStateNode> childNode)
     childNode->setParent(this);
 
     if (!m_children)
-        m_children = new Vector<OwnPtr<ScrollingStateNode> >;
+        m_children = adoptPtr(new Vector<OwnPtr<ScrollingStateNode> >);
 
     m_children->append(childNode);
 }
index d9064ca..c637bf3 100644 (file)
@@ -83,7 +83,7 @@ protected:
 private:
     ScrollingStateNode* m_parent;
 
-    Vector<OwnPtr<ScrollingStateNode> >* m_children;
+    OwnPtr<Vector<OwnPtr<ScrollingStateNode> > > m_children;
 
     bool m_scrollLayerDidChange;