Chromium Code Reviews| Index: runtime/bin/process_impl.dart |
| diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart |
| index bdb5d6aca4a070ea538663d47eda8f873898091d..f8df35d97e435ac098ae68e372c0847475470bbf 100644 |
| --- a/runtime/bin/process_impl.dart |
| +++ b/runtime/bin/process_impl.dart |
| @@ -178,6 +178,7 @@ class _Process extends Process { |
| } |
| void handleExit() { |
| + _killed = true; |
|
Søren Gjesse
2012/06/12 10:22:25
Maybe this should be named _ended now.
Anders Johnsen
2012/06/12 12:00:13
Done.
|
| if (_onExit !== null) { |
| _onExit(exitCode(exitDataBuffer)); |
| } |
| @@ -224,7 +225,11 @@ class _Process extends Process { |
| return _out.outputStream; |
| } |
| - void kill() { |
| + void kill([ProcessSignal signal = ProcessSignal.SIGTERM]) { |
| + if (signal is! ProcessSignal) { |
| + throw new IllegalArgumentException( |
| + "Argument 'signal' must be a ProcessSignal"); |
| + } |
| if (_closed && _pid === null) { |
| _reportError(new ProcessException("Process closed")); |
| return; |
| @@ -233,15 +238,14 @@ class _Process extends Process { |
| return; |
| } |
| // TODO(ager): Make the actual kill operation asynchronous. |
| - if (_kill(_pid)) { |
| - _killed = true; |
| + if (_kill(_pid, signal._signalNumber)) { |
| return; |
| } |
| _reportError(new ProcessException("Could not kill process")); |
| return; |
| } |
| - void _kill(int pid) native "Process_Kill"; |
| + void _kill(int pid, int signal) native "Process_Kill"; |
| void close() { |
| if (_closed) { |