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

Side by Side Diff: samples/total/server/DartCompiler.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, 9 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 unified diff | Download patch | Annotate | Revision Log
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 #library("total:dartcompiler"); 5 #library("total:dartcompiler");
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 8
9 /** 9 /**
10 * A simple wrapper around the Dart compiler (runs frog). 10 * A simple wrapper around the Dart compiler (runs frog).
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 if (checkOnly) { 53 if (checkOnly) {
54 args.add('--check-only'); 54 args.add('--check-only');
55 } 55 }
56 56
57 57
58 args.add(scriptName); 58 args.add(scriptName);
59 59
60 Process compiler = new Process.start(_frogExecPath, args); 60 Process compiler = new Process.start(_frogExecPath, args);
61 StringBuffer messages = new StringBuffer(); 61 StringBuffer messages = new StringBuffer();
62 compiler.exitHandler = (int status) { 62 compiler.onExit = (int status) {
63 compiler.close(); 63 compiler.close();
64 callback(status, messages.toString()); 64 callback(status, messages.toString());
65 }; 65 };
66 66
67 compiler.stdout.dataHandler = () => _readAll(compiler.stdout, messages); 67 compiler.stdout.onData = () => _readAll(compiler.stdout, messages);
68 compiler.stderr.dataHandler = () => _readAll(compiler.stderr, messages); 68 compiler.stderr.onData = () => _readAll(compiler.stderr, messages);
69 } 69 }
70 } 70 }
71 71
72 void _readAll(InputStream input, StringBuffer output) { 72 void _readAll(InputStream input, StringBuffer output) {
73 while (input.available() != 0) { 73 while (input.available() != 0) {
74 output.add(new String.fromCharCodes(input.read())); 74 output.add(new String.fromCharCodes(input.read()));
75 } 75 }
76 } 76 }
77 77
OLDNEW
« no previous file with comments | « samples/tests/samples/src/chat/ChatServerTest.dart ('k') | samples/total/server/TotalRunner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698