| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 patch class Process { | 5 patch class Process { |
| 6 /* patch */ static Future<Process> start(String executable, | 6 /* patch */ static Future<Process> start(String executable, |
| 7 List<String> arguments, | 7 List<String> arguments, |
| 8 [ProcessOptions options]) { | 8 [ProcessOptions options]) { |
| 9 _ProcessImpl process = new _ProcessImpl(executable, arguments, options); | 9 _ProcessImpl process = new _ProcessImpl(executable, arguments, options); |
| 10 return process._start(); | 10 return process._start(); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 void handleExit() { | 191 void handleExit() { |
| 192 _ended = true; | 192 _ended = true; |
| 193 if (_onExit !== null) { | 193 if (_onExit !== null) { |
| 194 _onExit(exitCode(exitDataBuffer)); | 194 _onExit(exitCode(exitDataBuffer)); |
| 195 } | 195 } |
| 196 _out.close(); | 196 _out.close(); |
| 197 } | 197 } |
| 198 | 198 |
| 199 exitDataRead += _exitHandler.inputStream.readInto( | 199 exitDataRead += _exitHandler.inputStream.readInto( |
| 200 exitDataBuffer, exitDataRead, EXIT_DATA_SIZE - exitDataRead); | 200 exitDataBuffer, exitDataRead, EXIT_DATA_SIZE - exitDataRead); |
| 201 if (exitDataRead == EXIT_DATA_SIZE) handleExit(); | 201 if (exitDataRead == EXIT_DATA_SIZE) { |
| 202 _exitHandler.close(); |
| 203 handleExit(); |
| 204 } |
| 202 }; | 205 }; |
| 203 | 206 |
| 204 completer.complete(this); | 207 completer.complete(this); |
| 205 }); | 208 }); |
| 206 return completer.future; | 209 return completer.future; |
| 207 } | 210 } |
| 208 | 211 |
| 209 bool _startNative(String path, | 212 bool _startNative(String path, |
| 210 List<String> arguments, | 213 List<String> arguments, |
| 211 String workingDirectory, | 214 String workingDirectory, |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 359 |
| 357 class _ProcessResult implements ProcessResult { | 360 class _ProcessResult implements ProcessResult { |
| 358 const _ProcessResult(int this.exitCode, | 361 const _ProcessResult(int this.exitCode, |
| 359 String this.stdout, | 362 String this.stdout, |
| 360 String this.stderr); | 363 String this.stderr); |
| 361 | 364 |
| 362 final int exitCode; | 365 final int exitCode; |
| 363 final String stdout; | 366 final String stdout; |
| 364 final String stderr; | 367 final String stderr; |
| 365 } | 368 } |
| OLD | NEW |