Chromium Code Reviews| Index: Source/platform/heap/ThreadState.h |
| diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h |
| index 459b8acd854aa0178a933f85b33cea1ea8f0e366..07664ade6980e49e0d882f70f66a860bdbb0c1a8 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 dumpMemoryIfNecessary(); |
|
petrcermak
2015/05/21 13:15:57
Maybe add one or two one-line comments explaining
ssid
2015/05/21 16:55:28
Done.
|
| + void dumpMemory(); |
| + |
| #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 |