Web Inspector: native memory instrumentation: extract instrumentation methods into...
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2012 11:48:11 +0000 (11:48 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jul 2012 11:48:11 +0000 (11:48 +0000)
commit988fd4e6cfa481591be57c84b6818f558f3c6f6e
tree497a6a73d1ffdb50d71aa84c06ab155680a0236d
parent0f7512807f179ef063796cf5c56c69c80f666a11
Web Inspector: native memory instrumentation: extract instrumentation methods into MemoryClassInfo
https://bugs.webkit.org/show_bug.cgi?id=91227

Reviewed by Pavel Feldman.

void Node::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
{
    MemoryClassInfo<Node> info(memoryObjectInfo, this, MemoryInstrumentation::DOM);
    info.visitBaseClass<ScriptWrappable>(this);

    info.addMember(m_notInstrumentedPointer); // automatically detects poniter/reference
    info.addInstrumentedMember(m_next);
    info.addHashSet<MemoryInstrumentation::NonClass>(m_aHash);                // NonClass value_type (report only size of internal template structures)
    info.addHashSet<MemoryInstrumentation::NotInstrumentedClass>(m_aHashSet); // not instrumented value_type (use sizeof)
    info.addHashSet<MemoryInstrumentation::InstrumentedClass>(m_aHashSet);    // instrumented value_type (call visit)
}

The change is covered by existing tests for native memory snapshot.

* bindings/v8/DOMDataStore.cpp:
(WebCore::DOMDataStore::reportMemoryUsage):
* bindings/v8/IntrusiveDOMWrapperMap.h:
(WebCore::ChunkedTable::reportMemoryUsage):
* bindings/v8/ScriptWrappable.h:
(WebCore::ScriptWrappable::reportMemoryUsage):
* bindings/v8/V8Binding.cpp:
(WebCore::V8BindingPerIsolateData::reportMemoryUsage):
(WebCore::StringCache::reportMemoryUsage):
* bindings/v8/V8DOMMap.h:
* css/StylePropertySet.h:
(WebCore::StylePropertySet::reportMemoryUsage):
* dom/CharacterData.cpp:
(WebCore::CharacterData::reportMemoryUsage):
* dom/ContainerNode.h:
(WebCore::ContainerNode::reportMemoryUsage):
* dom/Document.cpp:
(WebCore::Document::reportMemoryUsage):
* dom/Element.h:
(WebCore::Element::reportMemoryUsage):
* dom/ElementAttributeData.h:
(WebCore::ElementAttributeData::reportMemoryUsage):
* dom/MemoryInstrumentation.h:
(MemoryInstrumentation):
(WebCore::MemoryObjectInfo::objectType):
(WebCore::MemoryObjectInfo::objectSize):
(WebCore::MemoryObjectInfo::memoryInstrumentation):
(MemoryObjectInfo):
(WebCore::MemoryObjectInfo::reportObjectInfo):
(WebCore):
(MemoryClassInfo):
(WebCore::MemoryClassInfo::MemoryClassInfo):
(WebCore::MemoryClassInfo::visitBaseClass):
(WebCore::MemoryClassInfo::reportInstrumentedPointer):
(WebCore::MemoryClassInfo::reportInstrumentedObject):
(WebCore::MemoryClassInfo::reportPointer):
(WebCore::MemoryClassInfo::reportObject):
(WebCore::MemoryClassInfo::reportHashMap):
(WebCore::MemoryClassInfo::reportHashSet):
(WebCore::MemoryClassInfo::reportListHashSet):
(WebCore::MemoryClassInfo::reportVector):
(WebCore::MemoryClassInfo::reportString):
* dom/Node.cpp:
(WebCore::Node::reportMemoryUsage):
* dom/QualifiedName.h:
(WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
(WebCore::QualifiedName::reportMemoryUsage):
* platform/TreeShared.h:
(WebCore::TreeShared::reportMemoryUsage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ScriptWrappable.h
Source/WebCore/bindings/v8/DOMDataStore.cpp
Source/WebCore/bindings/v8/IntrusiveDOMWrapperMap.h
Source/WebCore/bindings/v8/ScriptWrappable.h
Source/WebCore/bindings/v8/V8Binding.cpp
Source/WebCore/bindings/v8/V8DOMMap.h
Source/WebCore/css/StylePropertySet.h
Source/WebCore/dom/CharacterData.cpp
Source/WebCore/dom/ContainerNode.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/ElementAttributeData.h
Source/WebCore/dom/MemoryInstrumentation.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/QualifiedName.h
Source/WebCore/platform/TreeShared.h