Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 Node::~Node() | 259 Node::~Node() |
| 260 { | 260 { |
| 261 #ifndef NDEBUG | 261 #ifndef NDEBUG |
| 262 nodeCounter.decrement(); | 262 nodeCounter.decrement(); |
| 263 #endif | 263 #endif |
| 264 | 264 |
| 265 #if DUMP_NODE_STATISTICS | 265 #if DUMP_NODE_STATISTICS |
| 266 liveNodeSet.remove(this); | 266 liveNodeSet.remove(this); |
| 267 #endif | 267 #endif |
| 268 | 268 |
| 269 #if !ENABLE(OILPAN) | |
| 269 if (hasRareData()) | 270 if (hasRareData()) |
| 270 clearRareData(); | 271 clearRareData(); |
| 271 | 272 |
| 272 RELEASE_ASSERT(!renderer()); | 273 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
| |
| 273 | 274 |
| 274 #if !ENABLE(OILPAN) | |
| 275 if (!isContainerNode()) | 275 if (!isContainerNode()) |
| 276 willBeDeletedFromDocument(); | 276 willBeDeletedFromDocument(); |
| 277 #endif | 277 #endif |
| 278 | 278 |
| 279 if (m_previous) | 279 if (m_previous) |
| 280 m_previous->setNextSibling(0); | 280 m_previous->setNextSibling(0); |
| 281 if (m_next) | 281 if (m_next) |
| 282 m_next->setPreviousSibling(0); | 282 m_next->setPreviousSibling(0); |
| 283 | 283 |
| 284 #if !ENABLE(OILPAN) | 284 #if !ENABLE(OILPAN) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 { | 319 { |
| 320 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData()); | 320 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData()); |
| 321 return static_cast<NodeRareData*>(m_data.m_rareData); | 321 return static_cast<NodeRareData*>(m_data.m_rareData); |
| 322 } | 322 } |
| 323 | 323 |
| 324 NodeRareData& Node::ensureRareData() | 324 NodeRareData& Node::ensureRareData() |
| 325 { | 325 { |
| 326 if (hasRareData()) | 326 if (hasRareData()) |
| 327 return *rareData(); | 327 return *rareData(); |
| 328 | 328 |
| 329 NodeRareData* data; | 329 OwnPtrWillBeRawPtr<NodeRareData> data; |
| 330 if (isElementNode()) | 330 if (isElementNode()) |
| 331 data = ElementRareData::create(m_data.m_renderer).leakPtr(); | 331 data = ElementRareData::create(m_data.m_renderer); |
| 332 else | 332 else |
| 333 data = NodeRareData::create(m_data.m_renderer).leakPtr(); | 333 data = NodeRareData::create(m_data.m_renderer); |
| 334 | |
| 334 ASSERT(data); | 335 ASSERT(data); |
| 335 | 336 |
| 337 #if ENABLE(OILPAN) | |
| 336 m_data.m_rareData = data; | 338 m_data.m_rareData = data; |
| 339 #else | |
| 340 m_data.m_rareData = data.leakPtr(); | |
| 341 #endif | |
| 337 setFlag(HasRareDataFlag); | 342 setFlag(HasRareDataFlag); |
| 338 return *data; | 343 return *rareData(); |
| 339 } | 344 } |
| 340 | 345 |
| 346 #if !ENABLE(OILPAN) | |
| 341 void Node::clearRareData() | 347 void Node::clearRareData() |
| 342 { | 348 { |
| 343 ASSERT(hasRareData()); | 349 ASSERT(hasRareData()); |
| 344 ASSERT(!transientMutationObserverRegistry() || transientMutationObserverRegi stry()->isEmpty()); | 350 ASSERT(!transientMutationObserverRegistry() || transientMutationObserverRegi stry()->isEmpty()); |
| 345 | 351 |
| 346 RenderObject* renderer = m_data.m_rareData->renderer(); | 352 RenderObject* renderer = m_data.m_rareData->renderer(); |
| 347 if (isElementNode()) { | 353 if (isElementNode()) |
| 348 ElementRareData* rareData = static_cast<ElementRareData*>(m_data.m_rareD ata); | 354 delete static_cast<ElementRareData*>(m_data.m_rareData); |
| 349 rareData->dispose(); | 355 else |
| 350 delete rareData; | 356 delete static_cast<NodeRareData*>(m_data.m_rareData); |
| 351 } else { | |
| 352 NodeRareData* rareData = static_cast<NodeRareData*>(m_data.m_rareData); | |
| 353 rareData->dispose(); | |
| 354 delete rareData; | |
| 355 } | |
| 356 m_data.m_renderer = renderer; | 357 m_data.m_renderer = renderer; |
| 357 clearFlag(HasRareDataFlag); | 358 clearFlag(HasRareDataFlag); |
| 358 } | 359 } |
| 360 #endif | |
| 359 | 361 |
| 360 Node* Node::toNode() | 362 Node* Node::toNode() |
| 361 { | 363 { |
| 362 return this; | 364 return this; |
| 363 } | 365 } |
| 364 | 366 |
| 365 short Node::tabIndex() const | 367 short Node::tabIndex() const |
| 366 { | 368 { |
| 367 return 0; | 369 return 0; |
| 368 } | 370 } |
| (...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2564 ASSERT(isHTMLElement() || isSVGElement()); | 2566 ASSERT(isHTMLElement() || isSVGElement()); |
| 2565 setFlag(CustomElementFlag); | 2567 setFlag(CustomElementFlag); |
| 2566 setFlag(newState == Upgraded, CustomElementUpgradedFlag); | 2568 setFlag(newState == Upgraded, CustomElementUpgradedFlag); |
| 2567 | 2569 |
| 2568 if (oldState == NotCustomElement || newState == Upgraded) | 2570 if (oldState == NotCustomElement || newState == Upgraded) |
| 2569 setNeedsStyleRecalc(SubtreeStyleChange); // :unresolved has changed | 2571 setNeedsStyleRecalc(SubtreeStyleChange); // :unresolved has changed |
| 2570 } | 2572 } |
| 2571 | 2573 |
| 2572 void Node::trace(Visitor* visitor) | 2574 void Node::trace(Visitor* visitor) |
| 2573 { | 2575 { |
| 2576 if (hasRareData()) | |
| 2577 visitor->trace(rareData()); | |
| 2578 | |
| 2574 visitor->trace(m_treeScope); | 2579 visitor->trace(m_treeScope); |
| 2575 } | 2580 } |
| 2576 | 2581 |
| 2577 } // namespace WebCore | 2582 } // namespace WebCore |
| 2578 | 2583 |
| 2579 #ifndef NDEBUG | 2584 #ifndef NDEBUG |
| 2580 | 2585 |
| 2581 void showNode(const WebCore::Node* node) | 2586 void showNode(const WebCore::Node* node) |
| 2582 { | 2587 { |
| 2583 if (node) | 2588 if (node) |
| 2584 node->showNode(""); | 2589 node->showNode(""); |
| 2585 } | 2590 } |
| 2586 | 2591 |
| 2587 void showTree(const WebCore::Node* node) | 2592 void showTree(const WebCore::Node* node) |
| 2588 { | 2593 { |
| 2589 if (node) | 2594 if (node) |
| 2590 node->showTreeForThis(); | 2595 node->showTreeForThis(); |
| 2591 } | 2596 } |
| 2592 | 2597 |
| 2593 void showNodePath(const WebCore::Node* node) | 2598 void showNodePath(const WebCore::Node* node) |
| 2594 { | 2599 { |
| 2595 if (node) | 2600 if (node) |
| 2596 node->showNodePathForThis(); | 2601 node->showNodePathForThis(); |
| 2597 } | 2602 } |
| 2598 | 2603 |
| 2599 #endif | 2604 #endif |
| OLD | NEW |