| 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:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 VMServiceEmbedderHooks.createTempDir = createTempDirCallback; | 222 VMServiceEmbedderHooks.createTempDir = createTempDirCallback; |
| 223 VMServiceEmbedderHooks.deleteDir = deleteDirCallback; | 223 VMServiceEmbedderHooks.deleteDir = deleteDirCallback; |
| 224 VMServiceEmbedderHooks.writeFile = writeFileCallback; | 224 VMServiceEmbedderHooks.writeFile = writeFileCallback; |
| 225 VMServiceEmbedderHooks.writeStreamFile = writeStreamFileCallback; | 225 VMServiceEmbedderHooks.writeStreamFile = writeStreamFileCallback; |
| 226 VMServiceEmbedderHooks.readFile = readFileCallback; | 226 VMServiceEmbedderHooks.readFile = readFileCallback; |
| 227 VMServiceEmbedderHooks.listFiles = listFilesCallback; | 227 VMServiceEmbedderHooks.listFiles = listFilesCallback; |
| 228 VMServiceEmbedderHooks.serverInformation = serverInformationCallback; | 228 VMServiceEmbedderHooks.serverInformation = serverInformationCallback; |
| 229 VMServiceEmbedderHooks.webServerControl = webServerControlCallback; | 229 VMServiceEmbedderHooks.webServerControl = webServerControlCallback; |
| 230 // Always instantiate the vmservice object so that the exit message | 230 // Always instantiate the vmservice object so that the exit message |
| 231 // can be delivered and waiting loaders can be cancelled. | 231 // can be delivered and waiting loaders can be cancelled. |
| 232 var service = new VMService(); | 232 new VMService(); |
| 233 if (_autoStart) { | 233 if (_autoStart) { |
| 234 _lazyServerBoot(); | 234 _lazyServerBoot(); |
| 235 server.startup(); | 235 server.startup(); |
| 236 // It's just here to push an event on the event loop so that we invoke the | 236 // It's just here to push an event on the event loop so that we invoke the |
| 237 // scheduled microtasks. | 237 // scheduled microtasks. |
| 238 Timer.run(() {}); | 238 Timer.run(() {}); |
| 239 } | 239 } |
| 240 scriptLoadPort.handler = _processLoadRequest; | 240 scriptLoadPort.handler = _processLoadRequest; |
| 241 // Register signal handler after a small delay to avoid stalling main | 241 // Register signal handler after a small delay to avoid stalling main |
| 242 // isolate startup. | 242 // isolate startup. |
| 243 _registerSignalHandlerTimer = new Timer(shortDelay, _registerSignalHandler); | 243 _registerSignalHandlerTimer = new Timer(shortDelay, _registerSignalHandler); |
| 244 return scriptLoadPort; | 244 return scriptLoadPort; |
| 245 } | 245 } |
| 246 | 246 |
| 247 _shutdown() native "VMServiceIO_Shutdown"; | 247 _shutdown() native "VMServiceIO_Shutdown"; |
| OLD | NEW |