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

Unified Diff: third_party/WebKit/Source/platform/PurgeableVector.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: Nits/. Created 5 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/platform/PurgeableVector.cpp
diff --git a/third_party/WebKit/Source/platform/PurgeableVector.cpp b/third_party/WebKit/Source/platform/PurgeableVector.cpp
index 01cb41f2d68ba3eb8369ba8546c29d8ccc748521..b59feb2aabbab0ab93846d86b31ceaf5f0a74b43 100644
--- a/third_party/WebKit/Source/platform/PurgeableVector.cpp
+++ b/third_party/WebKit/Source/platform/PurgeableVector.cpp
@@ -33,6 +33,7 @@
#include "public/platform/Platform.h"
#include "public/platform/WebDiscardableMemory.h"
+#include "public/platform/WebProcessMemoryDump.h"
#include "wtf/Assertions.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
@@ -79,6 +80,17 @@ void PurgeableVector::reserveCapacity(size_t capacity)
moveDataFromDiscardableToVector();
}
+void PurgeableVector::onMemoryDump(const String& dumpName, WebProcessMemoryDump* memoryDump) const
+{
+ WebMemoryAllocatorDump* dump = memoryDump->createDiscardableMemoryAllocatorDump(dumpName, m_discardable.get());
+ if (m_discardable) {
+ dump->AddScalar("discardable_size", "bytes", m_discardableSize);
haraken 2015/09/28 14:54:02 This is confusing. Even if m_discardable is non-nu
ssid 2015/09/28 16:24:38 I am sorry I screwed up the condition here. Now fi
+ } else if (m_vector.size() > 0) {
+ dump->AddScalar("size", "bytes", m_vector.size());
+ memoryDump->AddSuballocation(dump->guid(), String(WTF::Partitions::allocatorPoolNameForTracing()));
haraken 2015/09/28 14:54:02 What does allocatorPoolNameForTracing return? (I c
ssid 2015/09/28 16:24:38 Sorry, this is added in this CL https://codereview
+ }
+}
+
void PurgeableVector::moveDataFromDiscardableToVector()
{
if (m_discardable) {

Powered by Google App Engine
This is Rietveld 408576698