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

Unified Diff: sdk/lib/async/stream_impl.dart

Issue 25354003: Redo StreamTransformers so they work with Stack traces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | sdk/lib/async/stream_pipe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream_impl.dart
diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart
index 80a3d3941e02c9baeaac7d4548bd362ae40c51f1..483edbef000a386c3baf6ea84c63cfd4030a0241 100644
--- a/sdk/lib/async/stream_impl.dart
+++ b/sdk/lib/async/stream_impl.dart
@@ -36,6 +36,7 @@ abstract class _EventDispatch<T> {
*
* The user interface of [_BufferingStreamSubscription] are the following
* methods:
+ *
* * [_add]: Add a data event to the stream.
* * [_addError]: Add an error event to the stream.
* * [_close]: Request to close the stream.
@@ -43,6 +44,7 @@ abstract class _EventDispatch<T> {
* either due to being actively canceled, or after sending a done event.
* * [_onPause]: Called when the subscription wants the event source to pause.
* * [_onResume]: Called when allowing new events after a pause.
+ *
* The user should not add new events when the subscription requests a paused,
* but if it happens anyway, the subscription will enqueue the events just as
* when new events arrive while still firing an old event.
@@ -92,17 +94,14 @@ class _BufferingStreamSubscription<T> implements StreamSubscription<T>,
*/
_PendingEvents _pending;
- _BufferingStreamSubscription(void onData(T data),
- Function onError,
- void onDone(),
+ _BufferingStreamSubscription(void onDataHandler(T data),
+ Function onErrorHandler,
+ void onDoneHandler(),
bool cancelOnError)
- : _onData = Zone.current.registerUnaryCallback(onData),
- _onError = _registerErrorHandler(onError, Zone.current),
- _onDone = Zone.current.registerCallback(onDone),
- _state = (cancelOnError ? _STATE_CANCEL_ON_ERROR : 0) {
- assert(_onData != null);
- assert(_onError != null);
- assert(_onDone != null);
+ : _state = (cancelOnError ? _STATE_CANCEL_ON_ERROR : 0) {
+ onData(onDataHandler);
+ onError(onErrorHandler);
+ onDone(onDoneHandler);
}
/**
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | sdk/lib/async/stream_pipe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698