OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_ | 5 #ifndef BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_ |
6 #define BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_ | 6 #define BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 }; | 22 }; |
23 | 23 |
24 // Dump provider which collects process-wide heap memory stats. This provider | 24 // Dump provider which collects process-wide heap memory stats. This provider |
25 // iterates over all the heaps of the current process to gather some metrics | 25 // iterates over all the heaps of the current process to gather some metrics |
26 // about them. | 26 // about them. |
27 class BASE_EXPORT WinHeapDumpProvider : public MemoryDumpProvider { | 27 class BASE_EXPORT WinHeapDumpProvider : public MemoryDumpProvider { |
28 public: | 28 public: |
29 static WinHeapDumpProvider* GetInstance(); | 29 static WinHeapDumpProvider* GetInstance(); |
30 | 30 |
31 // MemoryDumpProvider implementation. | 31 // MemoryDumpProvider implementation. |
32 bool DumpInto(ProcessMemoryDump* pmd) override; | 32 bool OnMemoryDump(ProcessMemoryDump* pmd) override; |
33 const char* GetFriendlyName() const override; | |
34 | 33 |
35 private: | 34 private: |
36 friend struct DefaultSingletonTraits<WinHeapDumpProvider>; | 35 friend struct DefaultSingletonTraits<WinHeapDumpProvider>; |
37 | 36 |
38 // Retrieves the information about given heap. The |heap_info| should contain | 37 // Retrieves the information about given heap. The |heap_info| should contain |
39 // a valid handle to an existing heap. The blocks contained in the | 38 // a valid handle to an existing heap. The blocks contained in the |
40 // |block_to_skip| set will be ignored. | 39 // |block_to_skip| set will be ignored. |
41 bool GetHeapInformation(WinHeapInfo* heap_info, | 40 bool GetHeapInformation(WinHeapInfo* heap_info, |
42 const std::set<void*>& block_to_skip); | 41 const std::set<void*>& block_to_skip); |
43 | 42 |
44 WinHeapDumpProvider() {} | 43 WinHeapDumpProvider() {} |
45 ~WinHeapDumpProvider() override {} | 44 ~WinHeapDumpProvider() override {} |
46 | 45 |
47 DISALLOW_COPY_AND_ASSIGN(WinHeapDumpProvider); | 46 DISALLOW_COPY_AND_ASSIGN(WinHeapDumpProvider); |
48 }; | 47 }; |
49 | 48 |
50 } // namespace trace_event | 49 } // namespace trace_event |
51 } // namespace base | 50 } // namespace base |
52 | 51 |
53 #endif // BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_ | 52 #endif // BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_ |
OLD | NEW |