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

Unified Diff: runtime/include/dart_tools_api.h

Issue 2996803002: Add current rss and embedder name to Observatory (Closed)
Patch Set: Managing null currentRSS in graph tooltip Created 3 years, 4 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
Index: runtime/include/dart_tools_api.h
diff --git a/runtime/include/dart_tools_api.h b/runtime/include/dart_tools_api.h
index e7440f8f9e9289e57868589e283201f6d15ee924..33d6665c740e727d02753417c54e1d6dfe606724 100644
--- a/runtime/include/dart_tools_api.h
+++ b/runtime/include/dart_tools_api.h
@@ -765,6 +765,45 @@ DART_EXPORT void Dart_RegisterRootServiceRequestCallback(
Dart_ServiceRequestCallback callback,
void* user_data);
+/**
+ * Embedder information which can be requested by the VM for internal or
+ * reporting purposes.
+ *
+ * The pointers in this structure are not going to be cached or freed by the VM.
+ */
+
+typedef struct {
zra 2017/08/10 22:19:50 This should probably have a version field. See for
cbernaschina 2017/08/12 00:29:42 Done.
+ const char* name; // [optional] The name of the embedder
+ uintptr_t current_rss; // [optional] the current RSS of the embedder
+ uintptr_t max_rss; // [optional] the maximum RSS of the embedder
+} Dart_EmbedderInformation;
+
+/**
+ * Callback provided by the embedder that is used by the vm to request
+ * information.
+ *
+ * \return Returns a pointer to a Dart_EmbedderInformation structure.
+ * The embedder keeps the ownership of the structure and any field in it.
+ * The embedder must ensure that the structure will remain valid until the
+ * next invokation of the callback.
+ */
+typedef const Dart_EmbedderInformation* (*Dart_GetEmbedderInformation)();
zra 2017/08/10 22:19:50 Maybe Dart_GetEmbedderInformation -> Dart_Embedder
cbernaschina 2017/08/12 00:29:42 Done.
+
+/**
+ * Register a Dart_ServiceRequestCallback to be called to handle
+ * requests for the named rpc. The callback will be invoked without a
+ * current isolate.
+ *
+ * \param method The name of the command that this callback is responsible for.
+ * \param callback The callback to invoke.
+ * \param user_data The user data passed to the callback.
+ *
+ * NOTE: If multiple callbacks with the same name are registered, only
+ * the last callback registered will be remembered.
+ */
+DART_EXPORT void Dart_SetGetEmbedderInformationCallback(
zra 2017/08/09 22:58:27 Consider a rename to avoid "SetGet", which doesn't
cbernaschina 2017/08/10 00:29:17 I called it SetGetEmbedderInformationCallback... f
zra 2017/08/10 22:19:50 Maybe just SetEmbedderInformationCallback?
cbernaschina 2017/08/12 00:29:42 Done.
+ Dart_GetEmbedderInformation get_embedder_information);
+
/*
* ========
* Event Streams

Powered by Google App Engine
This is Rietveld 408576698