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

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

Issue 19775015: Fixed bug in _ControllerStream.operator==. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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
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 class _BroadcastStream<T> extends _StreamImpl<T> { 7 class _BroadcastStream<T> extends _ControllerStream<T> {
8 _BroadcastStreamController _controller; 8 _BroadcastStream(_StreamControllerLifecycle controller) : super(controller);
9
10 _BroadcastStream(this._controller);
11 9
12 bool get isBroadcast => true; 10 bool get isBroadcast => true;
13
14 StreamSubscription<T> _createSubscription(
15 void onData(T data),
16 void onError(Object error),
17 void onDone(),
18 bool cancelOnError) =>
19 _controller._subscribe(onData, onError, onDone, cancelOnError);
20 } 11 }
21 12
22 abstract class _BroadcastSubscriptionLink { 13 abstract class _BroadcastSubscriptionLink {
23 _BroadcastSubscriptionLink _next; 14 _BroadcastSubscriptionLink _next;
24 _BroadcastSubscriptionLink _previous; 15 _BroadcastSubscriptionLink _previous;
25 } 16 }
26 17
27 class _BroadcastSubscription<T> extends _ControllerSubscription<T> 18 class _BroadcastSubscription<T> extends _ControllerSubscription<T>
28 implements _BroadcastSubscriptionLink { 19 implements _BroadcastSubscriptionLink {
29 static const int _STATE_EVENT_ID = 1; 20 static const int _STATE_EVENT_ID = 1;
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 _pauseCount++; 475 _pauseCount++;
485 } 476 }
486 void resume() { _resume(null); } 477 void resume() { _resume(null); }
487 void _resume(_) { 478 void _resume(_) {
488 if (_pauseCount > 0) _pauseCount--; 479 if (_pauseCount > 0) _pauseCount--;
489 } 480 }
490 void cancel() {} 481 void cancel() {}
491 bool get isPaused => _pauseCount > 0; 482 bool get isPaused => _pauseCount > 0;
492 Future asFuture([Object value]) => new _FutureImpl(); 483 Future asFuture([Object value]) => new _FutureImpl();
493 } 484 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/async/stream_controller.dart » ('j') | tests/lib/async/stream_controller_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698