Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class _ProcessStartStatus { | 5 class _ProcessStartStatus { |
| 6 int _errorCode; // Set to OS error code if process start failed. | 6 int _errorCode; // Set to OS error code if process start failed. |
| 7 String _errorMessage; // Set to OS error message if process start failed. | 7 String _errorMessage; // Set to OS error message if process start failed. |
| 8 } | 8 } |
| 9 | 9 |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 } | 144 } |
| 145 | 145 |
| 146 OutputStream get stdin() { | 146 OutputStream get stdin() { |
| 147 if (_closed) { | 147 if (_closed) { |
| 148 throw new ProcessException("Process closed"); | 148 throw new ProcessException("Process closed"); |
| 149 } | 149 } |
| 150 return _out.outputStream; | 150 return _out.outputStream; |
| 151 } | 151 } |
| 152 | 152 |
| 153 void kill() { | 153 void kill() { |
| 154 if (_closed && _pid === null && _errorHandler !== null) { | 154 if (_closed && _pid === null) { |
|
Søren Gjesse
2012/01/06 13:43:20
So we cannot ever have !_closed and _pid == null?
| |
| 155 _errorHandler(new ProcessException("Process closed")); | 155 if (_errorHandler !== null) { |
| 156 _errorHandler(new ProcessException("Process closed")); | |
| 157 } | |
| 156 return; | 158 return; |
| 157 } | 159 } |
| 158 if (_killed) { | 160 if (_killed) { |
| 159 return; | 161 return; |
| 160 } | 162 } |
| 161 // TODO(ager): Make the actual kill operation asynchronous. | 163 // TODO(ager): Make the actual kill operation asynchronous. |
| 162 if (_kill(_pid)) { | 164 if (_kill(_pid)) { |
| 163 _killed = true; | 165 _killed = true; |
| 164 return; | 166 return; |
| 165 } | 167 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 Socket _err; | 210 Socket _err; |
| 209 Socket _exitHandler; | 211 Socket _exitHandler; |
| 210 int _pid; | 212 int _pid; |
| 211 bool _closed; | 213 bool _closed; |
| 212 bool _killed; | 214 bool _killed; |
| 213 bool _started; | 215 bool _started; |
| 214 Function _exitHandlerCallback; | 216 Function _exitHandlerCallback; |
| 215 Function _errorHandler; | 217 Function _errorHandler; |
| 216 Function _startHandler; | 218 Function _startHandler; |
| 217 } | 219 } |
| OLD | NEW |