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

Side by Side Diff: sdk/lib/async/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 // ------------------------------------------------------------------- 7 // -------------------------------------------------------------------
8 // Controller for creating and adding events to a stream. 8 // Controller for creating and adding events to a stream.
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 10
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 bool cancelOnError) => 595 bool cancelOnError) =>
596 _controller._subscribe(onData, onError, onDone, cancelOnError); 596 _controller._subscribe(onData, onError, onDone, cancelOnError);
597 597
598 // Override == and hashCode so that new streams returned by the same 598 // Override == and hashCode so that new streams returned by the same
599 // controller are considered equal. The controller returns a new stream 599 // controller are considered equal. The controller returns a new stream
600 // each time it's queried, but doesn't have to cache the result. 600 // each time it's queried, but doesn't have to cache the result.
601 601
602 int get hashCode => _controller.hashCode ^ 0x35323532; 602 int get hashCode => _controller.hashCode ^ 0x35323532;
603 603
604 bool operator==(Object other) { 604 bool operator==(Object other) {
605 if (identical(this, other)) return true;
605 if (other is! _ControllerStream) return false; 606 if (other is! _ControllerStream) return false;
606 _ControllerStream otherStream = other; 607 _ControllerStream otherStream = other;
607 return identical(otherStream._controller, this); 608 return identical(otherStream._controller, this._controller);
608 } 609 }
609 } 610 }
610 611
611 class _ControllerSubscription<T> extends _BufferingStreamSubscription<T> { 612 class _ControllerSubscription<T> extends _BufferingStreamSubscription<T> {
612 final _StreamControllerLifecycle<T> _controller; 613 final _StreamControllerLifecycle<T> _controller;
613 614
614 _ControllerSubscription(this._controller, 615 _ControllerSubscription(this._controller,
615 void onData(T data), 616 void onData(T data),
616 void onError(Object error), 617 void onError(Object error),
617 void onDone(), 618 void onDone(),
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 var varData; 686 var varData;
686 687
687 _StreamControllerAddStreamState(_StreamController controller, 688 _StreamControllerAddStreamState(_StreamController controller,
688 this.varData, 689 this.varData,
689 Stream source) : super(controller, source) { 690 Stream source) : super(controller, source) {
690 if (controller.isPaused) { 691 if (controller.isPaused) {
691 addSubscription.pause(); 692 addSubscription.pause();
692 } 693 }
693 } 694 }
694 } 695 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698