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 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2363 inline void TreeScope::removedLastRefToScope() | 2363 inline void TreeScope::removedLastRefToScope() |
2364 { | 2364 { |
2365 ASSERT_WITH_SECURITY_IMPLICATION(!deletionHasBegun()); | 2365 ASSERT_WITH_SECURITY_IMPLICATION(!deletionHasBegun()); |
2366 if (m_guardRefCount) { | 2366 if (m_guardRefCount) { |
2367 // If removing a child removes the last self-only ref, we don't | 2367 // If removing a child removes the last self-only ref, we don't |
2368 // want the scope to be destructed until after | 2368 // want the scope to be destructed until after |
2369 // removeDetachedChildren returns, so we guard ourselves with an | 2369 // removeDetachedChildren returns, so we guard ourselves with an |
2370 // extra self-only ref. | 2370 // extra self-only ref. |
2371 guardRef(); | 2371 guardRef(); |
2372 dispose(); | 2372 dispose(); |
2373 #if ASSERT_ENABLED | 2373 #if ENABLE(ASSERT) |
2374 // We need to do this right now since guardDeref() can delete this. | 2374 // We need to do this right now since guardDeref() can delete this. |
2375 rootNode().m_inRemovedLastRefFunction = false; | 2375 rootNode().m_inRemovedLastRefFunction = false; |
2376 #endif | 2376 #endif |
2377 guardDeref(); | 2377 guardDeref(); |
2378 } else { | 2378 } else { |
2379 #if ASSERT_ENABLED | 2379 #if ENABLE(ASSERT) |
2380 rootNode().m_inRemovedLastRefFunction = false; | 2380 rootNode().m_inRemovedLastRefFunction = false; |
2381 #endif | 2381 #endif |
2382 #if SECURITY_ASSERT_ENABLED | 2382 #if ENABLE(SECURITY_ASSERT) |
2383 beginDeletion(); | 2383 beginDeletion(); |
2384 #endif | 2384 #endif |
2385 delete this; | 2385 delete this; |
2386 } | 2386 } |
2387 } | 2387 } |
2388 | 2388 |
2389 // It's important not to inline removedLastRef, because we don't want to inline
the code to | 2389 // It's important not to inline removedLastRef, because we don't want to inline
the code to |
2390 // delete a Node at each deref call site. | 2390 // delete a Node at each deref call site. |
2391 void Node::removedLastRef() | 2391 void Node::removedLastRef() |
2392 { | 2392 { |
2393 // An explicit check for Document here is better than a virtual function sin
ce it is | 2393 // An explicit check for Document here is better than a virtual function sin
ce it is |
2394 // faster for non-Document nodes, and because the call to removedLastRef tha
t is inlined | 2394 // faster for non-Document nodes, and because the call to removedLastRef tha
t is inlined |
2395 // at all deref call sites is smaller if it's a non-virtual function. | 2395 // at all deref call sites is smaller if it's a non-virtual function. |
2396 if (isTreeScope()) { | 2396 if (isTreeScope()) { |
2397 treeScope().removedLastRefToScope(); | 2397 treeScope().removedLastRefToScope(); |
2398 return; | 2398 return; |
2399 } | 2399 } |
2400 | 2400 |
2401 #if SECURITY_ASSERT_ENABLED | 2401 #if ENABLE(SECURITY_ASSERT) |
2402 m_deletionHasBegun = true; | 2402 m_deletionHasBegun = true; |
2403 #endif | 2403 #endif |
2404 delete this; | 2404 delete this; |
2405 } | 2405 } |
2406 #endif | 2406 #endif |
2407 | 2407 |
2408 unsigned Node::connectedSubframeCount() const | 2408 unsigned Node::connectedSubframeCount() const |
2409 { | 2409 { |
2410 return hasRareData() ? rareData()->connectedSubframeCount() : 0; | 2410 return hasRareData() ? rareData()->connectedSubframeCount() : 0; |
2411 } | 2411 } |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2574 node->showTreeForThis(); | 2574 node->showTreeForThis(); |
2575 } | 2575 } |
2576 | 2576 |
2577 void showNodePath(const WebCore::Node* node) | 2577 void showNodePath(const WebCore::Node* node) |
2578 { | 2578 { |
2579 if (node) | 2579 if (node) |
2580 node->showNodePathForThis(); | 2580 node->showNodePathForThis(); |
2581 } | 2581 } |
2582 | 2582 |
2583 #endif | 2583 #endif |
OLD | NEW |