Index: runtime/bin/vmservice/vmservice_io.dart |
diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart |
index 7ae65d480de9187bb17947987b00054397544afd..a883a73cf31165f9d60774c484c3f7f776c1628f 100644 |
--- a/runtime/bin/vmservice/vmservice_io.dart |
+++ b/runtime/bin/vmservice/vmservice_io.dart |
@@ -162,6 +162,27 @@ Future<List<Map<String,String>>> listFilesCallback(Uri dirPath) async { |
return result; |
} |
+Future<Uri> serverInformationCallback() async { |
+ _lazyServerBoot(); |
+ return server.serverAddress; |
+} |
+ |
+Future<Uri> webServerControlCallback(bool enable) async { |
+ _lazyServerBoot(); |
+ if (server.running == enable) { |
+ // No change. |
+ return server.serverAddress; |
+ } |
+ |
+ if (enable) { |
+ await server.startup(); |
+ return server.serverAddress; |
+ } else { |
+ await server.shutdown(true); |
+ return server.serverAddress; |
+ } |
+} |
+ |
_clearFuture(_) { |
serverFuture = null; |
} |
@@ -204,6 +225,8 @@ main() { |
VMServiceEmbedderHooks.writeStreamFile = writeStreamFileCallback; |
VMServiceEmbedderHooks.readFile = readFileCallback; |
VMServiceEmbedderHooks.listFiles = listFilesCallback; |
+ VMServiceEmbedderHooks.serverInformation = serverInformationCallback; |
+ VMServiceEmbedderHooks.webServerControl = webServerControlCallback; |
// Always instantiate the vmservice object so that the exit message |
// can be delivered and waiting loaders can be cancelled. |
var service = new VMService(); |