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/bin/dartutils.cc

Issue 1170503004: Initial Timeline Events (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
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 | « no previous file | runtime/bin/isolate_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index c443fc91f6ed86d008b3a41397230ab16a79b657..ab4d6be095923a49646d05fe2374a5316f01ca2a 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -15,6 +15,7 @@
#include "bin/extensions.h"
#include "bin/file.h"
#include "bin/io_buffer.h"
+#include "bin/isolate_data.h"
#include "bin/platform.h"
#include "bin/socket.h"
#include "bin/utils.h"
@@ -486,7 +487,9 @@ Dart_Handle DartUtils::LoadScript(const char* script_uri,
return NewDartUnsupportedError("Service did not return load port.");
}
Builtin::SetLoadPort(load_port);
-
+ IsolateData* isolate_data =
+ reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
+ Dart_TimelineAsyncBegin("LoadScript", &(isolate_data->load_async_id));
return LoadDataAsync_Invoke(Dart_Null(), uri, Dart_Null(), builtin_lib);
}
@@ -591,6 +594,11 @@ void FUNCTION_NAME(Builtin_LoadSource)(Dart_NativeArguments args) {
// no more outstanding load requests.
void FUNCTION_NAME(Builtin_DoneLoading)(Dart_NativeArguments args) {
Dart_Handle res = Dart_FinalizeLoading(true);
+ IsolateData* isolate_data =
+ reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
+ if (isolate_data->load_async_id >= 0) {
+ Dart_TimelineAsyncEnd("LoadScript", isolate_data->load_async_id);
+ }
if (Dart_IsError(res)) {
// TODO(hausner): If compilation/loading errors are supposed to
// be observable by the program, we need to mark the bad library
« no previous file with comments | « no previous file | runtime/bin/isolate_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698