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

Unified Diff: client/html/src/EventTargetWrappingImplementation.dart

Issue 8363040: Implement measurement using futures (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove duplicated imports from html.dart Created 9 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 | « client/html/src/ElementWrappingImplementation.dart ('k') | client/html/src/Measurement.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/html/src/EventTargetWrappingImplementation.dart
diff --git a/client/html/src/EventTargetWrappingImplementation.dart b/client/html/src/EventTargetWrappingImplementation.dart
index 577925bce047d4edf3812682771c911675637beb..654bc69fceb79a192ed67ba368ef0ab422056c33 100644
--- a/client/html/src/EventTargetWrappingImplementation.dart
+++ b/client/html/src/EventTargetWrappingImplementation.dart
@@ -2,17 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-class _ListenerWrapper {
- final EventListener raw;
- final Function wrapped;
- final String type;
- final bool useCapture;
-
- _ListenerWrapper(this.raw, this.wrapped, this.type, this.useCapture);
-}
-
class EventsImplementation implements Events {
- /* raw event target. */
+ /* Raw event target. */
var _ptr;
Map<String, EventListenerList> _listenerMap;
@@ -58,7 +49,8 @@ class EventListenerListImplementation implements EventListenerList {
}
bool dispatch(Event evt) {
- // TODO(jacobr): what is the correct behavior here?
+ // TODO(jacobr): what is the correct behavior here. We could alternately
+ // force the event to have the expected type.
assert(evt.type == _type);
return _ptr.dispatchEvent(LevelDom.unwrap(evt));
}
@@ -82,8 +74,7 @@ class EventListenerListImplementation implements EventListenerList {
}
for (int i = 0; i < _wrappers.length; i++) {
_EventListenerWrapper wrapper = _wrappers[i];
- if (wrapper.raw === listener
- && wrapper.useCapture == useCapture) {
+ if (wrapper.raw === listener && wrapper.useCapture == useCapture) {
// Order doesn't matter so we swap with the last element instead of
// performing a more expensive remove from the middle of the list.
if (i + 1 != _wrappers.length) {
@@ -107,7 +98,7 @@ class EventListenerListImplementation implements EventListenerList {
}
}
}
- final wrapped = (e) => listener(LevelDom.wrapEvent(e));
+ final wrapped = (e) { listener(LevelDom.wrapEvent(e)); };
_wrappers.add(new _EventListenerWrapper(listener, wrapped, useCapture));
return wrapped;
}
« no previous file with comments | « client/html/src/ElementWrappingImplementation.dart ('k') | client/html/src/Measurement.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698