Index: runtime/bin/process_impl.dart |
diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart |
index 72adf34de78f394236ed4b0be9bd3e8c18200089..f9eb9f4d133bb6b338543fc3f3ae8741953b99db 100644 |
--- a/runtime/bin/process_impl.dart |
+++ b/runtime/bin/process_impl.dart |
@@ -44,7 +44,7 @@ class _Process implements Process { |
_closed = false; |
_killed = false; |
_started = false; |
- _onExit = null; |
+ _exitHandlerCallback = null; |
// TODO(ager): Make the actual process starting really async instead of |
// simulating it with a timer. |
new Timer((Timer ignore) => start(), 0); |
@@ -69,8 +69,9 @@ class _Process implements Process { |
status); |
if (!success) { |
close(); |
- if (_onError !== null) { |
- _onError(new ProcessException(status._errorMessage, status._errorCode)); |
+ if (_errorHandler !== null) { |
+ _errorHandler(new ProcessException(status._errorMessage, |
+ status._errorCode)); |
return; |
} |
} |
@@ -87,7 +88,7 @@ class _Process implements Process { |
int exitDataRead = 0; |
final int EXIT_DATA_SIZE = 8; |
List<int> exitDataBuffer = new List<int>(EXIT_DATA_SIZE); |
- _exitHandler.inputStream.onData = () { |
+ _exitHandler.inputStream.dataHandler = () { |
int exitCode(List<int> ints) { |
var code = _intFromBytes(ints, 0); |
@@ -97,8 +98,8 @@ class _Process implements Process { |
} |
void handleExit() { |
- if (_onExit !== null) { |
- _onExit(exitCode(exitDataBuffer)); |
+ if (_exitHandlerCallback !== null) { |
+ _exitHandlerCallback(exitCode(exitDataBuffer)); |
} |
} |
@@ -107,8 +108,8 @@ class _Process implements Process { |
if (exitDataRead == EXIT_DATA_SIZE) handleExit(); |
}; |
- if (_onStart !== null) { |
- _onStart(); |
+ if (_startHandler !== null) { |
+ _startHandler(); |
} |
} |
@@ -144,8 +145,8 @@ class _Process implements Process { |
void kill() { |
if (_closed && _pid === null) { |
- if (_onError !== null) { |
- _onError(new ProcessException("Process closed")); |
+ if (_errorHandler !== null) { |
+ _errorHandler(new ProcessException("Process closed")); |
} |
return; |
} |
@@ -157,8 +158,8 @@ class _Process implements Process { |
_killed = true; |
return; |
} |
- if (_onError !== null) { |
- _onError(new ProcessException("Could not kill process")); |
+ if (_errorHandler !== null) { |
+ _errorHandler(new ProcessException("Could not kill process")); |
return; |
} |
} |
@@ -176,22 +177,22 @@ class _Process implements Process { |
_closed = true; |
} |
- void set onExit(void callback(int exitCode)) { |
+ void set exitHandler(void callback(int exitCode)) { |
if (_closed) { |
throw new ProcessException("Process closed"); |
} |
if (_killed) { |
throw new ProcessException("Process killed"); |
} |
- _onExit = callback; |
+ _exitHandlerCallback = callback; |
} |
- void set onError(void callback(ProcessException exception)) { |
- _onError = callback; |
+ void set errorHandler(void callback(ProcessException exception)) { |
+ _errorHandler = callback; |
} |
- void set onStart(void callback()) { |
- _onStart = callback; |
+ void set startHandler(void callback()) { |
+ _startHandler = callback; |
} |
String _path; |
@@ -205,7 +206,7 @@ class _Process implements Process { |
bool _closed; |
bool _killed; |
bool _started; |
- Function _onExit; |
- Function _onError; |
- Function _onStart; |
+ Function _exitHandlerCallback; |
+ Function _errorHandler; |
+ Function _startHandler; |
} |