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

Side by Side Diff: tool/input_sdk/lib/async/stream_transformers.dart

Issue 1112403004: SDK fixes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Formatting fix Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.async; 5 part of dart.async;
6 6
7 /** 7 /**
8 * Wraps an [_EventSink] so it exposes only the [EventSink] interface. 8 * Wraps an [_EventSink] so it exposes only the [EventSink] interface.
9 */ 9 */
10 class _EventSinkWrapper<T> implements EventSink<T> { 10 class _EventSinkWrapper<T> implements EventSink<T> {
(...skipping 16 matching lines...) Expand all
27 */ 27 */
28 class _SinkTransformerStreamSubscription<S, T> 28 class _SinkTransformerStreamSubscription<S, T>
29 extends _BufferingStreamSubscription<T> { 29 extends _BufferingStreamSubscription<T> {
30 /// The transformer's input sink. 30 /// The transformer's input sink.
31 EventSink _transformerSink; 31 EventSink _transformerSink;
32 32
33 /// The subscription to the input stream. 33 /// The subscription to the input stream.
34 StreamSubscription<S> _subscription; 34 StreamSubscription<S> _subscription;
35 35
36 _SinkTransformerStreamSubscription(Stream<S> source, 36 _SinkTransformerStreamSubscription(Stream<S> source,
37 _SinkMapper mapper, 37 _SinkMapper<S, T> mapper,
38 void onData(T data), 38 void onData(T data),
39 Function onError, 39 Function onError,
40 void onDone(), 40 void onDone(),
41 bool cancelOnError) 41 bool cancelOnError)
42 // We set the adapter's target only when the user is allowed to send data. 42 // We set the adapter's target only when the user is allowed to send data.
43 : super(onData, onError, onDone, cancelOnError) { 43 : super(onData, onError, onDone, cancelOnError) {
44 _EventSinkWrapper<T> eventSink = new _EventSinkWrapper<T>(this); 44 _EventSinkWrapper<T> eventSink = new _EventSinkWrapper<T>(this);
45 _transformerSink = mapper(eventSink); 45 _transformerSink = mapper(eventSink);
46 _subscription = source.listen(_handleData, 46 _subscription = source.listen(_handleData,
47 onError: _handleError, 47 onError: _handleError,
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 void onDone(), 302 void onDone(),
303 bool cancelOnError }) { 303 bool cancelOnError }) {
304 cancelOnError = identical(true, cancelOnError); 304 cancelOnError = identical(true, cancelOnError);
305 StreamSubscription<T> result = _transformer(_stream, cancelOnError); 305 StreamSubscription<T> result = _transformer(_stream, cancelOnError);
306 result.onData(onData); 306 result.onData(onData);
307 result.onError(onError); 307 result.onError(onError);
308 result.onDone(onDone); 308 result.onDone(onDone);
309 return result; 309 return result;
310 } 310 }
311 } 311 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698