Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Unified Diff: third_party/WebKit/Source/platform/fonts/FontDataCache.cpp

Issue 2123193002: Add GlyphMetricsMap memory consumption to memory-infra tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontDataCache.h ('k') | third_party/WebKit/Source/platform/fonts/GlyphMetricsMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698