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

Unified Diff: Source/platform/heap/ThreadState.h

Issue 1149673002: Adding blink gc memory dump infrastructure for thread specific dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing dump name. Created 5 years, 7 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: Source/platform/heap/ThreadState.h
diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h
index 459b8acd854aa0178a933f85b33cea1ea8f0e366..33098b08552201eaf11a4eafa2098d950a49b523 100644
--- a/Source/platform/heap/ThreadState.h
+++ b/Source/platform/heap/ThreadState.h
@@ -34,6 +34,7 @@
#include "platform/PlatformExport.h"
#include "platform/heap/AddressSanitizer.h"
#include "platform/heap/ThreadingTraits.h"
+#include "public/platform/WebMemoryDumpProvider.h"
#include "public/platform/WebThread.h"
#include "wtf/Forward.h"
#include "wtf/HashMap.h"
@@ -164,7 +165,7 @@ struct AgeCounts {
typedef HashMap<String, AgeCounts> ClassAgeCountsMap;
#endif
-class PLATFORM_EXPORT ThreadState {
+class PLATFORM_EXPORT ThreadState : public WebMemoryDumpProvider {
WTF_MAKE_NONCOPYABLE(ThreadState);
public:
// When garbage collecting we need to know whether or not there
@@ -457,6 +458,9 @@ public:
// Visit all persistents allocated on this thread.
void visitPersistents(Visitor*);
+ void snapshotMemoryIfNecessary();
+ void snapshotMemory();
+
#if ENABLE(GC_PROFILING)
const GCInfo* findGCInfo(Address);
static const GCInfo* findGCInfoFromAllThreads(Address);
@@ -609,6 +613,9 @@ public:
void allocationPointAdjusted(int heapIndex);
void promptlyFreed(size_t gcInfoIndex);
+ // WebMemoryDumpProvider implementation.
+ bool onMemoryDump(WebProcessMemoryDump*) override;
+
private:
ThreadState();
~ThreadState();
@@ -706,6 +713,8 @@ private:
Vector<PageMemoryRegion*> m_allocatedRegionsSinceLastGC;
+ OwnPtr<WebProcessMemoryDump> m_lastProcessMemoryDump;
+
#if ENABLE(GC_PROFILING)
double m_nextFreeListSnapshotTime;
#endif

Powered by Google App Engine
This is Rietveld 408576698