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

Unified Diff: runtime/bin/builtin.dart

Issue 1916793003: - Allow for loading dart:html and friends into the standalone (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase. Created 4 years, 8 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/bin/builtin.cc ('k') | runtime/bin/builtin_natives.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin.dart
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index 59ccec3c1f359c705ac97432ece6626ee0fc29a7..f0c0cdcf666adcbed7c9b14d0727df9ec4c35e7a 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -67,6 +67,13 @@ const _Dart_kResourceLoad = 3;
// command line.
bool _traceLoading = false;
+// This is currently a build time flag only. We measure the time from the first
+// load request (opening the receive port) to completing the last load
+// request (closing the receive port). Future, deferred load operations will
+// add to this time.
+bool _timeLoading = false;
+Stopwatch _stopwatch;
+
// A port for communicating with the service isolate for I/O.
SendPort _loadPort;
// The receive port for a load request. Multiple sources can be fetched in
@@ -358,9 +365,10 @@ void _finishLoadRequest(_LoadRequest req) {
}
if (!_pendingLoads() && (_dataPort != null)) {
+ _stopwatch.stop();
// Close the _dataPort now that there are no more requests outstanding.
- if (_traceLoading) {
- _log("Closing loading port.");
+ if (_traceLoading || _timeLoading) {
+ _log("Closing loading port: ${_stopwatch.elapsedMilliseconds} ms");
}
_dataPort.close();
_dataPort = null;
@@ -408,8 +416,13 @@ void _startLoadRequest(int tag, String uri, Uri resourceUri, context) {
if (_traceLoading) {
_log("Initializing load port.");
}
+ // Allocate the Stopwatch if necessary.
+ if (_stopwatch == null) {
+ _stopwatch = new Stopwatch();
+ }
assert(_dataPort == null);
_dataPort = new RawReceivePort(_handleLoaderReply);
+ _stopwatch.start();
}
// Register the load request and send it to the VM service isolate.
var req = new _LoadRequest(tag, uri, resourceUri, context);
« no previous file with comments | « runtime/bin/builtin.cc ('k') | runtime/bin/builtin_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698