summaryrefslogtreecommitdiffstats
path: root/WebKit/mac/Misc/WebCoreStatistics.mm
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:32 -0800
commit635860845790a19bf50bbc51ba8fb66a96dde068 (patch)
treeef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebKit/mac/Misc/WebCoreStatistics.mm
parent8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff)
downloadexternal_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.zip
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.gz
external_webkit-635860845790a19bf50bbc51ba8fb66a96dde068.tar.bz2
auto import from //depot/cupcake/@136594
Diffstat (limited to 'WebKit/mac/Misc/WebCoreStatistics.mm')
-rw-r--r--WebKit/mac/Misc/WebCoreStatistics.mm30
1 files changed, 25 insertions, 5 deletions
diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm
index ecbfe9d..05c2659 100644
--- a/WebKit/mac/Misc/WebCoreStatistics.mm
+++ b/WebKit/mac/Misc/WebCoreStatistics.mm
@@ -54,7 +54,7 @@ using namespace WebCore;
+ (size_t)javaScriptObjectsCount
{
JSLock lock(false);
- return JSDOMWindow::commonJSGlobalData()->heap.size();
+ return JSDOMWindow::commonJSGlobalData()->heap.objectCount();
}
+ (size_t)javaScriptGlobalObjectsCount
@@ -122,17 +122,17 @@ using namespace WebCore;
+ (size_t)cachedFontDataCount
{
- return FontCache::fontDataCount();
+ return fontCache()->fontDataCount();
}
+ (size_t)cachedFontDataInactiveCount
{
- return FontCache::inactiveFontDataCount();
+ return fontCache()->inactiveFontDataCount();
}
+ (void)purgeInactiveFontData
{
- FontCache::purgeInactiveFontData();
+ fontCache()->purgeInactiveFontData();
}
+ (size_t)glyphPageCount
@@ -167,11 +167,31 @@ using namespace WebCore;
WebCore::Node::startIgnoringLeaks();
}
-+ (void)stopIgnoringWebCoreNodeLeaks;
++ (void)stopIgnoringWebCoreNodeLeaks
{
WebCore::Node::stopIgnoringLeaks();
}
++ (NSDictionary *)memoryStatistics
+{
+ WTF::FastMallocStatistics fastMallocStatistics = WTF::fastMallocStatistics();
+ JSLock lock(false);
+ Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics();
+ return [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithInt:fastMallocStatistics.heapSize], @"FastMallocHeapSize",
+ [NSNumber numberWithInt:fastMallocStatistics.freeSizeInHeap], @"FastMallocFreeSizeInHeap",
+ [NSNumber numberWithInt:fastMallocStatistics.freeSizeInCaches], @"FastMallocFreeSizeInCaches",
+ [NSNumber numberWithInt:fastMallocStatistics.returnedSize], @"FastMallocReturnedSize",
+ [NSNumber numberWithInt:jsHeapStatistics.size], @"JavaScriptHeapSize",
+ [NSNumber numberWithInt:jsHeapStatistics.free], @"JavaScriptFreeSize",
+ nil];
+}
+
++ (void)returnFreeMemoryToSystem
+{
+ WTF::releaseFastMallocFreeMemory();
+}
+
// Deprecated
+ (size_t)javaScriptNoGCAllowedObjectsCount
{