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

Unified Diff: base/trace_event/memory_dump_provider.h

Issue 1375643002: [tracing] directly use memory-infra from blink -> base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/BUILD.gn ('k') | base/trace_event/memory_dump_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « base/trace_event/BUILD.gn ('k') | base/trace_event/memory_dump_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698