| 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 @patch | 5 @patch |
| 6 class _WindowsCodePageDecoder { | 6 class _WindowsCodePageDecoder { |
| 7 @patch | 7 @patch |
| 8 static String _decodeBytes(List<int> bytes) native "SystemEncodingToString"; | 8 static String _decodeBytes(List<int> bytes) native "SystemEncodingToString"; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 Future<Process> _start() { | 385 Future<Process> _start() { |
| 386 var completer = new Completer(); | 386 var completer = new Completer(); |
| 387 if (_mode == ProcessStartMode.NORMAL) { | 387 if (_mode == ProcessStartMode.NORMAL) { |
| 388 _exitCode = new Completer<int>(); | 388 _exitCode = new Completer<int>(); |
| 389 } | 389 } |
| 390 // TODO(ager): Make the actual process starting really async instead of | 390 // TODO(ager): Make the actual process starting really async instead of |
| 391 // simulating it with a timer. | 391 // simulating it with a timer. |
| 392 Timer.run(() { | 392 Timer.run(() { |
| 393 var status = new _ProcessStartStatus(); | 393 var status = new _ProcessStartStatus(); |
| 394 bool success = _startNative( | 394 bool success = _startNative( |
| 395 _Namespace._namespace, |
| 395 _path, | 396 _path, |
| 396 _arguments, | 397 _arguments, |
| 397 _workingDirectory, | 398 _workingDirectory, |
| 398 _environment, | 399 _environment, |
| 399 _mode.index, | 400 _mode.index, |
| 400 _mode == ProcessStartMode.DETACHED | 401 _mode == ProcessStartMode.DETACHED |
| 401 ? null | 402 ? null |
| 402 : _stdin._sink._nativeSocket, | 403 : _stdin._sink._nativeSocket, |
| 403 _mode == ProcessStartMode.DETACHED | 404 _mode == ProcessStartMode.DETACHED |
| 404 ? null | 405 ? null |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 451 |
| 451 completer.complete(this); | 452 completer.complete(this); |
| 452 }); | 453 }); |
| 453 return completer.future; | 454 return completer.future; |
| 454 } | 455 } |
| 455 | 456 |
| 456 ProcessResult _runAndWait(Encoding stdoutEncoding, Encoding stderrEncoding) { | 457 ProcessResult _runAndWait(Encoding stdoutEncoding, Encoding stderrEncoding) { |
| 457 var status = new _ProcessStartStatus(); | 458 var status = new _ProcessStartStatus(); |
| 458 _exitCode = new Completer<int>(); | 459 _exitCode = new Completer<int>(); |
| 459 bool success = _startNative( | 460 bool success = _startNative( |
| 461 _Namespace._namespace, |
| 460 _path, | 462 _path, |
| 461 _arguments, | 463 _arguments, |
| 462 _workingDirectory, | 464 _workingDirectory, |
| 463 _environment, | 465 _environment, |
| 464 ProcessStartMode.NORMAL.index, | 466 ProcessStartMode.NORMAL.index, |
| 465 _stdin._sink._nativeSocket, | 467 _stdin._sink._nativeSocket, |
| 466 _stdout._stream._nativeSocket, | 468 _stdout._stream._nativeSocket, |
| 467 _stderr._stream._nativeSocket, | 469 _stderr._stream._nativeSocket, |
| 468 _exitHandler._nativeSocket, | 470 _exitHandler._nativeSocket, |
| 469 status); | 471 status); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 488 _resourceInfo.stopped(); | 490 _resourceInfo.stopped(); |
| 489 | 491 |
| 490 return new ProcessResult( | 492 return new ProcessResult( |
| 491 result[0], | 493 result[0], |
| 492 result[1], | 494 result[1], |
| 493 getOutput(result[2], stdoutEncoding), | 495 getOutput(result[2], stdoutEncoding), |
| 494 getOutput(result[3], stderrEncoding)); | 496 getOutput(result[3], stderrEncoding)); |
| 495 } | 497 } |
| 496 | 498 |
| 497 bool _startNative( | 499 bool _startNative( |
| 500 _Namespace namespace, |
| 498 String path, | 501 String path, |
| 499 List<String> arguments, | 502 List<String> arguments, |
| 500 String workingDirectory, | 503 String workingDirectory, |
| 501 List<String> environment, | 504 List<String> environment, |
| 502 int mode, | 505 int mode, |
| 503 _NativeSocket stdin, | 506 _NativeSocket stdin, |
| 504 _NativeSocket stdout, | 507 _NativeSocket stdout, |
| 505 _NativeSocket stderr, | 508 _NativeSocket stderr, |
| 506 _NativeSocket exitHandler, | 509 _NativeSocket exitHandler, |
| 507 _ProcessStartStatus status) native "Process_Start"; | 510 _ProcessStartStatus status) native "Process_Start"; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 var process = new _ProcessImpl( | 614 var process = new _ProcessImpl( |
| 612 executable, | 615 executable, |
| 613 arguments, | 616 arguments, |
| 614 workingDirectory, | 617 workingDirectory, |
| 615 environment, | 618 environment, |
| 616 includeParentEnvironment, | 619 includeParentEnvironment, |
| 617 runInShell, | 620 runInShell, |
| 618 ProcessStartMode.NORMAL); | 621 ProcessStartMode.NORMAL); |
| 619 return process._runAndWait(stdoutEncoding, stderrEncoding); | 622 return process._runAndWait(stdoutEncoding, stderrEncoding); |
| 620 } | 623 } |
| OLD | NEW |