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 6bfbe81f3e8940552b034a05be04357f242a4c2c..6220ed7d4f29b3672647658844fe8ac3548915e2 100644 |
--- a/third_party/WebKit/Source/platform/SharedBuffer.cpp |
+++ b/third_party/WebKit/Source/platform/SharedBuffer.cpp |
@@ -275,12 +275,13 @@ void SharedBuffer::onMemoryDump(const String& dumpPrefix, WebProcessMemoryDump* |
WebMemoryAllocatorDump* dump = memoryDump->createMemoryAllocatorDump(dumpPrefix + "/shared_buffer"); |
dump->addScalar("size", "bytes", m_buffer.size()); |
memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName)); |
- } else { |
+ } |
+ if (m_segments.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); |
+ dump->addScalar("size", "bytes", m_size - m_buffer.size()); |
memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName)); |
} |
} |