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

Unified Diff: tools/dom/src/EventStreamProvider.dart

Issue 3014593002: Use generic functions in zones. (Closed)
Patch Set: Added changes missing from patch set #2 Created 3 years, 3 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 | « tests/lib_strong/mirrors/invocation_fuzz_test.dart ('k') | tools/dom/src/shared_html.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/EventStreamProvider.dart
diff --git a/tools/dom/src/EventStreamProvider.dart b/tools/dom/src/EventStreamProvider.dart
index c5e929c8d17fba4ce5b87db5e2a0f7db455ede09..bb24647e458785839976dd312e7dcf178a72dce4 100644
--- a/tools/dom/src/EventStreamProvider.dart
+++ b/tools/dom/src/EventStreamProvider.dart
@@ -225,9 +225,9 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
// TODO(leafp): It would be better to write this as
// _onData = onData == null ? null :
- // onData is _wrapZoneCallback<Event, dynamic>
- // ? _wrapZone/*<Event, dynamic>*/(onData)
- // : _wrapZone/*<Event, dynamic>*/((e) => onData(e as T))
+ // onData is void Function(Event)
+ // ? _wrapZone<Event>(onData)
+ // : _wrapZone<Event>((e) => onData(e as T))
// In order to support existing tests which pass the wrong type of events but
// use a more general listener, without causing as much slowdown for things
// which are typed correctly. But this currently runs afoul of restrictions
@@ -236,7 +236,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
this._target, this._eventType, void onData(T event), this._useCapture)
: _onData = onData == null
? null
- : _wrapZone<Event, dynamic>((e) => (onData as dynamic)(e)) {
+ : _wrapZone<Event>((e) => (onData as dynamic)(e)) {
_tryResume();
}
@@ -258,7 +258,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
}
// Remove current event listener.
_unlisten();
- _onData = _wrapZone/*<Event, dynamic>*/(handleData);
+ _onData = _wrapZone<Event>(handleData);
_tryResume();
}
« no previous file with comments | « tests/lib_strong/mirrors/invocation_fuzz_test.dart ('k') | tools/dom/src/shared_html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698