Move parent pointer from TreeShared to subclass
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2013 18:11:30 +0000 (18:11 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Jan 2013 18:11:30 +0000 (18:11 +0000)
commit11945bc5592f99447e7689fff320ba5d1375e1df
tree664ed21b014e3d3ac9ab300951230db574a06917
parent1a3e4cfac67253f57b9db999938943de954b6ee8
Move parent pointer from TreeShared to subclass
https://bugs.webkit.org/show_bug.cgi?id=106910

Reviewed by Darin Adler.

This simplifies both TreeShared and clients, and makes code dealing with parents more understandable in general.

* dom/Document.h:
(WebCore::Node::Node):
* dom/Node.cpp:
(WebCore::Node::reportMemoryUsage):
* dom/Node.h:

    Add m_parentOrHostNode variable (matching the accessor names).

(Node):
(WebCore::Node::hasTreeSharedParent):
(WebCore::Node::parentNode):
(WebCore::Node::setParentOrHostNode):
(WebCore::Node::parentOrHostNode):
* platform/TreeShared.h:
(WebCore):
(WebCore::TreeShared::TreeShared):
(WebCore::TreeShared::deref):

    Call subclass hasTreeSharedParent() to figure out if it is time to delete.

(TreeShared):

    Remove parent pointer and accessors.
    Remove ParentNodeType template parameter.
    Remove now unnecessay reportMemoryUsage().

(WebCore::adopted):
* svg/SVGElementInstance.cpp:
(WebCore::SVGElementInstance::SVGElementInstance):
* svg/SVGElementInstance.h:

    Add m_parentInstance variable.

(WebCore::SVGElementInstance::setParentOrHostNode):
(WebCore::SVGElementInstance::parentNode):
(SVGElementInstance):
(WebCore::SVGElementInstance::hasTreeSharedParent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/platform/TreeShared.h
Source/WebCore/svg/SVGElementInstance.cpp
Source/WebCore/svg/SVGElementInstance.h