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..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 |