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

Unified Diff: runtime/include/dart_debugger_api.h

Issue 12221022: Initial prototype of vmstats support, based on Dart VM Stats draft design doc. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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_debugger_api.h
===================================================================
--- runtime/include/dart_debugger_api.h (revision 18152)
+++ runtime/include/dart_debugger_api.h (working copy)
@@ -578,4 +578,53 @@
*/
DART_EXPORT Dart_Isolate Dart_GetIsolate(Dart_IsolateId isolate_id);
+
+/**
+ * Returns VM status information. VM status is implemented using a
+ * different status plug-in for each type of status; for example, there
+ * might be an "isolate" plug-in that returns information about the
+ * current isolates.
+ *
+ * To get a list of status types, this function is called with a
+ * status_type parameter of "statustypes". This list is useful when
+ * building a status dashboard.
+ *
+ * \param request A REST-like string, which uses '/' to separate
+ * parameters. The first parameter is always the status type.
+ *
+ * \return The requested status as a JSON formatted string, with the
+ * contents defined by the status plug-in. The caller is responsible
+ * for freeing this string.
+ */
+DART_EXPORT char* Dart_GetVmStatus(const char* request);
+
+
+/**
+ * A VM status callback. Status plug-ins implement and register this
+ * function using Dart_RegisterStatusPlugin. When Dart_GetVMStatus is
+ * called with the plug-in's status type, the callback is invoked to
+ * provide the requested information.
+ *
+ * Note: status requests execute outside of an isolate (which is why
+ * handles aren't used).
+ *
+ * \param parameters an optional string that defines REST-like parameters
+ * to define what information is requested.
+ *
+ * \return Returns a valid JSON string, allocated from C heap. The caller
+ * is responsible for releasing this string.
+ */
+typedef char* (*Dart_VmStatusCallback)(const char* parameters);
+
+
+/**
+ * Register a VM status plug-in. The specified status type must not already
+ * have a registered plug-in.
+ *
+ * \return True if the plug-in was registered, or an error describing the
+ * failure.
+ */
+DART_EXPORT Dart_Handle Dart_RegisterVmStatusPlugin(
+ const char* status_type, Dart_VmStatusCallback callback);
siva 2013/02/09 01:00:57 I guess I am not clear about why external entities
Tom Ball 2013/02/14 23:45:16 It's so other libraries like io can add status. Is
+
#endif // INCLUDE_DART_DEBUGGER_API_H_

Powered by Google App Engine
This is Rietveld 408576698