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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1173333007: Refactor some Timeline interfaces to be simpler and support streaming (Closed) Base URL: git@github.com:dart-lang/sdk.git@timeline2
Patch Set: Created 5 years, 6 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 | « runtime/vm/dart.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 62972a58e5b83ef3c17d66484af0cdd7d7bfc802..d7c58186dc713586dc432186815d607d64e1be4d 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -5689,9 +5689,10 @@ DART_EXPORT Dart_Handle Dart_TimelineDuration(const char* label,
}
TimelineStream* stream = isolate->GetEmbedderStream();
ASSERT(stream != NULL);
- TimelineEvent* event = stream->RecordEvent();
+ TimelineEvent* event = stream->StartEvent();
if (event != NULL) {
- event->Duration(stream, label, start_micros, end_micros);
+ event->Duration(label, start_micros, end_micros);
+ event->Complete();
}
return Api::Success();
}
@@ -5705,9 +5706,10 @@ DART_EXPORT Dart_Handle Dart_TimelineInstant(const char* label) {
}
TimelineStream* stream = isolate->GetEmbedderStream();
ASSERT(stream != NULL);
- TimelineEvent* event = stream->RecordEvent();
+ TimelineEvent* event = stream->StartEvent();
if (event != NULL) {
- event->Instant(stream, label);
+ event->Instant(label);
+ event->Complete();
}
return Api::Success();
}
@@ -5726,9 +5728,10 @@ DART_EXPORT Dart_Handle Dart_TimelineAsyncBegin(const char* label,
*async_id = -1;
TimelineStream* stream = isolate->GetEmbedderStream();
ASSERT(stream != NULL);
- TimelineEvent* event = stream->RecordEvent();
+ TimelineEvent* event = stream->StartEvent();
if (event != NULL) {
- *async_id = event->AsyncBegin(stream, label);
+ *async_id = event->AsyncBegin(label);
+ event->Complete();
}
return Api::Success();
}
@@ -5746,9 +5749,10 @@ DART_EXPORT Dart_Handle Dart_TimelineAsyncInstant(const char* label,
}
TimelineStream* stream = isolate->GetEmbedderStream();
ASSERT(stream != NULL);
- TimelineEvent* event = stream->RecordEvent();
+ TimelineEvent* event = stream->StartEvent();
if (event != NULL) {
- event->AsyncInstant(stream, label, async_id);
+ event->AsyncInstant(label, async_id);
+ event->Complete();
}
return Api::Success();
}
@@ -5766,9 +5770,10 @@ DART_EXPORT Dart_Handle Dart_TimelineAsyncEnd(const char* label,
}
TimelineStream* stream = isolate->GetEmbedderStream();
ASSERT(stream != NULL);
- TimelineEvent* event = stream->RecordEvent();
+ TimelineEvent* event = stream->StartEvent();
if (event != NULL) {
- event->AsyncEnd(stream, label, async_id);
+ event->AsyncEnd(label, async_id);
+ event->Complete();
}
return Api::Success();
}
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698