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

Side by Side Diff: sdk/lib/indexed_db/dart2js/indexed_db_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, 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
OLDNEW
1 library dart.dom.indexed_db; 1 library dart.dom.indexed_db;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:html'; 4 import 'dart:html';
5 import 'dart:html_common'; 5 import 'dart:html_common';
6 import 'dart:typed_data'; 6 import 'dart:typed_data';
7 import 'dart:_js_helper' show Creates, Returns, JSName, Null; 7 import 'dart:_js_helper' show Creates, Returns, JSName, Null;
8 import 'dart:_foreign_helper' show JS; 8 import 'dart:_foreign_helper' show JS;
9 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10 // for details. All rights reserved. Use of this source code is governed by a 10 // for details. All rights reserved. Use of this source code is governed by a
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 1009
1010 1010
1011 /** 1011 /**
1012 * Helper for iterating over cursors in a request. 1012 * Helper for iterating over cursors in a request.
1013 */ 1013 */
1014 static Stream<Cursor> _cursorStreamFromResult(Request request, 1014 static Stream<Cursor> _cursorStreamFromResult(Request request,
1015 bool autoAdvance) { 1015 bool autoAdvance) {
1016 // TODO: need to guarantee that the controller provides the values 1016 // TODO: need to guarantee that the controller provides the values
1017 // immediately as waiting until the next tick will cause the transaction to 1017 // immediately as waiting until the next tick will cause the transaction to
1018 // close. 1018 // close.
1019 var controller = new StreamController(); 1019 var controller = new StreamController(sync: true);
1020 1020
1021 request.onError.listen((e) { 1021 request.onError.listen((e) {
1022 //TODO: Report stacktrace once issue 4061 is resolved. 1022 //TODO: Report stacktrace once issue 4061 is resolved.
1023 controller.addError(e); 1023 controller.addError(e);
1024 }); 1024 });
1025 1025
1026 request.onSuccess.listen((e) { 1026 request.onSuccess.listen((e) {
1027 Cursor cursor = request.result; 1027 Cursor cursor = request.result;
1028 if (cursor == null) { 1028 if (cursor == null) {
1029 controller.close(); 1029 controller.close();
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1258 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1259 // for details. All rights reserved. Use of this source code is governed by a 1259 // for details. All rights reserved. Use of this source code is governed by a
1260 // BSD-style license that can be found in the LICENSE file. 1260 // BSD-style license that can be found in the LICENSE file.
1261 1261
1262 1262
1263 @DocsEditable 1263 @DocsEditable
1264 @DomName('IDBAny') 1264 @DomName('IDBAny')
1265 @deprecated // nonstandard 1265 @deprecated // nonstandard
1266 abstract class _IDBAny native "IDBAny" { 1266 abstract class _IDBAny native "IDBAny" {
1267 } 1267 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/indexed_db/dartium/indexed_db_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698