diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:32 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-05 14:34:32 -0800 |
commit | 635860845790a19bf50bbc51ba8fb66a96dde068 (patch) | |
tree | ef6ad9ff73a5b57f65249d4232a202fa77e6a140 /WebKit/mac/Misc/WebCoreStatistics.mm | |
parent | 8e35f3cfc7fba1d1c829dc557ebad6409cbe16a2 (diff) | |
download | external_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.mm | 30 |
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 { |