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

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

Issue 1369253002: Add Web Resources usage to chrome://tracing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Patch Set: Fix names. Created 5 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MemoryCache.h ('k') | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c3455042ac3118c2b25949979e9a00e826894035..bf243d35b6e91e4835be4e8e05c31410aec2f39c 100644
--- a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
+++ b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
@@ -24,6 +24,7 @@
#include "core/fetch/MemoryCache.h"
#include "core/fetch/ResourcePtr.h"
+#include "core/fetch/WebCacheMemoryDumpProvider.h"
#include "platform/Logging.h"
#include "platform/TraceEvent.h"
#include "platform/weborigin/SecurityOrigin.h"
@@ -65,6 +66,7 @@ MemoryCache* replaceMemoryCacheForTesting(MemoryCache* cache)
memoryCache();
MemoryCache* oldCache = gMemoryCache->release();
*gMemoryCache = cache;
+ WebCacheMemoryDumpProvider::instance()->setMemoryCache(cache);
return oldCache;
}
@@ -105,6 +107,7 @@ inline MemoryCache::MemoryCache()
, m_statsTimer(this, &MemoryCache::dumpStats)
#endif
{
+ WebCacheMemoryDumpProvider::instance()->setMemoryCache(this);
#ifdef MEMORY_CACHE_STATS
const double statsIntervalInSeconds = 15;
m_statsTimer.startRepeating(statsIntervalInSeconds, BLINK_FROM_HERE);
@@ -780,6 +783,16 @@ void MemoryCache::updateFramePaintTimestamp()
m_lastFramePaintTimeStamp = currentTime();
}
+void MemoryCache::onMemoryDump(WebProcessMemoryDump* memoryDump)
+{
+ for (const auto& resourceMapIter : m_resourceMaps) {
+ for (const auto& resourceIter : *resourceMapIter.value) {
+ Resource* resource = resourceIter.value->m_resource.get();
+ resource->onMemoryDump(memoryDump);
+ }
+ }
+}
+
void MemoryCache::registerLiveResource(Resource& resource)
{
#if ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MemoryCache.h ('k') | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698