Index: base/trace_event/memory_dump_provider.h |
diff --git a/base/trace_event/memory_dump_provider.h b/base/trace_event/memory_dump_provider.h |
index 3b1f13623a7e5367a89c1eb976fdaec12fbf632e..35cbd823d46a42e98b4cb15a7acfa8a1118950a1 100644 |
--- a/base/trace_event/memory_dump_provider.h |
+++ b/base/trace_event/memory_dump_provider.h |
@@ -7,9 +7,13 @@ |
#include "base/base_export.h" |
#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
#include "base/trace_event/memory_dump_request_args.h" |
namespace base { |
+ |
+class SingleThreadTaskRunner; |
+ |
namespace trace_event { |
class ProcessMemoryDump; |
@@ -23,6 +27,22 @@ struct MemoryDumpArgs { |
// The contract interface that memory dump providers must implement. |
class BASE_EXPORT MemoryDumpProvider { |
public: |
+ // Helper methods to register/unregister a memory dump provider. |
+ // The MemoryDumpManager does NOT take memory ownership of |dump_provider|, |
+ // which is expected to either be a singleton or unregister itself. |
+ // If the optional |task_runner| argument is non-null, all the calls to the |
+ // |dump_provider| will be issued on the given thread. Otherwise, the |mdp| |
+ // should be able to handle calls on arbitrary threads. |
+ static void Register( |
Ruud van Asseldonk
2015/10/08 18:40:54
Does this introduce two ways of doing the same thi
|
+ MemoryDumpProvider* dump_provider, |
+ const scoped_refptr<SingleThreadTaskRunner>& task_runner); |
+ |
+ // Similar to Register, but all the calls are guaranteed to happen on the |
+ // current thread's task runner. |
+ static void RegisterOnCurrentThread(MemoryDumpProvider* dump_provider); |
+ |
+ static void Unregister(MemoryDumpProvider* dump_provider); |
+ |
// Called by the MemoryDumpManager when generating memory dumps. |
// The |args| specify if the embedder should generate light/heavy dumps on |
// dump requests. The embedder should return true if the |pmd| was |