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

Side by Side Diff: runtime/bin/process_patch.dart

Issue 11361008: Remember to close the exitHandler when processes have received (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 patch class Process { 5 patch class Process {
6 /* patch */ static Future<Process> start(String executable, 6 /* patch */ static Future<Process> start(String executable,
7 List<String> arguments, 7 List<String> arguments,
8 [ProcessOptions options]) { 8 [ProcessOptions options]) {
9 _ProcessImpl process = new _ProcessImpl(executable, arguments, options); 9 _ProcessImpl process = new _ProcessImpl(executable, arguments, options);
10 return process._start(); 10 return process._start();
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 void handleExit() { 191 void handleExit() {
192 _ended = true; 192 _ended = true;
193 if (_onExit !== null) { 193 if (_onExit !== null) {
194 _onExit(exitCode(exitDataBuffer)); 194 _onExit(exitCode(exitDataBuffer));
195 } 195 }
196 _out.close(); 196 _out.close();
197 } 197 }
198 198
199 exitDataRead += _exitHandler.inputStream.readInto( 199 exitDataRead += _exitHandler.inputStream.readInto(
200 exitDataBuffer, exitDataRead, EXIT_DATA_SIZE - exitDataRead); 200 exitDataBuffer, exitDataRead, EXIT_DATA_SIZE - exitDataRead);
201 if (exitDataRead == EXIT_DATA_SIZE) handleExit(); 201 if (exitDataRead == EXIT_DATA_SIZE) {
202 _exitHandler.close();
203 handleExit();
204 }
202 }; 205 };
203 206
204 completer.complete(this); 207 completer.complete(this);
205 }); 208 });
206 return completer.future; 209 return completer.future;
207 } 210 }
208 211
209 bool _startNative(String path, 212 bool _startNative(String path,
210 List<String> arguments, 213 List<String> arguments,
211 String workingDirectory, 214 String workingDirectory,
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 359
357 class _ProcessResult implements ProcessResult { 360 class _ProcessResult implements ProcessResult {
358 const _ProcessResult(int this.exitCode, 361 const _ProcessResult(int this.exitCode,
359 String this.stdout, 362 String this.stdout,
360 String this.stderr); 363 String this.stderr);
361 364
362 final int exitCode; 365 final int exitCode;
363 final String stdout; 366 final String stdout;
364 final String stderr; 367 final String stderr;
365 } 368 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698