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 d678a28fa5fb01dac6864ab458504c56fbf71b20..3c5b2996a55529d5604115cafa21eefd9c660fc4 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 + "/buffer", memoryDump); |
|
haraken
2015/09/28 14:54:02
/buffer => /shared_buffer
ssid
2015/09/28 16:24:39
Done.
|
| + |
| + if (m_size - m_buffer.size() > 0) { |
|
haraken
2015/09/28 14:54:02
Wouldn't it be enough to check:
if (!m_buffer.s
ssid
2015/09/28 16:24:39
I was wondering that both can be used at the same
haraken
2015/09/29 02:44:48
Shall we add an ASSERT about it?
|
| + // If there is data in the segments, then it should have been allocated |
| + // using fastMalloc. |
| + const String dataDumpName = dumpPrefix + "/data"; |
|
haraken
2015/09/28 14:54:02
/data => /segments
ssid
2015/09/28 16:24:38
Done.
|
| + auto dump = memoryDump->createMemoryAllocatorDump(dataDumpName); |
| + dump->AddScalar("size", "bytes", m_size - m_buffer.size()); |
|
haraken
2015/09/28 14:54:02
At this point, I think m_buffer.size() is guarante
ssid
2015/09/28 16:24:39
Yeah I was just paranoid..
|
| + memoryDump->AddSuballocation(dump->guid(), "malloc/allocated_objects"); |
| + } |
| +} |
| + |
| } // namespace blink |