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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 16125005: Make new StreamController be async by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments Created 7 years, 7 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_impl.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 4b3d05e2d0acc96ee77eaf5c51b858c916a58df3..084abb2705f430bc1543e2cd9d2768b2f1bbcfe4 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -10648,7 +10648,7 @@ class Geolocation native "Geolocation" {
int watchId;
var controller;
- controller = new StreamController<Geoposition>(
+ controller = new StreamController<Geoposition>(sync: true,
onListen: () {
assert(watchId == null);
watchId = $dom_watchPosition(
@@ -20386,7 +20386,7 @@ class TemplateElement extends Element native "HTMLTemplateElement" {
@Experimental
static Stream<DocumentFragment> get instanceCreated {
if (_instanceCreated == null) {
- _instanceCreated = new StreamController<DocumentFragment>();
+ _instanceCreated = new StreamController<DocumentFragment>(sync: true);
}
return _instanceCreated.stream;
}
@@ -23312,7 +23312,7 @@ class _BeforeUnloadEventStreamProvider implements
const _BeforeUnloadEventStreamProvider(this._eventType);
Stream<BeforeUnloadEvent> forTarget(EventTarget e, {bool useCapture: false}) {
- var controller = new StreamController();
+ var controller = new StreamController(sync: true);
var stream = new _EventStream(e, _eventType, useCapture);
stream.listen((event) {
var wrapped = new _BeforeUnloadEvent(event);
@@ -25684,7 +25684,7 @@ class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> {
static final int _ROMAN_ALPHABET_OFFSET = "a".codeUnits[0] - "A".codeUnits[0];
/** Controller to produce KeyEvents for the stream. */
- final StreamController _controller = new StreamController();
+ final StreamController _controller = new StreamController(sync: true);
static const _EVENT_TYPE = 'KeyEvent';
@@ -25753,7 +25753,7 @@ class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> {
* Hook up all event listeners under the covers so we can estimate keycodes
* and charcodes when they are not provided.
*/
- _KeyboardEventHandler.initializeAllEventListeners(this._type, this._target) :
+ _KeyboardEventHandler.initializeAllEventListeners(this._type, this._target) :
super(_EVENT_TYPE) {
Element.keyDownEvent.forTarget(_target, useCapture: true).listen(
processKeyDown);
@@ -26898,7 +26898,8 @@ class PathObserver {
// TODO(jmesserly): if the path is empty, or the object is! Observable, we
// can optimize the PathObserver to be more lightweight.
- _values = new StreamController.broadcast(onListen: _observe,
+ _values = new StreamController.broadcast(sync: true,
+ onListen: _observe,
onCancel: _unobserve);
if (_isValid) {
« 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