Web Inspector: collect native heap graph and report it to the front-end
https://bugs.webkit.org/show_bug.cgi?id=104888

Reviewed by Pavel Feldman.

Added an option to serialize native heap graph in a format similar to that
of JS heap profiler and send it in reply to getProcessMemoryDistribution
command. This is a first attempt and we likely change the report mechanism to
use a stream instread of sending whole graph at once.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* inspector/HeapGraphSerializer.cpp: Added.
(WebCore):
(HeapGraphNode):
(WebCore::HeapGraphNode::HeapGraphNode):
(HeapGraphEdge):
(WebCore::HeapGraphEdge::HeapGraphEdge):
(WebCore::HeapGraphSerializer::HeapGraphSerializer):
(WebCore::HeapGraphSerializer::~HeapGraphSerializer):
(WebCore::HeapGraphSerializer::serialize):
(WebCore::HeapGraphSerializer::reportNode):
(WebCore::HeapGraphSerializer::reportEdge):
(WebCore::HeapGraphSerializer::reportLeaf):
(WebCore::HeapGraphSerializer::reportBaseAddress):
(WebCore::HeapGraphSerializer::adjutEdgeTargets):
(WebCore::HeapGraphSerializer::addString):
* inspector/HeapGraphSerializer.h: Copied from Source/WebCore/inspector/InspectorMemoryAgent.h.
(WebCore):
(HeapGraphSerializer):
* inspector/Inspector.json:
* inspector/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
* inspector/InspectorMemoryAgent.h:
(InspectorMemoryAgent):
* inspector/MemoryInstrumentationImpl.cpp:
(WebCore::MemoryInstrumentationClientImpl::reportNode):
(WebCore):
(WebCore::MemoryInstrumentationClientImpl::reportEdge):
(WebCore::MemoryInstrumentationClientImpl::reportLeaf):
(WebCore::MemoryInstrumentationClientImpl::reportBaseAddress):
* inspector/MemoryInstrumentationImpl.h:
(WebCore):
(WebCore::MemoryInstrumentationClientImpl::MemoryInstrumentationClientImpl):
(MemoryInstrumentationClientImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed