Chromium Code Reviews| Index: runtime/bin/process_impl.dart |
| diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart |
| index 48670e441efc342e100409b33090133b2fce7cab..a0516a4a8c2527744ec11f98410b21a2b4145806 100644 |
| --- a/runtime/bin/process_impl.dart |
| +++ b/runtime/bin/process_impl.dart |
| @@ -73,7 +73,6 @@ class _Process extends NativeFieldWrapperClass1 implements Process { |
| _out = new _Socket._internalWriteOnly(); // stdin going to process. |
| _err = new _Socket._internalReadOnly(); // stderr coming from process. |
| _exitHandler = new _Socket._internalReadOnly(); |
| - _closed = false; |
| _ended = false; |
| _started = false; |
| _onExit = null; |
| @@ -148,7 +147,7 @@ class _Process extends NativeFieldWrapperClass1 implements Process { |
| _exitHandler, |
| status); |
| if (!success) { |
| - close(); |
| + _close(); |
| completer.completeException( |
| new ProcessException(status._errorMessage, status._errorCode)); |
| return; |
| @@ -185,6 +184,7 @@ class _Process extends NativeFieldWrapperClass1 implements Process { |
| if (_onExit !== null) { |
| _onExit(exitCode(exitDataBuffer)); |
| } |
| + _out.close(); |
| } |
| exitDataRead += _exitHandler.inputStream.readInto( |
| @@ -208,23 +208,14 @@ class _Process extends NativeFieldWrapperClass1 implements Process { |
| _ProcessStartStatus status) native "Process_Start"; |
| InputStream get stdout { |
| - if (_closed) { |
| - throw new ProcessException("Process closed"); |
| - } |
| return _in.inputStream; |
| } |
| InputStream get stderr { |
| - if (_closed) { |
| - throw new ProcessException("Process closed"); |
| - } |
| return _err.inputStream; |
| } |
| OutputStream get stdin { |
| - if (_closed) { |
| - throw new ProcessException("Process closed"); |
| - } |
| return _out.outputStream; |
| } |
| @@ -240,21 +231,14 @@ class _Process extends NativeFieldWrapperClass1 implements Process { |
| bool _kill(Process p, int signal) native "Process_Kill"; |
| - void close() { |
| - if (_closed) { |
| - throw new ProcessException("Process closed"); |
| - } |
| + void _close() { |
|
Søren Gjesse
2012/10/29 11:43:24
_close is only used in one place - when starting a
Mads Ager (google)
2012/10/29 11:50:05
Thanks. Done.
|
| _in.close(); |
| _out.close(); |
| _err.close(); |
| _exitHandler.close(); |
| - _closed = true; |
| } |
| void set onExit(void callback(int exitCode)) { |
| - if (_closed) { |
| - throw new ProcessException("Process closed"); |
| - } |
| if (_ended) { |
| throw new ProcessException("Process killed"); |
| } |
| @@ -270,7 +254,6 @@ class _Process extends NativeFieldWrapperClass1 implements Process { |
| _Socket _out; |
| _Socket _err; |
| Socket _exitHandler; |
| - bool _closed; |
| bool _ended; |
| bool _started; |
| Function _onExit; |