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

Unified Diff: runtime/include/dart_tools_api.h

Issue 1783953002: Add ability for embedder to provide private timeline trace data (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_tools_api.h
diff --git a/runtime/include/dart_tools_api.h b/runtime/include/dart_tools_api.h
index 13be4f920ee3f8a86cb1c3fe860d8b924492a91e..8b9b0137135e7318c2be7d80ea4e2de6acd9ff37 100644
--- a/runtime/include/dart_tools_api.h
+++ b/runtime/include/dart_tools_api.h
@@ -1078,4 +1078,50 @@ DART_EXPORT Dart_Handle Dart_TimelineAsyncInstant(const char* label,
DART_EXPORT Dart_Handle Dart_TimelineAsyncEnd(const char* label,
int64_t async_id);
+
+/**
+ * Called by the VM to let the embedder know when to start recording into their
+ * own timeline implementation. Can be called from any thread.
+ */
+typedef void (*Dart_EmbedderTimelineStartRecording)();
+
+/**
+ * Called by the VM to let the embedder know when to stop recording into their
+ * own timeline implementation. Can be called from any thread.
+ */
+typedef void (*Dart_EmbedderTimelineStopRecording)();
+
+/**
+ * Called by the VM to request data from the embedder's private timeline
+ * implementation. Can be called from any thread and must complete
+ * synchronously.
yjbanov 2016/03/10 22:45:16 I'm not sure Flutter's implementation can complete
+ *
+ * \param stream_consumer The embedder must only call the stream_consumer with
+ * the Dart_StreamConsumer_kData state. See Dart_StreamConsumer above.
+ * \param user_data
+ *
+ * \return Returns true on success.
+ *
+ */
+typedef bool (*Dart_EmbedderTimelineGetTimeline)(
+ Dart_StreamConsumer stream_consumer,
+ void* user_data);
+
+
+/**
+ * Sets the embedder timeline callbacks. These callbacks are used by the VM
+ * to notify the embedder of timeline recording state changes and to request
+ * data from the embedder.
+ *
+ * \param start_recording See Dart_EmbedderTimelineStartRecording.
+ * \param stop_recording See Dart_EmbedderTimelineStopRecording.
+ * \param get_timeline See Dart_EmbedderTimelineGetTimeline.
+ *
+ * NOTE: To avoid races, this should be called before Dart_Initialize.
+ */
+DART_EXPORT void Dart_SetEmbedderTimelineCallbacks(
+ Dart_EmbedderTimelineStartRecording start_recording,
+ Dart_EmbedderTimelineStopRecording stop_recording,
+ Dart_EmbedderTimelineGetTimeline get_timeline);
siva 2016/03/11 12:56:17 Does it make sense for any of these callbacks to b
+
#endif // INCLUDE_DART_TOOLS_API_H_
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698