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

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

Issue 1250373007: Fix missing generic type parameters on streams. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | sdk/lib/async/stream_impl.dart » ('j') | 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 // ------------------------------------------------------------------- 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 632
633 StreamSubscription<T> _subscribe( 633 StreamSubscription<T> _subscribe(
634 void onData(T data), 634 void onData(T data),
635 Function onError, 635 Function onError,
636 void onDone(), 636 void onDone(),
637 bool cancelOnError) { 637 bool cancelOnError) {
638 if (!_isInitialState) { 638 if (!_isInitialState) {
639 throw new StateError("Stream has already been listened to."); 639 throw new StateError("Stream has already been listened to.");
640 } 640 }
641 _ControllerSubscription subscription = 641 _ControllerSubscription subscription =
642 new _ControllerSubscription(this, onData, onError, onDone, 642 new _ControllerSubscription<T>(this, onData, onError, onDone,
643 cancelOnError); 643 cancelOnError);
644 644
645 _PendingEvents pendingEvents = _pendingEvents; 645 _PendingEvents pendingEvents = _pendingEvents;
646 _state |= _STATE_SUBSCRIBED; 646 _state |= _STATE_SUBSCRIBED;
647 if (_isAddingStream) { 647 if (_isAddingStream) {
648 _StreamControllerAddStreamState addState = _varData; 648 _StreamControllerAddStreamState addState = _varData;
649 addState.varData = subscription; 649 addState.varData = subscription;
650 addState.resume(); 650 addState.resume();
651 } else { 651 } else {
652 _varData = subscription; 652 _varData = subscription;
653 } 653 }
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 _StreamControllerAddStreamState(_StreamController controller, 907 _StreamControllerAddStreamState(_StreamController controller,
908 this.varData, 908 this.varData,
909 Stream source, 909 Stream source,
910 bool cancelOnError) 910 bool cancelOnError)
911 : super(controller, source, cancelOnError) { 911 : super(controller, source, cancelOnError) {
912 if (controller.isPaused) { 912 if (controller.isPaused) {
913 addSubscription.pause(); 913 addSubscription.pause();
914 } 914 }
915 } 915 }
916 } 916 }
OLDNEW
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | sdk/lib/async/stream_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698