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

Unified Diff: runtime/bin/vmservice/vmservice_io.dart

Issue 1030013002: Shutdown the service isolate when shutting down the VM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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
Index: runtime/bin/vmservice/vmservice_io.dart
diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart
index 2d99e17eb85787fab4fe322e4732688083870545..15a9633a4513ea7f47c3807a347ab0c5eef0ffbd 100644
--- a/runtime/bin/vmservice/vmservice_io.dart
+++ b/runtime/bin/vmservice/vmservice_io.dart
@@ -28,20 +28,27 @@ var _signalWatch;
Server server;
Future<Server> serverFuture;
-void _bootServer() {
+_onShutdown() {
+ if (server != null) {
+ server.close(true).catchError((e, st) => null);
zra 2015/03/24 21:53:59 Maybe the catchError should assert() so that we at
Cutch 2015/03/24 23:39:07 Done.
+ }
+}
+
+_bootServer() {
zra 2015/03/24 21:53:59 Why drop the return types?
Cutch 2015/03/24 23:39:07 I'm omitting 'void' return types in Dart code.
// Load resources.
_triggerResourceLoad();
// Lazily create service.
var service = new VMService();
+ service.onShutdown = _onShutdown;
// Lazily create server.
server = new Server(service, _ip, _port);
}
-void _clearFuture(_) {
+_clearFuture(_) {
serverFuture = null;
}
-void _onSignal(ProcessSignal signal) {
+_onSignal(ProcessSignal signal) {
if (serverFuture != null) {
// Still waiting.
return;
@@ -57,7 +64,7 @@ void _onSignal(ProcessSignal signal) {
}
}
-void _registerSignalHandler() {
+_registerSignalHandler() {
if (_isWindows) {
// Cannot register for signals on Windows.
return;

Powered by Google App Engine
This is Rietveld 408576698