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..940478803cfcfe75963424f5d4ac4cf02e1a56c1 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 |
| +{ |
| + if (m_discardable) { |
| + WebMemoryAllocatorDump* dump = memoryDump->createDiscardableMemoryAllocatorDump(dumpName, m_discardable.get()); |
|
haraken
2015/09/29 02:44:48
Would you add a TODO?
TODO(tasak): The discardabl
ssid
2015/09/29 11:06:37
The locked size of the discardable memory is added
|
| + dump->AddScalar("discardable_size", "bytes", m_discardableSize); |
| + } |
| + if (m_vector.size() > 0) { |
|
haraken
2015/09/29 02:44:48
It is not possible that both m_discardable and m_v
ssid
2015/09/29 11:06:37
I see. Thanks. Made it else.
|
| + WebMemoryAllocatorDump* dump = memoryDump->createAllocatorDump(dumpName); |
| + dump->AddScalar("size", "bytes", m_vector.size()); |
| + memoryDump->AddSuballocation(dump->guid(), String(WTF::Partitions::allocatorPoolNameForTracing())); |
| + } |
| +} |
| + |
| void PurgeableVector::moveDataFromDiscardableToVector() |
| { |
| if (m_discardable) { |