Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(974)

Unified Diff: runtime/bin/process_impl.dart

Issue 9500002: Rename blahHandler to onBlah throughout dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/process.dart ('k') | runtime/bin/socket.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_impl.dart
diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart
index f9eb9f4d133bb6b338543fc3f3ae8741953b99db..72adf34de78f394236ed4b0be9bd3e8c18200089 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;
- _exitHandlerCallback = null;
+ _onExit = null;
// TODO(ager): Make the actual process starting really async instead of
// simulating it with a timer.
new Timer((Timer ignore) => start(), 0);
@@ -69,9 +69,8 @@ class _Process implements Process {
status);
if (!success) {
close();
- if (_errorHandler !== null) {
- _errorHandler(new ProcessException(status._errorMessage,
- status._errorCode));
+ if (_onError !== null) {
+ _onError(new ProcessException(status._errorMessage, status._errorCode));
return;
}
}
@@ -88,7 +87,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.dataHandler = () {
+ _exitHandler.inputStream.onData = () {
int exitCode(List<int> ints) {
var code = _intFromBytes(ints, 0);
@@ -98,8 +97,8 @@ class _Process implements Process {
}
void handleExit() {
- if (_exitHandlerCallback !== null) {
- _exitHandlerCallback(exitCode(exitDataBuffer));
+ if (_onExit !== null) {
+ _onExit(exitCode(exitDataBuffer));
}
}
@@ -108,8 +107,8 @@ class _Process implements Process {
if (exitDataRead == EXIT_DATA_SIZE) handleExit();
};
- if (_startHandler !== null) {
- _startHandler();
+ if (_onStart !== null) {
+ _onStart();
}
}
@@ -145,8 +144,8 @@ class _Process implements Process {
void kill() {
if (_closed && _pid === null) {
- if (_errorHandler !== null) {
- _errorHandler(new ProcessException("Process closed"));
+ if (_onError !== null) {
+ _onError(new ProcessException("Process closed"));
}
return;
}
@@ -158,8 +157,8 @@ class _Process implements Process {
_killed = true;
return;
}
- if (_errorHandler !== null) {
- _errorHandler(new ProcessException("Could not kill process"));
+ if (_onError !== null) {
+ _onError(new ProcessException("Could not kill process"));
return;
}
}
@@ -177,22 +176,22 @@ class _Process implements Process {
_closed = true;
}
- void set exitHandler(void callback(int exitCode)) {
+ void set onExit(void callback(int exitCode)) {
if (_closed) {
throw new ProcessException("Process closed");
}
if (_killed) {
throw new ProcessException("Process killed");
}
- _exitHandlerCallback = callback;
+ _onExit = callback;
}
- void set errorHandler(void callback(ProcessException exception)) {
- _errorHandler = callback;
+ void set onError(void callback(ProcessException exception)) {
+ _onError = callback;
}
- void set startHandler(void callback()) {
- _startHandler = callback;
+ void set onStart(void callback()) {
+ _onStart = callback;
}
String _path;
@@ -206,7 +205,7 @@ class _Process implements Process {
bool _closed;
bool _killed;
bool _started;
- Function _exitHandlerCallback;
- Function _errorHandler;
- Function _startHandler;
+ Function _onExit;
+ Function _onError;
+ Function _onStart;
}
« no previous file with comments | « runtime/bin/process.dart ('k') | runtime/bin/socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698