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

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 17490002: Make asBroadcastStream take two callbacks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reintroduce zone. 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 | « sdk/lib/async/stream_impl.dart ('k') | sdk/lib/html/dartium/html_dartium.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 /// The Dart HTML library. 1 /// The Dart HTML library.
2 library dart.dom.html; 2 library dart.dom.html;
3 3
4 import 'dart:async'; 4 import 'dart:async';
5 import 'dart:collection'; 5 import 'dart:collection';
6 import 'dart:_collection-dev' hide Symbol; 6 import 'dart:_collection-dev' hide Symbol;
7 import 'dart:html_common'; 7 import 'dart:html_common';
8 import 'dart:indexed_db'; 8 import 'dart:indexed_db';
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 import 'dart:json' as json; 10 import 'dart:json' as json;
(...skipping 26048 matching lines...) Expand 10 before | Expand all | Expand 10 after
26059 * Adapter for exposing DOM events as Dart streams. 26059 * Adapter for exposing DOM events as Dart streams.
26060 */ 26060 */
26061 class _EventStream<T extends Event> extends Stream<T> { 26061 class _EventStream<T extends Event> extends Stream<T> {
26062 final EventTarget _target; 26062 final EventTarget _target;
26063 final String _eventType; 26063 final String _eventType;
26064 final bool _useCapture; 26064 final bool _useCapture;
26065 26065
26066 _EventStream(this._target, this._eventType, this._useCapture); 26066 _EventStream(this._target, this._eventType, this._useCapture);
26067 26067
26068 // DOM events are inherently multi-subscribers. 26068 // DOM events are inherently multi-subscribers.
26069 Stream<T> asBroadcastStream() => this; 26069 Stream<T> asBroadcastStream({void onListen(StreamSubscription subscription),
26070 void onCancel(StreamSubscription subscription)})
26071 => this;
26070 bool get isBroadcast => true; 26072 bool get isBroadcast => true;
26071 26073
26072 StreamSubscription<T> listen(void onData(T event), 26074 StreamSubscription<T> listen(void onData(T event),
26073 { void onError(error), 26075 { void onError(error),
26074 void onDone(), 26076 void onDone(),
26075 bool cancelOnError}) { 26077 bool cancelOnError}) {
26076 26078
26077 return new _EventStreamSubscription<T>( 26079 return new _EventStreamSubscription<T>(
26078 this._target, this._eventType, onData, this._useCapture); 26080 this._target, this._eventType, onData, this._useCapture);
26079 } 26081 }
(...skipping 3517 matching lines...) Expand 10 before | Expand all | Expand 10 after
29597 _position = nextPosition; 29599 _position = nextPosition;
29598 return true; 29600 return true;
29599 } 29601 }
29600 _current = null; 29602 _current = null;
29601 _position = _array.length; 29603 _position = _array.length;
29602 return false; 29604 return false;
29603 } 29605 }
29604 29606
29605 T get current => _current; 29607 T get current => _current;
29606 } 29608 }
OLDNEW
« no previous file with comments | « sdk/lib/async/stream_impl.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698