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

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

Issue 1430073002: [tracing] Allow asynchronous unregistration of unbound dump providers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoid repeating messages Created 4 years, 11 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
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MEMORY_DUMP_PROVIDER_H_ 5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_H_
6 #define BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_H_ 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/process/process_handle.h" 10 #include "base/process/process_handle.h"
(...skipping 18 matching lines...) Expand all
29 Options() : target_pid(kNullProcessId) {} 29 Options() : target_pid(kNullProcessId) {}
30 explicit Options(ProcessId target_pid) : target_pid(target_pid) {} 30 explicit Options(ProcessId target_pid) : target_pid(target_pid) {}
31 31
32 // If the dump provider generates dumps on behalf of another process, 32 // If the dump provider generates dumps on behalf of another process,
33 // |target_process| contains the pid of that process. 33 // |target_process| contains the pid of that process.
34 // The default value is kNullProcessId, which means that the dump provider 34 // The default value is kNullProcessId, which means that the dump provider
35 // generates dumps for the current process. 35 // generates dumps for the current process.
36 ProcessId target_pid; 36 ProcessId target_pid;
37 }; 37 };
38 38
39 virtual ~MemoryDumpProvider() {}
40
39 // Called by the MemoryDumpManager when generating memory dumps. 41 // Called by the MemoryDumpManager when generating memory dumps.
40 // The |args| specify if the embedder should generate light/heavy dumps on 42 // The |args| specify if the embedder should generate light/heavy dumps on
41 // dump requests. The embedder should return true if the |pmd| was 43 // dump requests. The embedder should return true if the |pmd| was
42 // successfully populated, false if something went wrong and the dump should 44 // successfully populated, false if something went wrong and the dump should
43 // be considered invalid. 45 // be considered invalid.
44 // (Note, the MemoryDumpManager has a fail-safe logic which will disable the 46 // (Note, the MemoryDumpManager has a fail-safe logic which will disable the
45 // MemoryDumpProvider for the entire trace session if it fails consistently). 47 // MemoryDumpProvider for the entire trace session if it fails consistently).
46 virtual bool OnMemoryDump(const MemoryDumpArgs& args, 48 virtual bool OnMemoryDump(const MemoryDumpArgs& args,
47 ProcessMemoryDump* pmd) = 0; 49 ProcessMemoryDump* pmd) = 0;
48 50
49 // Called by the MemoryDumpManager when an allocator should start or stop 51 // Called by the MemoryDumpManager when an allocator should start or stop
50 // collecting extensive allocation data, if supported. 52 // collecting extensive allocation data, if supported.
51 virtual void OnHeapProfilingEnabled(bool enabled) {} 53 virtual void OnHeapProfilingEnabled(bool enabled) {}
52 54
53 protected: 55 protected:
54 MemoryDumpProvider() {} 56 MemoryDumpProvider() {}
55 virtual ~MemoryDumpProvider() {}
56 57
57 DISALLOW_COPY_AND_ASSIGN(MemoryDumpProvider); 58 DISALLOW_COPY_AND_ASSIGN(MemoryDumpProvider);
58 }; 59 };
59 60
60 } // namespace trace_event 61 } // namespace trace_event
61 } // namespace base 62 } // namespace base
62 63
63 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_H_ 64 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_H_
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698