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

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

Issue 2762953003: More minor type improvements in dart:async. (Closed)
Patch Set: More fixes. Created 3 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
« 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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 // constructors in mixin superclasses. 785 // constructors in mixin superclasses.
786 786
787 class _AsyncStreamController<T> = _StreamController<T> 787 class _AsyncStreamController<T> = _StreamController<T>
788 with _AsyncStreamControllerDispatch<T>; 788 with _AsyncStreamControllerDispatch<T>;
789 789
790 class _SyncStreamController<T> = _StreamController<T> 790 class _SyncStreamController<T> = _StreamController<T>
791 with _SyncStreamControllerDispatch<T>; 791 with _SyncStreamControllerDispatch<T>;
792 792
793 typedef _NotificationHandler(); 793 typedef _NotificationHandler();
794 794
795 Future _runGuarded(_NotificationHandler notificationHandler) { 795 void _runGuarded(_NotificationHandler notificationHandler) {
796 if (notificationHandler == null) return null; 796 if (notificationHandler == null) return;
797 try { 797 try {
798 var result = notificationHandler(); 798 notificationHandler();
799 if (result is Future) return result;
800 return null;
801 } catch (e, s) { 799 } catch (e, s) {
802 Zone.current.handleUncaughtError(e, s); 800 Zone.current.handleUncaughtError(e, s);
803 } 801 }
804 } 802 }
805 803
806 class _ControllerStream<T> extends _StreamImpl<T> { 804 class _ControllerStream<T> extends _StreamImpl<T> {
807 _StreamControllerLifecycle<T> _controller; 805 _StreamControllerLifecycle<T> _controller;
808 806
809 _ControllerStream(this._controller); 807 _ControllerStream(this._controller);
810 808
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 var varData; 925 var varData;
928 926
929 _StreamControllerAddStreamState(_StreamController<T> controller, this.varData, 927 _StreamControllerAddStreamState(_StreamController<T> controller, this.varData,
930 Stream source, bool cancelOnError) 928 Stream source, bool cancelOnError)
931 : super(controller, source, cancelOnError) { 929 : super(controller, source, cancelOnError) {
932 if (controller.isPaused) { 930 if (controller.isPaused) {
933 addSubscription.pause(); 931 addSubscription.pause();
934 } 932 }
935 } 933 }
936 } 934 }
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