Changeset 127443 in webkit


Ignore:
Timestamp:
Sep 4, 2012 1:19:02 AM (12 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: NMI: cosmetic change, rename m_domMemoryUsage to m_memoryInstrumentation.
https://bugs.webkit.org/show_bug.cgi?id=95716

Also m_memoryInstrumentation became a reference to external object because it has other life time than domNodeVisitor.

Reviewed by Yury Semikhatsky.

  • inspector/InspectorMemoryAgent.cpp:

(WebCore):
(WebCore::collectDomTreeInfo):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r127440 r127443  
     12012-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
    1142012-08-31  Simon Hausmann  <simon.hausmann@nokia.com>
    215
  • trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp

    r126926 r127443  
    452452class DOMTreesIterator : public NodeWrapperVisitor {
    453453public:
    454     DOMTreesIterator(Page* page, VisitedObjects& visitedObjects)
     454    DOMTreesIterator(Page* page, MemoryInstrumentationImpl& memoryInstrumentation)
    455455        : m_page(page)
    456         , m_domMemoryUsage(visitedObjects)
     456        , m_memoryInstrumentation(memoryInstrumentation)
    457457    {
    458458    }
     
    463463            return;
    464464
    465         m_domMemoryUsage.addRootObject(node);
     465        m_memoryInstrumentation.addRootObject(node);
    466466    }
    467467
    468468    void visitFrame(Frame* frame)
    469469    {
    470         m_domMemoryUsage.addRootObject(frame);
     470        m_memoryInstrumentation.addRootObject(frame);
    471471    }
    472472
    473473    void visitBindings()
    474474    {
    475         ScriptProfiler::collectBindingMemoryInfo(&m_domMemoryUsage);
     475        ScriptProfiler::collectBindingMemoryInfo(&m_memoryInstrumentation);
    476476    }
    477477
    478478    void visitMemoryCache()
    479479    {
    480         m_domMemoryUsage.addRootObject(memoryCache());
     480        m_memoryInstrumentation.addRootObject(memoryCache());
    481481    }
    482482
     
    487487        COMPILE_ASSERT(MemoryInstrumentation::LastTypeEntry == MemoryInstrumentation::CachedResourceXSLT + 1, object_type_enum_was_changed_please_fix_the_implementation);
    488488        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));
    490490
    491491        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);
    501501
    502502        RefPtr<InspectorMemoryBlock> block = InspectorMemoryBlock::create().setName(MemoryBlockName::memoryCache);
     
    510510        size_t totalSize = 0;
    511511        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));
    513513
    514514        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);
    520520
    521521        RefPtr<InspectorMemoryBlock> dom = InspectorMemoryBlock::create().setName(MemoryBlockName::dom);
     
    529529        children->addItem(buildObjectForMemoryCache());
    530530        children->addItem(buildObjectForDOM());
    531         inspectorData->addComponent(MemoryBlockName::inspectorDOMData, m_domMemoryUsage.selfSize());
     531        inspectorData->addComponent(MemoryBlockName::inspectorDOMData, m_memoryInstrumentation.selfSize());
    532532    }
    533533
    534534private:
    535535    Page* m_page;
    536     MemoryInstrumentationImpl m_domMemoryUsage;
     536    MemoryInstrumentationImpl& m_memoryInstrumentation;
    537537};
    538538
     
    541541static void collectDomTreeInfo(Page* page, VisitedObjects& visitedObjects, TypeBuilder::Array<InspectorMemoryBlock>* children, InspectorDataCounter* inspectorData)
    542542{
    543     DOMTreesIterator domTreesIterator(page, visitedObjects);
     543    MemoryInstrumentationImpl memoryInstrumentation(visitedObjects);
     544    DOMTreesIterator domTreesIterator(page, memoryInstrumentation);
    544545
    545546    ScriptProfiler::visitNodeWrappers(&domTreesIterator);
Note: See TracChangeset for help on using the changeset viewer.