OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 if (node == rootNode()) | 375 if (node == rootNode()) |
376 return targetStack.last(); | 376 return targetStack.last(); |
377 if (node->isShadowRoot()) { | 377 if (node->isShadowRoot()) { |
378 ASSERT(!targetStack.isEmpty()); | 378 ASSERT(!targetStack.isEmpty()); |
379 targetStack.removeLast(); | 379 targetStack.removeLast(); |
380 } | 380 } |
381 } | 381 } |
382 return 0; | 382 return 0; |
383 } | 383 } |
384 | 384 |
385 void TreeScope::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
386 { | |
387 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | |
388 info.addMember(m_rootNode, "rootNode"); | |
389 info.addMember(m_parentTreeScope, "parentTreeScope"); | |
390 info.addMember(m_elementsById, "elementsById"); | |
391 info.addMember(m_imageMapsByName, "imageMapsByName"); | |
392 info.addMember(m_labelsByForAttribute, "labelsByForAttribute"); | |
393 info.addMember(m_idTargetObserverRegistry, "idTargetObserverRegistry"); | |
394 info.addMember(m_selection, "selection"); | |
395 info.addMember(m_documentScope, "documentScope"); | |
396 | |
397 } | |
398 | |
399 static void listTreeScopes(Node* node, Vector<TreeScope*, 5>& treeScopes) | 385 static void listTreeScopes(Node* node, Vector<TreeScope*, 5>& treeScopes) |
400 { | 386 { |
401 while (true) { | 387 while (true) { |
402 treeScopes.append(node->treeScope()); | 388 treeScopes.append(node->treeScope()); |
403 Element* ancestor = node->shadowHost(); | 389 Element* ancestor = node->shadowHost(); |
404 if (!ancestor) | 390 if (!ancestor) |
405 break; | 391 break; |
406 node = ancestor; | 392 node = ancestor; |
407 } | 393 } |
408 } | 394 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 #endif | 429 #endif |
444 | 430 |
445 int TreeScope::refCount() const | 431 int TreeScope::refCount() const |
446 { | 432 { |
447 if (Node* root = rootNode()) | 433 if (Node* root = rootNode()) |
448 return root->refCount(); | 434 return root->refCount(); |
449 return 0; | 435 return 0; |
450 } | 436 } |
451 | 437 |
452 } // namespace WebCore | 438 } // namespace WebCore |
OLD | NEW |