Chromium Code Reviews| 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) { |