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

Unified Diff: runtime/bin/process_impl.dart

Issue 9029001: Add close to input stream and cleanup socket and streams (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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
Index: runtime/bin/process_impl.dart
diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart
index 185990719ce19545ef506ac551862b3c9b02c172..3c135186d258f76a85fd25935f7e648cf746d789 100644
--- a/runtime/bin/process_impl.dart
+++ b/runtime/bin/process_impl.dart
@@ -71,10 +71,9 @@ class _Process implements Process {
// Setup an exit handler to handle internal cleanup and possible
// callback when a process terminates.
- _exitHandler.dataHandler = () {
+ _exitHandler.inputStream.dataHandler = () {
final int EXIT_DATA_SIZE = 12;
List<int> exitDataBuffer = new List<int>(EXIT_DATA_SIZE);
- InputStream input = _exitHandler.inputStream;
int exitDataRead = 0;
int exitCode(List<int> ints) {
@@ -95,13 +94,9 @@ class _Process implements Process {
}
}
- void exitData() {
- exitDataRead += input.readInto(
- exitDataBuffer, exitDataRead, EXIT_DATA_SIZE - exitDataRead);
- if (exitDataRead == EXIT_DATA_SIZE) handleExit();
- }
-
- input.dataHandler = exitData;
+ exitDataRead += _exitHandler.inputStream.readInto(
+ exitDataBuffer, exitDataRead, EXIT_DATA_SIZE - exitDataRead);
+ if (exitDataRead == EXIT_DATA_SIZE) handleExit();
};
if (_startHandler !== null) {

Powered by Google App Engine
This is Rietveld 408576698