Index: Source/platform/heap/BlinkGCMemoryDumpProvider.cpp |
diff --git a/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp b/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp |
index 7db5047e1e7f5b82101318b4ab4bb99047ba2e7c..6d696b3f9652ece104349059c92a4e7f46e85062 100644 |
--- a/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp |
+++ b/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp |
@@ -6,6 +6,7 @@ |
#include "Source/platform/heap/BlinkGCMemoryDumpProvider.h" |
#include "platform/heap/Handle.h" |
+#include "public/platform/Platform.h" |
#include "public/platform/WebMemoryAllocatorDump.h" |
#include "public/platform/WebProcessMemoryDump.h" |
#include "wtf/StdLibExtras.h" |
@@ -18,21 +19,33 @@ BlinkGCMemoryDumpProvider* BlinkGCMemoryDumpProvider::instance() |
return &instance; |
} |
+BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider() |
+{ |
+} |
+ |
bool BlinkGCMemoryDumpProvider::onMemoryDump(blink::WebProcessMemoryDump* memoryDump) |
{ |
+ m_currentProcessMemoryDump->clear(); |
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::TakeSnapshot, Heap::ForcedGC); |
Primiano Tucci (use gerrit)
2015/05/27 14:19:30
Can you add a comment before this line clarifing t
ssid
2015/05/27 14:39:33
Added below.
|
+ |
WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDump("blink_gc"); |
allocatorDump->AddScalar("inner_size", "bytes", Heap::allocatedObjectSize()); |
allocatorDump->AddScalar("outer_size", "bytes", Heap::allocatedSpace()); |
allocatorDump->AddScalar("estimated_live_object_size", "bytes", Heap::estimatedLiveObjectSize()); |
+ |
+ memoryDump->takeAllDumpsFrom(m_currentProcessMemoryDump.get()); |
Primiano Tucci (use gerrit)
2015/05/27 14:19:30
Or alternatively you can comment here saying:
merg
ssid
2015/05/27 14:39:33
Done.
|
return true; |
} |
-BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider() |
+WebMemoryAllocatorDump* BlinkGCMemoryDumpProvider::createMemoryAllocatorDumpForCurrentGC(const String& absoluteName) |
{ |
+ return m_currentProcessMemoryDump->createMemoryAllocatorDump(absoluteName); |
} |
-BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider() |
+BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider() |
{ |
+ m_currentProcessMemoryDump = adoptPtr(Platform::current()->createProcessMemoryDump()); |
Primiano Tucci (use gerrit)
2015/05/27 14:19:30
Can you do this in the ctor initializer list? Othe
ssid
2015/05/27 14:39:33
Done.
|
+ ASSERT(m_currentProcessMemoryDump); |
} |
} // namespace blink |