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

Unified Diff: mojo/public/cpp/bindings/connector.h

Issue 2623263005: Tag some of Mojo heap allocations for the heap profiler. (Closed)
Patch Set: Synced Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/multiprocess_message_pipe_unittest.cc ('k') | mojo/public/cpp/bindings/lib/connector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/connector.h
diff --git a/mojo/public/cpp/bindings/connector.h b/mojo/public/cpp/bindings/connector.h
index dcfe8cb930464f41bbc326ffa2d3b2891005b7d4..1ccc79586b0eea0a152b282cd598b00e1f432c50 100644
--- a/mojo/public/cpp/bindings/connector.h
+++ b/mojo/public/cpp/bindings/connector.h
@@ -150,6 +150,10 @@ class MOJO_CPP_BINDINGS_EXPORT Connector
return task_runner_.get();
}
+ // Sets the tag used by the heap profiler.
+ // |tag| must be a const string literal.
+ void SetWatcherHeapProfilerTag(const char* tag);
+
private:
// Callback of mojo::Watcher.
void OnWatcherHandleReady(MojoResult result);
@@ -206,6 +210,10 @@ class MOJO_CPP_BINDINGS_EXPORT Connector
base::Lock connected_lock_;
bool connected_ = true;
+ // The tag used to track heap allocations that originated from a Watcher
+ // notification.
+ const char* heap_profiler_tag_ = nullptr;
+
// Create a single weak ptr and use it everywhere, to avoid the malloc/free
// cost of creating a new weak ptr whenever it is needed.
// NOTE: This weak pointer is invalidated when the message pipe is closed or
« no previous file with comments | « mojo/edk/system/multiprocess_message_pipe_unittest.cc ('k') | mojo/public/cpp/bindings/lib/connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698