Index: runtime/bin/vmservice/vmservice_io.dart |
diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart |
index 987af55d7939b7f9be91129e3e2f9ef36b93c344..3816aa2f940224a3f941e35f6a4a73a3da70a112 100644 |
--- a/runtime/bin/vmservice/vmservice_io.dart |
+++ b/runtime/bin/vmservice/vmservice_io.dart |
@@ -28,7 +28,17 @@ var _signalSubscription; |
// HTTP server. |
Server server; |
Future<Server> serverFuture; |
-HashMap<String, Asset> assets; |
+HashMap<String, Asset> _assets; |
+HashMap<String, Asset> get assets { |
+ if (_assets == null) { |
+ try { |
+ _assets = Asset.request(); |
+ } catch (e) { |
+ print('Could not load Observatory assets: $e'); |
+ } |
+ } |
+ return _assets; |
+} |
_onShutdown() { |
if (server != null) { |
@@ -43,11 +53,6 @@ _onShutdown() { |
} |
_bootServer() { |
- try { |
- assets = Asset.request(); |
- } catch (e) { |
- print('Could not load Observatory assets: $e'); |
- } |
// Lazily create service. |
var service = new VMService(); |
service.onShutdown = _onShutdown; |