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
3 // found in the LICENSE file.
5 #ifndef BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_
6 #define BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_
10 #include "base/memory/singleton.h"
11 #include "base/trace_event/memory_dump_provider.h"
14 namespace trace_event
{
16 // A structure containing some information about a given heap.
19 size_t committed_size
;
20 size_t allocated_size
;
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
27 class BASE_EXPORT WinHeapDumpProvider
: public MemoryDumpProvider
{
29 static WinHeapDumpProvider
* GetInstance();
31 // MemoryDumpProvider implementation.
32 bool OnMemoryDump(ProcessMemoryDump
* pmd
) override
;
35 friend struct DefaultSingletonTraits
<WinHeapDumpProvider
>;
37 // Retrieves the information about given heap. The |heap_info| should contain
38 // a valid handle to an existing heap. The blocks contained in the
39 // |block_to_skip| set will be ignored.
40 bool GetHeapInformation(WinHeapInfo
* heap_info
,
41 const std::set
<void*>& block_to_skip
);
43 WinHeapDumpProvider() {}
44 ~WinHeapDumpProvider() override
{}
46 DISALLOW_COPY_AND_ASSIGN(WinHeapDumpProvider
);
49 } // namespace trace_event
52 #endif // BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_