Chromium Code Reviews| Index: Source/platform/heap/Heap.cpp |
| diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp |
| index c938b3a3ffe05e998fc64b37b3048150329650cc..5727f925ad7393ed6ef082b479c0680cce4f4cc8 100644 |
| --- a/Source/platform/heap/Heap.cpp |
| +++ b/Source/platform/heap/Heap.cpp |
| @@ -41,6 +41,8 @@ |
| #include "platform/heap/SafePoint.h" |
| #include "platform/heap/ThreadState.h" |
| #include "public/platform/Platform.h" |
| +#include "public/platform/WebMemoryAllocatorDump.h" |
| +#include "public/platform/WebProcessMemoryDump.h" |
| #include "wtf/Assertions.h" |
| #include "wtf/ContainerAnnotations.h" |
| #include "wtf/LeakAnnotations.h" |
| @@ -213,6 +215,20 @@ void BaseHeap::cleanupPages() |
| m_firstPage = nullptr; |
| } |
| +void BaseHeap::dumpMemoryInto(WebProcessMemoryDump* memoryDump, const String* allocatorBaseName) |
|
Primiano Tucci (use gerrit)
2015/05/21 18:43:10
maybe s/allocatorBaseName/dumpBaseName/... or just
ssid
2015/05/22 13:34:06
Done.
|
| +{ |
| + // Returns if there is no page used in the heap. |
| + if (!m_firstPage) |
| + return; |
|
Primiano Tucci (use gerrit)
2015/05/21 18:43:10
Hmm I'd much rather prefer that you dump a zero in
ssid
2015/05/22 13:34:06
Done.
|
| + |
| + size_t pageCount = 0; |
| + for (BasePage* page = m_firstPage; page; page = page->next()) { |
| + pageCount++; |
| + } |
| + WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDump(*allocatorBaseName); |
| + allocatorDump->AddScalar("blink_page_count", "objects", pageCount); |
| +} |
| + |
| #if ENABLE(ASSERT) || ENABLE(GC_PROFILING) |
| BasePage* BaseHeap::findPageFromAddress(Address address) |
| { |