OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library vmservice_io; | 5 library vmservice_io; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import 'dart:isolate'; | 10 import 'dart:isolate'; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 const _shortDelay = const Duration(milliseconds: 10); | 82 const _shortDelay = const Duration(milliseconds: 10); |
83 | 83 |
84 main() { | 84 main() { |
85 if (_autoStart) { | 85 if (_autoStart) { |
86 _bootServer(); | 86 _bootServer(); |
87 server.startup(); | 87 server.startup(); |
88 // It's just here to push an event on the event loop so that we invoke the | 88 // It's just here to push an event on the event loop so that we invoke the |
89 // scheduled microtasks. | 89 // scheduled microtasks. |
90 Timer.run(() {}); | 90 Timer.run(() {}); |
91 } | 91 } |
92 // TODO(johnmccutchan, turnidge) Creating a VMService object here causes | |
93 // strange behavior from the legacy debug protocol and coverage tool. | |
94 // Enable this code, and remove the call to Isolate::KillIsolate() from | |
95 // service_isolate.cc when the strange behavior is solved. | |
96 // See: https://github.com/dart-lang/sdk/issues/23977 | |
97 // else { | |
98 // var service = new VMService(); | |
99 // service.onShutdown = _onShutdown; | |
100 // } | |
101 scriptLoadPort.handler = _processLoadRequest; | 92 scriptLoadPort.handler = _processLoadRequest; |
102 // Register signal handler after a small delay to avoid stalling main | 93 // Register signal handler after a small delay to avoid stalling main |
103 // isolate startup. | 94 // isolate startup. |
104 new Timer(_shortDelay, _registerSignalHandler); | 95 new Timer(_shortDelay, _registerSignalHandler); |
105 return scriptLoadPort; | 96 return scriptLoadPort; |
106 } | 97 } |
OLD | NEW |