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

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: 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
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..7c42cd5a6f5a58c09dd66e11bd11d17b2ac2cb2a 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,19 @@ void PurgeableVector::reserveCapacity(size_t capacity)
moveDataFromDiscardableToVector();
}
+void PurgeableVector::onMemoryDump(const String& dumpName, WebProcessMemoryDump* memoryDump) const
+{
+ ASSERT(!(m_discardable && m_vector.size()));
+ if (m_discardable) {
+ WebMemoryAllocatorDump* dump = m_discardable->createMemoryAllocatorDump(dumpName, memoryDump);
+ dump->AddScalar("discardable_size", "bytes", m_discardableSize);
+ } else if (m_vector.size()) {
+ WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(dumpName);
+ dump->AddScalar("size", "bytes", m_vector.size());
+ memoryDump->AddSuballocation(dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName));
+ }
+}
+
void PurgeableVector::moveDataFromDiscardableToVector()
{
if (m_discardable) {
« no previous file with comments | « third_party/WebKit/Source/platform/PurgeableVector.h ('k') | third_party/WebKit/Source/platform/SharedBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698