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

Unified Diff: pkg/http/lib/src/utils.dart

Issue 12610006: Renamed StreamSink to EventSink. Renamed signalError to addError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed inheritance back! Now create StreamSink instead of EventSink where we create them. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: pkg/http/lib/src/utils.dart
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index 65c47997b1e6991c5cf460fe4ae8659432901262..51b209790903c240bec212a455ea4b1e91129ef2 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -152,10 +152,10 @@ Stream onDone(Stream stream, void onDone()) {
// TODO(nweiz): remove this when issue 7786 is fixed.
/// Pipes all data and errors from [stream] into [sink]. When [stream] is done,
/// [sink] is closed and the returned [Future] is completed.
-Future store(Stream stream, StreamSink sink) {
+Future store(Stream stream, EventSink sink) {
var completer = new Completer();
stream.listen(sink.add,
- onError: sink.signalError,
+ onError: sink.addError,
onDone: () {
sink.close();
completer.complete();
@@ -166,10 +166,10 @@ Future store(Stream stream, StreamSink sink) {
/// Pipes all data and errors from [stream] into [sink]. Completes [Future] once
/// [stream] is done. Unlike [store], [sink] remains open after [stream] is
/// done.
-Future writeStreamToSink(Stream stream, StreamSink sink) {
+Future writeStreamToSink(Stream stream, EventSink sink) {
var completer = new Completer();
stream.listen(sink.add,
- onError: sink.signalError,
+ onError: sink.addError,
onDone: () => completer.complete());
return completer.future;
}
@@ -200,8 +200,8 @@ Pair<Stream, Stream> tee(Stream stream) {
controller1.add(value);
controller2.add(value);
}, onError: (error) {
- controller1.signalError(error);
- controller2.signalError(error);
+ controller1.addError(error);
+ controller2.addError(error);
}, onDone: () {
controller1.close();
controller2.close();

Powered by Google App Engine
This is Rietveld 408576698