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

Unified Diff: third_party/WebKit/Source/core/fetch/MemoryCache.cpp

Issue 2337733002: [tracing] Support BACKGROUND mode in MemoryCache dump provider (Closed)
Patch Set: remove trace_event change. Created 4 years, 3 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/core/fetch/MemoryCache.cpp
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
index a0de01441465ee86da4cb6e7bafad6c0ef50e6d1..d5eac4425212011f8d10d358552acce0ecb4ecea 100644
--- a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
+++ b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
@@ -592,6 +592,7 @@ void MemoryCache::TypeStatistic::addResource(Resource* o)
liveSize += o->isAlive() ? o->size() : 0;
decodedSize += o->decodedSize();
encodedSize += o->encodedSize();
+ overheadSize += o->overheadSize();
encodedSizeDuplicatedInDataURLs += o->url().protocolIsData() ? o->encodedSize() : 0;
}
@@ -729,6 +730,23 @@ void MemoryCache::updateFramePaintTimestamp()
bool MemoryCache::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail, WebProcessMemoryDump* memoryDump)
{
+ if (levelOfDetail == WebMemoryDumpLevelOfDetail::Background) {
+ Statistics stats = getStatistics();
+ WebMemoryAllocatorDump* dump1 = memoryDump->createMemoryAllocatorDump("web_cache/Image_resources");
+ dump1->addScalar("size", "bytes", stats.images.encodedSize + stats.images.overheadSize);
+ WebMemoryAllocatorDump* dump2 = memoryDump->createMemoryAllocatorDump("web_cache/CSS stylesheet_resources");
+ dump2->addScalar("size", "bytes", stats.cssStyleSheets.encodedSize + stats.cssStyleSheets.overheadSize);
+ WebMemoryAllocatorDump* dump3 = memoryDump->createMemoryAllocatorDump("web_cache/Script_resources");
+ dump3->addScalar("size", "bytes", stats.scripts.encodedSize + stats.scripts.overheadSize);
+ WebMemoryAllocatorDump* dump4 = memoryDump->createMemoryAllocatorDump("web_cache/XSL stylesheet_resources");
+ dump4->addScalar("size", "bytes", stats.xslStyleSheets.encodedSize + stats.xslStyleSheets.overheadSize);
+ WebMemoryAllocatorDump* dump5 = memoryDump->createMemoryAllocatorDump("web_cache/Font_resources");
+ dump5->addScalar("size", "bytes", stats.fonts.encodedSize + stats.fonts.overheadSize);
+ WebMemoryAllocatorDump* dump6 = memoryDump->createMemoryAllocatorDump("web_cache/Other_resources");
+ dump6->addScalar("size", "bytes", stats.other.encodedSize + stats.other.overheadSize);
+ return true;
+ }
+
for (const auto& resourceMapIter : m_resourceMaps) {
for (const auto& resourceIter : *resourceMapIter.value) {
Resource* resource = resourceIter.value->resource();
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MemoryCache.h ('k') | third_party/WebKit/Source/platform/MemoryCacheDumpProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698