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

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: Rebasing for primiano's future changes. 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..276e3ed70f57eced2cefccf555b485022137928c 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 {
Primiano Tucci (use gerrit) 2015/05/21 18:43:10 We discussed this offline (there is a thread in th
ssid 2015/05/22 13:34:07 Done.
WTF_MAKE_NONCOPYABLE(ThreadState);
public:
// When garbage collecting we need to know whether or not there
@@ -457,6 +458,10 @@ public:
// Visit all persistents allocated on this thread.
void visitPersistents(Visitor*);
+ // Takes dump of memory statistics when tracing is enabled with memory
+ // category.
+ void dumpMemoryIfNecessary();
Primiano Tucci (use gerrit) 2015/05/21 18:43:10 Had a second thought about this, please don't hate
ssid 2015/05/22 13:34:07 Haha now there is no need to think about it. :) Pe
+
#if ENABLE(GC_PROFILING)
const GCInfo* findGCInfo(Address);
static const GCInfo* findGCInfoFromAllThreads(Address);
@@ -609,6 +614,9 @@ public:
void allocationPointAdjusted(int heapIndex);
void promptlyFreed(size_t gcInfoIndex);
+ // WebMemoryDumpProvider implementation.
+ bool onMemoryDump(WebProcessMemoryDump*) override;
Primiano Tucci (use gerrit) 2015/05/21 18:43:10 This should go away from here, as per discussion u
ssid 2015/05/22 13:34:07 Done.
+
private:
ThreadState();
~ThreadState();
@@ -706,6 +714,8 @@ private:
Vector<PageMemoryRegion*> m_allocatedRegionsSinceLastGC;
+ OwnPtr<WebProcessMemoryDump> m_lastProcessMemoryDump;
Primiano Tucci (use gerrit) 2015/05/21 18:43:10 And this should be just one, shared by all the Thr
ssid 2015/05/22 13:34:07 Done.
+
#if ENABLE(GC_PROFILING)
double m_nextFreeListSnapshotTime;
#endif

Powered by Google App Engine
This is Rietveld 408576698