Changeset 127443 in webkit
- Timestamp:
- Sep 4, 2012 1:19:02 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r127440 r127443 1 2012-09-04 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Web Inspector: NMI: cosmetic change, rename m_domMemoryUsage to m_memoryInstrumentation. 4 https://bugs.webkit.org/show_bug.cgi?id=95716 5 6 Also m_memoryInstrumentation became a reference to external object because it has other life time than domNodeVisitor. 7 8 Reviewed by Yury Semikhatsky. 9 10 * inspector/InspectorMemoryAgent.cpp: 11 (WebCore): 12 (WebCore::collectDomTreeInfo): 13 1 14 2012-08-31 Simon Hausmann <simon.hausmann@nokia.com> 2 15 -
trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp
r126926 r127443 452 452 class DOMTreesIterator : public NodeWrapperVisitor { 453 453 public: 454 DOMTreesIterator(Page* page, VisitedObjects& visitedObjects)454 DOMTreesIterator(Page* page, MemoryInstrumentationImpl& memoryInstrumentation) 455 455 : m_page(page) 456 , m_ domMemoryUsage(visitedObjects)456 , m_memoryInstrumentation(memoryInstrumentation) 457 457 { 458 458 } … … 463 463 return; 464 464 465 m_ domMemoryUsage.addRootObject(node);465 m_memoryInstrumentation.addRootObject(node); 466 466 } 467 467 468 468 void visitFrame(Frame* frame) 469 469 { 470 m_ domMemoryUsage.addRootObject(frame);470 m_memoryInstrumentation.addRootObject(frame); 471 471 } 472 472 473 473 void visitBindings() 474 474 { 475 ScriptProfiler::collectBindingMemoryInfo(&m_ domMemoryUsage);475 ScriptProfiler::collectBindingMemoryInfo(&m_memoryInstrumentation); 476 476 } 477 477 478 478 void visitMemoryCache() 479 479 { 480 m_ domMemoryUsage.addRootObject(memoryCache());480 m_memoryInstrumentation.addRootObject(memoryCache()); 481 481 } 482 482 … … 487 487 COMPILE_ASSERT(MemoryInstrumentation::LastTypeEntry == MemoryInstrumentation::CachedResourceXSLT + 1, object_type_enum_was_changed_please_fix_the_implementation); 488 488 for (int i = MemoryInstrumentation::MemoryCacheStructures; i < MemoryInstrumentation::LastTypeEntry; ++i) 489 totalSize += m_ domMemoryUsage.totalSize(static_cast<MemoryInstrumentation::ObjectType>(i));489 totalSize += m_memoryInstrumentation.totalSize(static_cast<MemoryInstrumentation::ObjectType>(i)); 490 490 491 491 RefPtr<TypeBuilder::Array<InspectorMemoryBlock> > children = TypeBuilder::Array<InspectorMemoryBlock>::create(); 492 addMemoryBlockFor(children.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::MemoryCacheStructures), MemoryBlockName::memoryCacheStructures);493 addMemoryBlockFor(children.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::CachedResource), MemoryBlockName::cachedResource);494 addMemoryBlockFor(children.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceCSS), MemoryBlockName::cachedResourceCSS);495 addMemoryBlockFor(children.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceFont), MemoryBlockName::cachedResourceFont);496 addMemoryBlockFor(children.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceImage), MemoryBlockName::cachedResourceImage);497 addMemoryBlockFor(children.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceScript), MemoryBlockName::cachedResourceScript);498 addMemoryBlockFor(children.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceSVG), MemoryBlockName::cachedResourceSVG);499 addMemoryBlockFor(children.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceShader), MemoryBlockName::cachedResourceShader);500 addMemoryBlockFor(children.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::CachedResourceXSLT), MemoryBlockName::cachedResourceXSLT);492 addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::MemoryCacheStructures), MemoryBlockName::memoryCacheStructures); 493 addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResource), MemoryBlockName::cachedResource); 494 addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceCSS), MemoryBlockName::cachedResourceCSS); 495 addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceFont), MemoryBlockName::cachedResourceFont); 496 addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceImage), MemoryBlockName::cachedResourceImage); 497 addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceScript), MemoryBlockName::cachedResourceScript); 498 addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceSVG), MemoryBlockName::cachedResourceSVG); 499 addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceShader), MemoryBlockName::cachedResourceShader); 500 addMemoryBlockFor(children.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CachedResourceXSLT), MemoryBlockName::cachedResourceXSLT); 501 501 502 502 RefPtr<InspectorMemoryBlock> block = InspectorMemoryBlock::create().setName(MemoryBlockName::memoryCache); … … 510 510 size_t totalSize = 0; 511 511 for (int i = MemoryInstrumentation::Other; i < MemoryInstrumentation::MemoryCacheStructures; ++i) 512 totalSize += m_ domMemoryUsage.totalSize(static_cast<MemoryInstrumentation::ObjectType>(i));512 totalSize += m_memoryInstrumentation.totalSize(static_cast<MemoryInstrumentation::ObjectType>(i)); 513 513 514 514 RefPtr<TypeBuilder::Array<InspectorMemoryBlock> > domChildren = TypeBuilder::Array<InspectorMemoryBlock>::create(); 515 addMemoryBlockFor(domChildren.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::Other), MemoryBlockName::domTreeOther);516 addMemoryBlockFor(domChildren.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::DOM), MemoryBlockName::domTreeDOM);517 addMemoryBlockFor(domChildren.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::CSS), MemoryBlockName::domTreeCSS);518 addMemoryBlockFor(domChildren.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::Binding), MemoryBlockName::domTreeBinding);519 addMemoryBlockFor(domChildren.get(), m_ domMemoryUsage.totalSize(MemoryInstrumentation::Loader), MemoryBlockName::domTreeLoader);515 addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::Other), MemoryBlockName::domTreeOther); 516 addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::DOM), MemoryBlockName::domTreeDOM); 517 addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::CSS), MemoryBlockName::domTreeCSS); 518 addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::Binding), MemoryBlockName::domTreeBinding); 519 addMemoryBlockFor(domChildren.get(), m_memoryInstrumentation.totalSize(MemoryInstrumentation::Loader), MemoryBlockName::domTreeLoader); 520 520 521 521 RefPtr<InspectorMemoryBlock> dom = InspectorMemoryBlock::create().setName(MemoryBlockName::dom); … … 529 529 children->addItem(buildObjectForMemoryCache()); 530 530 children->addItem(buildObjectForDOM()); 531 inspectorData->addComponent(MemoryBlockName::inspectorDOMData, m_ domMemoryUsage.selfSize());531 inspectorData->addComponent(MemoryBlockName::inspectorDOMData, m_memoryInstrumentation.selfSize()); 532 532 } 533 533 534 534 private: 535 535 Page* m_page; 536 MemoryInstrumentationImpl m_domMemoryUsage;536 MemoryInstrumentationImpl& m_memoryInstrumentation; 537 537 }; 538 538 … … 541 541 static void collectDomTreeInfo(Page* page, VisitedObjects& visitedObjects, TypeBuilder::Array<InspectorMemoryBlock>* children, InspectorDataCounter* inspectorData) 542 542 { 543 DOMTreesIterator domTreesIterator(page, visitedObjects); 543 MemoryInstrumentationImpl memoryInstrumentation(visitedObjects); 544 DOMTreesIterator domTreesIterator(page, memoryInstrumentation); 544 545 545 546 ScriptProfiler::visitNodeWrappers(&domTreesIterator);
Note: See TracChangeset
for help on using the changeset viewer.