Index: Source/core/dom/Node.cpp |
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
index 0798dda6c5b079fdd35680c844fb3a3dd533d867..c702d60e53e298c8896ebefd5a138b3dac2ae54b 100644 |
--- a/Source/core/dom/Node.cpp |
+++ b/Source/core/dom/Node.cpp |
@@ -266,12 +266,12 @@ Node::~Node() |
liveNodeSet.remove(this); |
#endif |
+#if !ENABLE(OILPAN) |
if (hasRareData()) |
clearRareData(); |
RELEASE_ASSERT(!renderer()); |
haraken
2014/05/04 01:46:24
Shouldn't this line still be valid in oilpan build
sof
2014/05/04 18:59:22
We shouldn't let go of that assert, but it needs t
|
-#if !ENABLE(OILPAN) |
if (!isContainerNode()) |
willBeDeletedFromDocument(); |
#endif |
@@ -326,36 +326,38 @@ NodeRareData& Node::ensureRareData() |
if (hasRareData()) |
return *rareData(); |
- NodeRareData* data; |
+ OwnPtrWillBeRawPtr<NodeRareData> data; |
if (isElementNode()) |
- data = ElementRareData::create(m_data.m_renderer).leakPtr(); |
+ data = ElementRareData::create(m_data.m_renderer); |
else |
- data = NodeRareData::create(m_data.m_renderer).leakPtr(); |
+ data = NodeRareData::create(m_data.m_renderer); |
+ |
ASSERT(data); |
+#if ENABLE(OILPAN) |
m_data.m_rareData = data; |
+#else |
+ m_data.m_rareData = data.leakPtr(); |
+#endif |
setFlag(HasRareDataFlag); |
- return *data; |
+ return *rareData(); |
} |
+#if !ENABLE(OILPAN) |
void Node::clearRareData() |
{ |
ASSERT(hasRareData()); |
ASSERT(!transientMutationObserverRegistry() || transientMutationObserverRegistry()->isEmpty()); |
RenderObject* renderer = m_data.m_rareData->renderer(); |
- if (isElementNode()) { |
- ElementRareData* rareData = static_cast<ElementRareData*>(m_data.m_rareData); |
- rareData->dispose(); |
- delete rareData; |
- } else { |
- NodeRareData* rareData = static_cast<NodeRareData*>(m_data.m_rareData); |
- rareData->dispose(); |
- delete rareData; |
- } |
+ if (isElementNode()) |
+ delete static_cast<ElementRareData*>(m_data.m_rareData); |
+ else |
+ delete static_cast<NodeRareData*>(m_data.m_rareData); |
m_data.m_renderer = renderer; |
clearFlag(HasRareDataFlag); |
} |
+#endif |
Node* Node::toNode() |
{ |
@@ -2571,6 +2573,9 @@ void Node::setCustomElementState(CustomElementState newState) |
void Node::trace(Visitor* visitor) |
{ |
+ if (hasRareData()) |
+ visitor->trace(rareData()); |
+ |
visitor->trace(m_treeScope); |
} |