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

Side by Side Diff: base/trace_event/winheap_dump_provider_win.h

Issue 1087133005: Reland of crrev.com/1100173002 (Add a WinHeap dump provider to the memory profiler.) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_
6 #define BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_
7
8 #include <set>
9
10 #include "base/memory/singleton.h"
11 #include "base/trace_event/memory_dump_provider.h"
12
13 namespace base {
14 namespace trace_event {
15
16 // A structure containing some information about a given heap.
17 struct WinHeapInfo {
18 HANDLE heap_id;
19 size_t committed_size;
20 size_t allocated_size;
21 size_t block_count;
22 };
23
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
26 // about them.
27 class BASE_EXPORT WinHeapDumpProvider : public MemoryDumpProvider {
28 public:
29 static WinHeapDumpProvider* GetInstance();
30
31 // MemoryDumpProvider implementation.
32 bool DumpInto(ProcessMemoryDump* pmd) override;
33 const char* GetFriendlyName() const override;
34
35 private:
36 friend class WinHeapDumpProviderTest;
37 friend struct DefaultSingletonTraits<WinHeapDumpProvider>;
38
39 // Retrieves the information about given heap. The |heap_info| should contain
40 // a valid handle to an existing heap. The blocks contained in the
41 // |block_to_skip| set will be ignored.
42 bool GetHeapInformation(WinHeapInfo* heap_info,
43 const std::set<void*>& block_to_skip);
44
45 WinHeapDumpProvider() {}
46 ~WinHeapDumpProvider() override {}
47
48 DISALLOW_COPY_AND_ASSIGN(WinHeapDumpProvider);
49 };
50
51 } // namespace trace_event
52 } // namespace base
53
54 #endif // BASE_TRACE_EVENT_WINHEAP_DUMP_PROVIDER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698