Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Unified Diff: third_party/WebKit/Source/platform/SharedBuffer.cpp

Issue 2337733002: [tracing] Support BACKGROUND mode in MemoryCache dump provider (Closed)
Patch Set: remove trace_event change. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
}
}

Powered by Google App Engine
This is Rietveld 408576698