| 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 99acec2c38f67988b3748805a84662af6b8b6b38..1502f6a4a33802e8eda574f54c34d0bd71495431 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"
|
|
|
| @@ -414,4 +415,18 @@ bool SharedBuffer::isLocked() const
|
| return m_buffer.isLocked();
|
| }
|
|
|
| +void SharedBuffer::onMemoryDump(const String& dumpPrefix, WebProcessMemoryDump* memoryDump) const
|
| +{
|
| + if (m_buffer.size()) {
|
| + m_buffer.onMemoryDump(dumpPrefix + "/shared_buffer", memoryDump);
|
| + } else {
|
| + // 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(), String(WTF::Partitions::kAllocatedObjectPoolName));
|
| + }
|
| +}
|
| +
|
| } // namespace blink
|
|
|