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 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 29 matching lines...) Expand all Loading... |
40 _in = new _Socket._internalReadOnly(); // stdout coming from process. | 40 _in = new _Socket._internalReadOnly(); // stdout coming from process. |
41 _out = new _Socket._internalWriteOnly(); // stdin going to process. | 41 _out = new _Socket._internalWriteOnly(); // stdin going to process. |
42 _err = new _Socket._internalReadOnly(); // stderr coming from process. | 42 _err = new _Socket._internalReadOnly(); // stderr coming from process. |
43 _exitHandler = new _Socket._internalReadOnly(); | 43 _exitHandler = new _Socket._internalReadOnly(); |
44 _closed = false; | 44 _closed = false; |
45 _killed = false; | 45 _killed = false; |
46 _started = false; | 46 _started = false; |
47 _onExit = null; | 47 _onExit = null; |
48 // TODO(ager): Make the actual process starting really async instead of | 48 // TODO(ager): Make the actual process starting really async instead of |
49 // simulating it with a timer. | 49 // simulating it with a timer. |
50 new Timer((Timer ignore) => start(), 0); | 50 new Timer(0, (Timer ignore) => start()); |
51 } | 51 } |
52 | 52 |
53 int _intFromBytes(List<int> bytes, int offset) { | 53 int _intFromBytes(List<int> bytes, int offset) { |
54 return (bytes[offset] + | 54 return (bytes[offset] + |
55 (bytes[offset + 1] << 8) + | 55 (bytes[offset + 1] << 8) + |
56 (bytes[offset + 2] << 16) + | 56 (bytes[offset + 2] << 16) + |
57 (bytes[offset + 3] << 24)); | 57 (bytes[offset + 3] << 24)); |
58 } | 58 } |
59 | 59 |
60 void start() { | 60 void start() { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 Socket _err; | 202 Socket _err; |
203 Socket _exitHandler; | 203 Socket _exitHandler; |
204 int _pid; | 204 int _pid; |
205 bool _closed; | 205 bool _closed; |
206 bool _killed; | 206 bool _killed; |
207 bool _started; | 207 bool _started; |
208 Function _onExit; | 208 Function _onExit; |
209 Function _onError; | 209 Function _onError; |
210 Function _onStart; | 210 Function _onStart; |
211 } | 211 } |
OLD | NEW |