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

Unified Diff: runtime/vm/timeline.cc

Issue 1836303002: Timeline: If the embedder stream is enabled at startup, invoke the embedder's callback to let it kn… (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 | 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 5f3d71956c3a7d561c95740b724dc0e2640794b2..ecfe3f43bb7f71603d8d22eb1cbb59a046c562e3 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -146,6 +146,11 @@ void Timeline::InitOnce() {
&stream_##name##_enabled_);
TIMELINE_STREAM_LIST(TIMELINE_STREAM_FLAG_DEFAULT)
#undef TIMELINE_STREAM_FLAG_DEFAULT
+
+ if (stream_Embedder_enabled_ &&
+ (Timeline::get_start_recording_cb() != NULL)) {
+ Timeline::get_start_recording_cb()();
+ }
}
@@ -167,9 +172,16 @@ void Timeline::StreamStateChange(const char* stream_name,
void Timeline::Shutdown() {
ASSERT(recorder_ != NULL);
+
+ if (stream_Embedder_enabled_ &&
+ (Timeline::get_stop_recording_cb() != NULL)) {
+ Timeline::get_stop_recording_cb()();
+ }
+
if (FLAG_timeline_dir != NULL) {
recorder_->WriteTo(FLAG_timeline_dir);
}
+
// Disable global streams.
#define TIMELINE_STREAM_DISABLE(name, not_used) \
stream_##name##_enabled_ = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698