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

Unified Diff: runtime/vm/timeline.cc

Issue 1799933002: Ensure embedder timeline callbacks are called for service protocol requests (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/platform/text_buffer.cc ('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 4072d80689482c2ed031ae7066ad0b80edd1c79e..cd0b0fdb8efa72b9db23e901f641b52d33256e05 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -1027,6 +1027,14 @@ void TimelineEventRecorder::ThreadBlockCompleteEvent(TimelineEvent* event) {
}
+void TimelineEventRecorder::PrintEmbedderJSONEvents(JSONStream* events) {
+ if (Timeline::get_get_timeline_cb() != NULL) {
+ events->PrintCommaIfNeeded();
+ Timeline::get_get_timeline_cb()(AppendJSONStreamConsumer, events);
+ }
+}
+
+
void TimelineEventRecorder::WriteTo(const char* directory) {
if (!FLAG_support_service) {
return;
@@ -1166,6 +1174,7 @@ void TimelineEventRingRecorder::PrintJSON(JSONStream* js,
JSONArray events(&topLevel, "traceEvents");
PrintJSONMeta(&events);
PrintJSONEvents(&events, filter);
+ PrintEmbedderJSONEvents(js);
}
}
@@ -1177,6 +1186,7 @@ void TimelineEventRingRecorder::PrintTraceEvent(JSONStream* js,
}
JSONArray events(js);
PrintJSONEvents(&events, filter);
+ PrintEmbedderJSONEvents(js);
}
@@ -1299,6 +1309,7 @@ void TimelineEventEndlessRecorder::PrintJSON(JSONStream* js,
JSONArray events(&topLevel, "traceEvents");
PrintJSONMeta(&events);
PrintJSONEvents(&events, filter);
+ PrintEmbedderJSONEvents(js);
}
}
@@ -1311,6 +1322,7 @@ void TimelineEventEndlessRecorder::PrintTraceEvent(
}
JSONArray events(js);
PrintJSONEvents(&events, filter);
+ PrintEmbedderJSONEvents(js);
}
« runtime/platform/text_buffer.cc ('K') | « runtime/vm/timeline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698