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

Unified Diff: runtime/vm/timeline.cc

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
« runtime/include/dart_tools_api.h ('K') | « runtime/vm/timeline.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timeline.cc
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc
index 2fa59ef6b9f4ead3a48cf1dd0fb58d3220988d24..4072d80689482c2ed031ae7066ad0b80edd1c79e 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -155,6 +155,22 @@ void Timeline::SetVMStreamEnabled(bool enabled) {
}
+void Timeline::StreamStateChange(const char* stream_name,
+ bool prev,
+ bool curr) {
+ if (prev == curr) {
+ return;
+ }
+ if (strcmp(stream_name, "Embedder") == 0) {
+ if (curr && (Timeline::get_start_recording_cb() != NULL)) {
+ Timeline::get_start_recording_cb()();
+ } else if (!curr && (Timeline::get_stop_recording_cb() != NULL)) {
+ Timeline::get_stop_recording_cb()();
+ }
+ }
+}
+
+
void Timeline::Shutdown() {
ASSERT(recorder_ != NULL);
if (FLAG_timeline_dir != NULL) {
@@ -273,6 +289,9 @@ TimelineEventRecorder* Timeline::recorder_ = NULL;
TimelineStream Timeline::vm_stream_;
TimelineStream Timeline::vm_api_stream_;
MallocGrowableArray<char*>* Timeline::enabled_streams_ = NULL;
+Dart_EmbedderTimelineStartRecording Timeline::start_recording_cb_ = NULL;
+Dart_EmbedderTimelineStopRecording Timeline::stop_recording_cb_ = NULL;
+Dart_EmbedderTimelineGetTimeline Timeline::get_timeline_cb_ = NULL;
#define ISOLATE_TIMELINE_STREAM_DEFINE_FLAG(name, enabled_by_default) \
bool Timeline::stream_##name##_enabled_ = enabled_by_default;
« runtime/include/dart_tools_api.h ('K') | « runtime/vm/timeline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698