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

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

Issue 584023004: Service isolate rework (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/vmservice/server.dart ('k') | runtime/bin/vmservice_dartium.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/vmservice_io.dart
diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart
index c04d485dbf27a20b724cdf7187ad3f6d4f45f5f9..2d99e17eb85787fab4fe322e4732688083870545 100644
--- a/runtime/bin/vmservice/vmservice_io.dart
+++ b/runtime/bin/vmservice/vmservice_io.dart
@@ -10,6 +10,7 @@ import 'dart:io';
import 'dart:isolate';
import 'dart:vmservice';
+part 'loader.dart';
part 'resources.dart';
part 'server.dart';
@@ -21,6 +22,8 @@ bool _autoStart;
bool _isWindows = false;
+var _signalWatch;
+
// HTTP servr.
Server server;
Future<Server> serverFuture;
@@ -54,18 +57,27 @@ void _onSignal(ProcessSignal signal) {
}
}
-void _registerSignalHandler(Stream signalWatch(ProcessSignal signal)) {
+void _registerSignalHandler() {
if (_isWindows) {
// Cannot register for signals on Windows.
return;
}
- signalWatch(ProcessSignal.SIGQUIT).listen(_onSignal);
+ _signalWatch(ProcessSignal.SIGQUIT).listen(_onSignal);
}
-main(Stream signalWatch(ProcessSignal signal)) {
+const _shortDelay = const Duration(milliseconds: 10);
+
+main() {
if (_autoStart) {
_bootServer();
server.startup();
+ // It's just here to push an event on the event loop so that we invoke the
+ // scheduled microtasks.
+ Timer.run(() {});
}
- _registerSignalHandler(signalWatch);
+ scriptLoadPort.handler = _processLoadRequest;
+ // Register signal handler after a small delay to avoid stalling main
+ // isolate startup.
+ new Timer(_shortDelay, _registerSignalHandler);
+ return scriptLoadPort;
}
« no previous file with comments | « runtime/bin/vmservice/server.dart ('k') | runtime/bin/vmservice_dartium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698