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

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

Issue 15864007: Add zone support to streams. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 7 years, 6 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 | sdk/lib/async/stream_impl.dart » ('j') | sdk/lib/async/stream_impl.dart » ('J')
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 } 271 }
272 272
273 typedef void _NotificationHandler(); 273 typedef void _NotificationHandler();
274 274
275 void _runGuarded(_NotificationHandler notificationHandler) { 275 void _runGuarded(_NotificationHandler notificationHandler) {
276 if (notificationHandler == null) return; 276 if (notificationHandler == null) return;
277 try { 277 try {
278 notificationHandler(); 278 notificationHandler();
279 } catch (e, s) { 279 } catch (e, s) {
280 _throwDelayed(e, s); 280 _Zone.current.handleUncaughtError(_asyncError(e, s));
281 } 281 }
282 } 282 }
283 283
284 class _ControllerStream<T> extends _StreamImpl<T> { 284 class _ControllerStream<T> extends _StreamImpl<T> {
285 _StreamControllerLifecycle<T> _controller; 285 _StreamControllerLifecycle<T> _controller;
286 bool _hasListener = false; 286 bool _hasListener = false;
287 287
288 _ControllerStream(this._controller); 288 _ControllerStream(this._controller);
289 289
290 StreamSubscription<T> _createSubscription( 290 StreamSubscription<T> _createSubscription(
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 link = subscription._next; 547 link = subscription._next;
548 } 548 }
549 } 549 }
550 _state &= ~_STATE_FIRING; 550 _state &= ~_STATE_FIRING;
551 551
552 if (_isEmpty) { 552 if (_isEmpty) {
553 _runGuarded(_onCancel); 553 _runGuarded(_onCancel);
554 } 554 }
555 } 555 }
556 } 556 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/async/stream_impl.dart » ('j') | sdk/lib/async/stream_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698