Web Inspector: convert manual size calculation of different WebKit things into Memory...
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Oct 2012 13:51:55 +0000 (13:51 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Oct 2012 13:51:55 +0000 (13:51 +0000)
commit636f2ece74fecd40140cc3ce39e5aefad19e63e8
tree3cee1a7e2f338628246783b97a268fd711cb8228
parent1c99ae5b7cb55efb7c2f4b6f59aab38664a0e51d
Web Inspector: convert manual size calculation of different WebKit things into MemoryInstrumentation.
https://bugs.webkit.org/show_bug.cgi?id=99309

Reviewed by Yury Semikhatsky.

JSHeap, DOMStorage and HeapProfiler data were counted manually.
Now we count the sizes more generic way.

Source/WebCore:

* dom/WebCoreMemoryInstrumentation.cpp:
* dom/WebCoreMemoryInstrumentation.h:
(WebCoreMemoryTypes): new string identifiers were added for Inspector's data.
* inspector/InspectorBaseAgent.cpp:
(WebCore::InspectorBaseAgentInterface::InspectorBaseAgentInterface): common data members were moved from template to base class.
(WebCore::InspectorBaseAgentInterface::reportMemoryUsage): NMI instrumentation was added to the base template.
* inspector/InspectorBaseAgent.h:
(InspectorBaseAgentInterface): ditto
(WebCore::InspectorBaseAgent::InspectorBaseAgent): ditto
* inspector/InspectorController.cpp:
(WebCore::InspectorController::reportMemoryUsage): NMI instrumentation was added to the class.
* inspector/InspectorController.h:
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::reportMemoryUsage): NMI instrumentation was added to the class.
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorDOMStorageResource.cpp:
(WebCore::InspectorDOMStorageResource::reportMemoryUsage): NMI instrumentation was added to the class.
* inspector/InspectorDOMStorageResource.h:
* inspector/InspectorMemoryAgent.cpp:
(WebCore::reportJSHeapInfo): these methods now use MemoryInstrumentation for reporting the size of underlying data.
(WebCore::reportRenderTreeInfo):
(WebCore::collectDomTreeInfo):
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
(WebCore::InspectorMemoryAgent::reportMemoryUsage): NMI instrumentation was added to the class.
* inspector/InspectorMemoryAgent.h:
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::reportMemoryUsage):
* inspector/InspectorProfilerAgent.h:
(InspectorProfilerAgent): NMI instrumentation was added to the class.
* inspector/MemoryInstrumentationImpl.cpp: allocatedObjects map was converted from InspectorMemoryAgent::getProcessMemoryDistribution local variable to member variable.
(WebCore::MemoryInstrumentationClientImpl::checkCountedObject):
(WebCore::MemoryInstrumentationClientImpl::reportMemoryUsage): NMI instrumentation was added to the class.
(WebCore::MemoryInstrumentationImpl::reportMemoryUsage): NMI instrumentation was added to the class.
* inspector/MemoryInstrumentationImpl.h:
(WebCore::MemoryInstrumentationClientImpl::MemoryInstrumentationClientImpl):
(WebCore::MemoryInstrumentationClientImpl::allocatedObjects):
(WebCore::MemoryInstrumentationClientImpl::checkInstrumentedObjects):
* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.MemoryBlockViewProperties._initialize):
(WebInspector.NativeMemoryBarChart.prototype._updateView):
* page/Page.cpp:
(WebCore::Page::reportMemoryUsage): NMI instrumentation was added to the class.
* page/Page.h:

Source/WTF:

* wtf/MemoryInstrumentation.h: calculateContainerSize were removed.
* wtf/MemoryInstrumentationSequence.h: empty instrumentations were added for 'const char*' and 'const void*' sequences.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/MemoryInstrumentation.h
Source/WTF/wtf/MemoryInstrumentationSequence.h
Source/WebCore/ChangeLog
Source/WebCore/dom/WebCoreMemoryInstrumentation.cpp
Source/WebCore/dom/WebCoreMemoryInstrumentation.h
Source/WebCore/inspector/InspectorBaseAgent.cpp
Source/WebCore/inspector/InspectorBaseAgent.h
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
Source/WebCore/inspector/InspectorDOMStorageAgent.h
Source/WebCore/inspector/InspectorDOMStorageResource.cpp
Source/WebCore/inspector/InspectorDOMStorageResource.h
Source/WebCore/inspector/InspectorMemoryAgent.cpp
Source/WebCore/inspector/InspectorMemoryAgent.h
Source/WebCore/inspector/InspectorProfilerAgent.cpp
Source/WebCore/inspector/InspectorProfilerAgent.h
Source/WebCore/inspector/MemoryInstrumentationImpl.cpp
Source/WebCore/inspector/MemoryInstrumentationImpl.h
Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h