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

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: 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
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 021a3ca53e198019a839085e18344c8c674afc6c..3c3799c99164f12b00a14e671c1b3c0604d5c239 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -5961,14 +5961,14 @@ class DialogElement extends Element native "HTMLDialogElement" {
// http://www.w3.org/TR/file-system-api/#the-directoryentry-interface
@Experimental
class DirectoryEntry extends Entry native "DirectoryEntry" {
-
+
/**
* Create a new directory with the specified `path`. If `exclusive` is true,
* the returned Future will complete with an error if a directory already
* exists with the specified `path`.
*/
Future<Entry> createDirectory(String path, {bool exclusive: false}) {
- return _getDirectory(path, options:
+ return _getDirectory(path, options:
{'create': true, 'exclusive': exclusive});
}
@@ -5989,7 +5989,7 @@ class DirectoryEntry extends Entry native "DirectoryEntry" {
Future<Entry> createFile(String path, {bool exclusive: false}) {
return _getFile(path, options: {'create': true, 'exclusive': exclusive});
}
-
+
/**
* Retrieve an already existing file entry. The returned future will
* result in an error if a file at `path` does not exist or if the item at
@@ -10630,7 +10630,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(
@@ -15384,18 +15384,18 @@ class Navigator native "Navigator" {
* document.body.append(video);
* });
*
- * The user can also pass in Maps to the audio or video parameters to specify
- * mandatory and optional constraints for the media stream. Not passing in a
- * map, but passing in `true` will provide a MediaStream with audio or
+ * The user can also pass in Maps to the audio or video parameters to specify
+ * mandatory and optional constraints for the media stream. Not passing in a
+ * map, but passing in `true` will provide a MediaStream with audio or
* video capabilities, but without any additional constraints. The particular
- * constraint names for audio and video are still in flux, but as of this
+ * constraint names for audio and video are still in flux, but as of this
* writing, here is an example providing more constraints.
*
* window.navigator.getUserMedia(
- * audio: true,
- * video: {'mandatory':
+ * audio: true,
+ * video: {'mandatory':
* { 'minAspectRatio': 1.333, 'maxAspectRatio': 1.334 },
- * 'optional':
+ * 'optional':
* [{ 'minFrameRate': 60 },
* { 'maxWidth': 640 }]
* });
@@ -16242,7 +16242,7 @@ class Notation extends Node native "Notation" {
@Experimental // experimental
class Notification extends EventTarget native "Notification" {
- factory Notification(String title, {String titleDir: null, String body: null,
+ factory Notification(String title, {String titleDir: null, String body: null,
String bodyDir: null, String tag: null, String iconUrl: null}) {
var parsedOptions = {};
@@ -17870,7 +17870,7 @@ class RtcIceCandidate native "RTCIceCandidate,mozRTCIceCandidate" {
// the unprefixed RTCIceCandidate in Firefox (currently both are defined,
// but one can't be used as a constructor).
var constructorName = JS('', 'window[#]',
- Device.isFirefox ? '${Device.propertyPrefix}RTCIceCandidate' :
+ Device.isFirefox ? '${Device.propertyPrefix}RTCIceCandidate' :
'RTCIceCandidate');
return JS('RtcIceCandidate', 'new #(#)', constructorName,
convertDartToNative_SerializedScriptValue(dictionary));
@@ -17935,7 +17935,7 @@ class RtcPeerConnection extends EventTarget native "RTCPeerConnection,mozRTCPeer
// Currently in Firefox some of the RTC elements are defined but throw an
// error unless the user has specifically enabled them in their
// about:config. So we have to construct an element to actually test if RTC
- // is supported at the given time.
+ // is supported at the given time.
try {
new RtcPeerConnection(
{"iceServers": [ {"url":"stun:localhost"}]});
@@ -18238,9 +18238,9 @@ class RtcSessionDescription native "RTCSessionDescription,mozRTCSessionDescripti
// the unprefixed RTCIceCandidate in Firefox (currently both are defined,
// but one can't be used as a constructor).
var constructorName = JS('', 'window[#]',
- Device.isFirefox ? '${Device.propertyPrefix}RTCSessionDescription' :
+ Device.isFirefox ? '${Device.propertyPrefix}RTCSessionDescription' :
'RTCSessionDescription');
- return JS('RtcSessionDescription',
+ return JS('RtcSessionDescription',
'new #(#)', constructorName,
convertDartToNative_SerializedScriptValue(dictionary));
}
@@ -19915,8 +19915,8 @@ class StorageInfo native "StorageInfo" {
Future<StorageInfoUsage> queryUsageAndQuota(int storageType) {
var completer = new Completer<StorageInfoUsage>();
_queryUsageAndQuota(storageType,
- (currentUsageInBytes, currentQuotaInBytes) {
- completer.complete(new StorageInfoUsage(currentUsageInBytes,
+ (currentUsageInBytes, currentQuotaInBytes) {
+ completer.complete(new StorageInfoUsage(currentUsageInBytes,
currentQuotaInBytes));
},
(error) { completer.completeError(error); });
@@ -19924,7 +19924,7 @@ class StorageInfo native "StorageInfo" {
}
}
-/**
+/**
* A simple container class for the two values that are returned from the
* futures in requestQuota and queryUsageAndQuota.
*/
@@ -20367,7 +20367,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;
}
@@ -23294,7 +23294,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);
@@ -25635,7 +25635,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';
@@ -25704,7 +25704,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);
@@ -26849,7 +26849,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) {
@@ -29260,7 +29261,7 @@ class FixedSizeListIterator<T> implements Iterator<T> {
final int _length; // Cache array length for faster access.
int _position;
T _current;
-
+
FixedSizeListIterator(List<T> array)
: _array = array,
_position = -1,

Powered by Google App Engine
This is Rietveld 408576698