| Index: third_party/WebKit/Source/platform/fonts/FontDataCache.cpp
|
| diff --git a/third_party/WebKit/Source/platform/fonts/FontDataCache.cpp b/third_party/WebKit/Source/platform/fonts/FontDataCache.cpp
|
| index 27a18526f0e478cdbdd879ea296dc966a7e2cfec..9a6443da44407347b90b25f3d721d6430fb007ae 100644
|
| --- a/third_party/WebKit/Source/platform/fonts/FontDataCache.cpp
|
| +++ b/third_party/WebKit/Source/platform/fonts/FontDataCache.cpp
|
| @@ -30,6 +30,7 @@
|
|
|
| #include "platform/fonts/FontDataCache.h"
|
|
|
| +#include "base/trace_event/process_memory_dump.h"
|
| #include "platform/fonts/SimpleFontData.h"
|
|
|
| using namespace WTF;
|
| @@ -160,4 +161,19 @@ bool FontDataCache::purgeLeastRecentlyUsed(int count)
|
| return didWork;
|
| }
|
|
|
| +void FontDataCache::dumpCountAndGlyphToBoundsMaps(base::trace_event::ProcessMemoryDump* memoryDump)
|
| +{
|
| + base::trace_event::MemoryAllocatorDump* dump = memoryDump->CreateAllocatorDump("font_caches/font_data_cache");
|
| + dump->AddScalar("objects_in_cache", "count", m_cache.size());
|
| + dump->AddScalar("inactive_objects", "count", m_inactiveFontData.size());
|
| +
|
| + size_t glyphToBoundsMapTotalSize = 0;
|
| + for (auto entry : m_cache) {
|
| + glyphToBoundsMapTotalSize += entry.value.first->glyphToBoundsMapMemorySize();
|
| + }
|
| + dump->AddScalar("glyphtoboundsmaps_total_size", "bytes", glyphToBoundsMapTotalSize);
|
| +
|
| + memoryDump->AddSuballocation(dump->guid(), WTF::Partitions::kAllocatedObjectPoolName);
|
| +}
|
| +
|
| } // namespace blink
|
|
|