| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 printf("Attributes:\n"); | 252 printf("Attributes:\n"); |
| 253 printf(" Number of Attributes (non-Node and Node): %zu [%zu]\n", attributes
, sizeof(Attribute)); | 253 printf(" Number of Attributes (non-Node and Node): %zu [%zu]\n", attributes
, sizeof(Attribute)); |
| 254 printf(" Number of Attributes with an Attr: %zu\n", attributesWithAttr); | 254 printf(" Number of Attributes with an Attr: %zu\n", attributesWithAttr); |
| 255 printf(" Number of Elements with attribute storage: %zu [%zu]\n", elementsW
ithAttributeStorage, sizeof(ElementData)); | 255 printf(" Number of Elements with attribute storage: %zu [%zu]\n", elementsW
ithAttributeStorage, sizeof(ElementData)); |
| 256 printf(" Number of Elements with RareData: %zu\n", elementsWithRareData); | 256 printf(" Number of Elements with RareData: %zu\n", elementsWithRareData); |
| 257 printf(" Number of Elements with NamedNodeMap: %zu [%zu]\n", elementsWithNa
medNodeMap, sizeof(NamedNodeMap)); | 257 printf(" Number of Elements with NamedNodeMap: %zu [%zu]\n", elementsWithNa
medNodeMap, sizeof(NamedNodeMap)); |
| 258 #endif | 258 #endif |
| 259 } | 259 } |
| 260 | 260 |
| 261 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, nodeCounter, ("WebCoreNode"
)); | 261 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, nodeCounter, ("WebCoreNode"
)); |
| 262 DEFINE_DEBUG_ONLY_GLOBAL(HashSet<Node*>, ignoreSet, ); | |
| 263 | |
| 264 #ifndef NDEBUG | |
| 265 static bool shouldIgnoreLeaks = false; | |
| 266 #endif | |
| 267 | |
| 268 void Node::startIgnoringLeaks() | |
| 269 { | |
| 270 #ifndef NDEBUG | |
| 271 shouldIgnoreLeaks = true; | |
| 272 #endif | |
| 273 } | |
| 274 | |
| 275 void Node::stopIgnoringLeaks() | |
| 276 { | |
| 277 #ifndef NDEBUG | |
| 278 shouldIgnoreLeaks = false; | |
| 279 #endif | |
| 280 } | |
| 281 | 262 |
| 282 Node::StyleChange Node::diff(const RenderStyle* s1, const RenderStyle* s2, Docum
ent* doc) | 263 Node::StyleChange Node::diff(const RenderStyle* s1, const RenderStyle* s2, Docum
ent* doc) |
| 283 { | 264 { |
| 284 StyleChange ch = NoInherit; | 265 StyleChange ch = NoInherit; |
| 285 EDisplay display1 = s1 ? s1->display() : NONE; | 266 EDisplay display1 = s1 ? s1->display() : NONE; |
| 286 bool fl1 = s1 && s1->hasPseudoStyle(FIRST_LETTER); | 267 bool fl1 = s1 && s1->hasPseudoStyle(FIRST_LETTER); |
| 287 EDisplay display2 = s2 ? s2->display() : NONE; | 268 EDisplay display2 = s2 ? s2->display() : NONE; |
| 288 bool fl2 = s2 && s2->hasPseudoStyle(FIRST_LETTER); | 269 bool fl2 = s2 && s2->hasPseudoStyle(FIRST_LETTER); |
| 289 | 270 |
| 290 // We just detach if a renderer acquires or loses a column-span, since spann
ing elements | 271 // We just detach if a renderer acquires or loses a column-span, since spann
ing elements |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 // When the region thread has changed, we need to prepare a separate render
region object. | 318 // When the region thread has changed, we need to prepare a separate render
region object. |
| 338 if ((s1 && s2) && (s1->regionThread() != s2->regionThread())) | 319 if ((s1 && s2) && (s1->regionThread() != s2->regionThread())) |
| 339 ch = Detach; | 320 ch = Detach; |
| 340 | 321 |
| 341 return ch; | 322 return ch; |
| 342 } | 323 } |
| 343 | 324 |
| 344 void Node::trackForDebugging() | 325 void Node::trackForDebugging() |
| 345 { | 326 { |
| 346 #ifndef NDEBUG | 327 #ifndef NDEBUG |
| 347 if (shouldIgnoreLeaks) | 328 nodeCounter.increment(); |
| 348 ignoreSet.add(this); | |
| 349 else | |
| 350 nodeCounter.increment(); | |
| 351 #endif | 329 #endif |
| 352 | 330 |
| 353 #if DUMP_NODE_STATISTICS | 331 #if DUMP_NODE_STATISTICS |
| 354 liveNodeSet.add(this); | 332 liveNodeSet.add(this); |
| 355 #endif | 333 #endif |
| 356 } | 334 } |
| 357 | 335 |
| 358 Node::~Node() | 336 Node::~Node() |
| 359 { | 337 { |
| 360 #ifndef NDEBUG | 338 #ifndef NDEBUG |
| 361 HashSet<Node*>::iterator it = ignoreSet.find(this); | 339 nodeCounter.decrement(); |
| 362 if (it != ignoreSet.end()) | |
| 363 ignoreSet.remove(it); | |
| 364 else | |
| 365 nodeCounter.decrement(); | |
| 366 #endif | 340 #endif |
| 367 | 341 |
| 368 #if DUMP_NODE_STATISTICS | 342 #if DUMP_NODE_STATISTICS |
| 369 liveNodeSet.remove(this); | 343 liveNodeSet.remove(this); |
| 370 #endif | 344 #endif |
| 371 | 345 |
| 372 if (hasRareData()) | 346 if (hasRareData()) |
| 373 clearRareData(); | 347 clearRareData(); |
| 374 | 348 |
| 375 if (renderer()) | 349 if (renderer()) |
| (...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2748 node->showTreeForThis(); | 2722 node->showTreeForThis(); |
| 2749 } | 2723 } |
| 2750 | 2724 |
| 2751 void showNodePath(const WebCore::Node* node) | 2725 void showNodePath(const WebCore::Node* node) |
| 2752 { | 2726 { |
| 2753 if (node) | 2727 if (node) |
| 2754 node->showNodePathForThis(); | 2728 node->showNodePathForThis(); |
| 2755 } | 2729 } |
| 2756 | 2730 |
| 2757 #endif | 2731 #endif |
| OLD | NEW |