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

Side by Side Diff: utils/pub/io.dart

Issue 12086055: Fix a use of a StreamController as a Stream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 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 /// Helper functionality to make working with IO easier. 5 /// Helper functionality to make working with IO easier.
6 library io; 6 library io;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:isolate'; 10 import 'dart:isolate';
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 // TODO(rnystrom): Should log the stderr and display it if an actual error 904 // TODO(rnystrom): Should log the stderr and display it if an actual error
905 // occurs. 905 // occurs.
906 store(process.stdout, controller); 906 store(process.stdout, controller);
907 }); 907 });
908 }).catchError((e) { 908 }).catchError((e) {
909 // We don't have to worry about double-signaling here, since the store() 909 // We don't have to worry about double-signaling here, since the store()
910 // above will only be reached if everything succeeds. 910 // above will only be reached if everything succeeds.
911 controller.signalError(e.error, e.stackTrace); 911 controller.signalError(e.error, e.stackTrace);
912 controller.close(); 912 controller.close();
913 }); 913 });
914 return new ByteStream(controller); 914 return new ByteStream(controller.stream);
915 } 915 }
916 916
917 /// Exception thrown when an operation times out. 917 /// Exception thrown when an operation times out.
918 class TimeoutException implements Exception { 918 class TimeoutException implements Exception {
919 final String message; 919 final String message;
920 920
921 const TimeoutException(this.message); 921 const TimeoutException(this.message);
922 922
923 String toString() => message; 923 String toString() => message;
924 } 924 }
(...skipping 24 matching lines...) Expand all
949 Directory _getDirectory(entry) { 949 Directory _getDirectory(entry) {
950 if (entry is Directory) return entry; 950 if (entry is Directory) return entry;
951 return new Directory(entry); 951 return new Directory(entry);
952 } 952 }
953 953
954 /// Gets a [Uri] for [uri], which can either already be one, or be a [String]. 954 /// Gets a [Uri] for [uri], which can either already be one, or be a [String].
955 Uri _getUri(uri) { 955 Uri _getUri(uri) {
956 if (uri is Uri) return uri; 956 if (uri is Uri) return uri;
957 return Uri.parse(uri); 957 return Uri.parse(uri);
958 } 958 }
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