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

Unified Diff: sdk/lib/async/stream_transformers.dart

Issue 357283003: Fix listeners being added to subscription after onListen was called. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
« no previous file with comments | « sdk/lib/async/stream_pipe.dart ('k') | tests/lib/async/stream_controller_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream_transformers.dart
diff --git a/sdk/lib/async/stream_transformers.dart b/sdk/lib/async/stream_transformers.dart
index e869486bd07b158caeb54a2f6a609927e9459e7c..0ed4117338172e065f79f3feb272ab3705611458 100644
--- a/sdk/lib/async/stream_transformers.dart
+++ b/sdk/lib/async/stream_transformers.dart
@@ -35,9 +35,12 @@ class _SinkTransformerStreamSubscription<S, T>
_SinkTransformerStreamSubscription(Stream<S> source,
_SinkMapper mapper,
+ void onData(T data),
+ Function onError,
+ void onDone(),
bool cancelOnError)
// We set the adapter's target only when the user is allowed to send data.
- : super(cancelOnError) {
+ : super(onData, onError, onDone, cancelOnError) {
_EventSinkWrapper<T> eventSink = new _EventSinkWrapper<T>(this);
_transformerSink = mapper(eventSink);
_subscription = source.listen(_handleData,
@@ -181,10 +184,7 @@ class _BoundSinkStream<S, T> extends Stream<T> {
bool cancelOnError }) {
cancelOnError = identical(true, cancelOnError);
StreamSubscription<T> subscription = new _SinkTransformerStreamSubscription(
- _stream, _sinkMapper, cancelOnError);
- subscription.onData(onData);
- subscription.onError(onError);
- subscription.onDone(onDone);
+ _stream, _sinkMapper, onData, onError, onDone, cancelOnError);
return subscription;
}
}
« no previous file with comments | « sdk/lib/async/stream_pipe.dart ('k') | tests/lib/async/stream_controller_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698