| Index: third_party/WebKit/Source/platform/SharedBuffer.cpp
|
| diff --git a/third_party/WebKit/Source/platform/SharedBuffer.cpp b/third_party/WebKit/Source/platform/SharedBuffer.cpp
|
| index d678a28fa5fb01dac6864ab458504c56fbf71b20..5d4894e0379c8149a3a82cadbb3929543dcbace4 100644
|
| --- a/third_party/WebKit/Source/platform/SharedBuffer.cpp
|
| +++ b/third_party/WebKit/Source/platform/SharedBuffer.cpp
|
| @@ -27,6 +27,7 @@
|
| #include "config.h"
|
| #include "platform/SharedBuffer.h"
|
|
|
| +#include "public/platform/WebProcessMemoryDump.h"
|
| #include "wtf/text/UTF8.h"
|
| #include "wtf/text/Unicode.h"
|
|
|
| @@ -410,4 +411,18 @@ bool SharedBuffer::isLocked() const
|
| return m_buffer.isLocked();
|
| }
|
|
|
| +void SharedBuffer::onMemoryDump(const String& dumpPrefix, WebProcessMemoryDump* memoryDump) const
|
| +{
|
| + m_buffer.onMemoryDump(dumpPrefix + "/shared_buffer", memoryDump);
|
| +
|
| + if (!m_buffer.size()) {
|
| + // If there is data in the segments, then it should have been allocated
|
| + // using fastMalloc.
|
| + const String dataDumpName = dumpPrefix + "/segments";
|
| + auto dump = memoryDump->createMemoryAllocatorDump(dataDumpName);
|
| + dump->AddScalar("size", "bytes", m_size);
|
| + memoryDump->AddSuballocation(dump->guid(), WTF::Partitions::allocatorPoolNameForTracing());
|
| + }
|
| +}
|
| +
|
| } // namespace blink
|
|
|