Chromium Code Reviews| 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 5f497652937790abb6eaf518eaf4feae66a8ba74..b5e8e466317864f7437934c5f2f8b61f779d0414 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 |
| +{ |
| + m_buffer.onMemoryDump(dumpPrefix + "/shared_buffer", memoryDump); |
|
haraken
2015/10/14 09:04:07
if (m_buffer.size()) {
m_buffer.onMemoryDump(dum
ssid
2015/10/14 12:06:40
Done.
|
| + |
| + 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(), String(WTF::Partitions::kAllocatedObjectPoolName)); |
| + } |
| +} |
| + |
| } // namespace blink |