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

Side by Side Diff: sdk/lib/async/stream_impl.dart

Issue 12317145: Make _SingleStreamMultiplexer accept any Stream as source. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 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 part of dart.async; 5 part of dart.async;
6 6
7 // States shared by single/multi stream implementations. 7 // States shared by single/multi stream implementations.
8 8
9 /// Initial and default state where the stream can receive and send events. 9 /// Initial and default state where the stream can receive and send events.
10 const int _STREAM_OPEN = 0; 10 const int _STREAM_OPEN = 0;
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 } 1179 }
1180 if (_timer != null) { 1180 if (_timer != null) {
1181 _timer.cancel(); 1181 _timer.cancel();
1182 _timer = null; 1182 _timer = null;
1183 } 1183 }
1184 _pauseCount = 0; 1184 _pauseCount = 0;
1185 } 1185 }
1186 } 1186 }
1187 1187
1188 class _SingleStreamMultiplexer<T> extends _MultiStreamImpl<T> { 1188 class _SingleStreamMultiplexer<T> extends _MultiStreamImpl<T> {
1189 final _SingleStreamImpl<T> _source; 1189 final Stream<T> _source;
1190 StreamSubscription<T> _subscription; 1190 StreamSubscription<T> _subscription;
1191 1191
1192 _SingleStreamMultiplexer(this._source); 1192 _SingleStreamMultiplexer(this._source);
1193 1193
1194 void _callOnPauseStateChange() { 1194 void _callOnPauseStateChange() {
1195 if (_isPaused) { 1195 if (_isPaused) {
1196 if (_subscription != null) { 1196 if (_subscription != null) {
1197 _subscription.pause(); 1197 _subscription.pause();
1198 } 1198 }
1199 } else { 1199 } else {
(...skipping 14 matching lines...) Expand all
1214 onError: this._signalError, 1214 onError: this._signalError,
1215 onDone: this._close); 1215 onDone: this._close);
1216 } else { 1216 } else {
1217 // TODO(lrn): Check why this can happen. 1217 // TODO(lrn): Check why this can happen.
1218 if (_subscription == null) return; 1218 if (_subscription == null) return;
1219 _subscription.cancel(); 1219 _subscription.cancel();
1220 _subscription = null; 1220 _subscription = null;
1221 } 1221 }
1222 } 1222 }
1223 } 1223 }
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