Web Inspector: provide memory instrumentation for HashMap
authoryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Oct 2012 14:46:25 +0000 (14:46 +0000)
committeryurys@chromium.org <yurys@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Oct 2012 14:46:25 +0000 (14:46 +0000)
commit2c02edf6202fb6cf60457b08847c9590cb0f0ebe
treed95e8214005d9de552c331fdcdd035143c4d0bef
parent2852cade47c6155bd122913caf60b6131d6a5e8f
Web Inspector: provide memory instrumentation for HashMap
https://bugs.webkit.org/show_bug.cgi?id=98005

Reviewed by Pavel Feldman.

Source/WebCore:

Updated all call sites of MemoryInstrumentation::addHashMap to use generic
method of reporting memory footprint instead.

* bindings/v8/ScopedDOMDataStore.cpp:
* bindings/v8/V8Binding.cpp:
(WebCore::StringCache::reportMemoryUsage):
* bindings/v8/V8DOMMap.h:
* bindings/v8/V8PerIsolateData.cpp:
(WebCore::V8PerIsolateData::reportMemoryUsage):
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::reportBaseClassMemoryUsage):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::reportMemoryUsage):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::reportMemoryUsage):
* dom/Document.cpp:
(WebCore::Document::reportMemoryUsage):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::reportMemoryUsage):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::reportMemoryUsage):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::reportMemoryUsage):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::reportMemoryUsage):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::reportMemoryUsage):
* rendering/style/StyleRareNonInheritedData.cpp:

Source/WebKit/chromium:

Added unit tests for HashMap memory instrumentation.

* tests/MemoryInstrumentationTest.cpp:
(WTF):

Source/WTF:

Extracted HashMap memory instrumentation into its own file. The map's content
elements will be automatically traversed if their types are supported
by the memory instrumentation. No need to call special method for hash map
fields any more.

* GNUmakefile.list.am:
* WTF.gypi:
* WTF.pro:
* WTF.vcproj/WTF.vcproj:
* wtf/MemoryInstrumentation.h:
(MemoryInstrumentation):
(WTF):
* wtf/MemoryInstrumentationHashMap.h: Added.
(WTF):
(WTF::SequenceMemoryInstrumentationTraits::reportMemoryUsage):
(WTF::reportMemoryUsage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130048 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
Source/WTF/ChangeLog
Source/WTF/GNUmakefile.list.am
Source/WTF/WTF.gypi
Source/WTF/WTF.pro
Source/WTF/WTF.vcproj/WTF.vcproj
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/MemoryInstrumentation.h
Source/WTF/wtf/MemoryInstrumentationHashMap.h [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/ScopedDOMDataStore.cpp
Source/WebCore/bindings/v8/V8Binding.cpp
Source/WebCore/bindings/v8/V8DOMMap.h
Source/WebCore/bindings/v8/V8PerIsolateData.cpp
Source/WebCore/css/CSSImageGeneratorValue.cpp
Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleSheetContents.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/platform/network/ResourceRequestBase.cpp
Source/WebCore/platform/network/ResourceResponseBase.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp