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

Side by Side Diff: sdk/lib/indexed_db/dartium/indexed_db_dartium.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
« no previous file with comments | « sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart ('k') | sdk/lib/io/directory_impl.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 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:nativewrappers'; 6 import 'dart:nativewrappers';
7 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 7 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
8 // for details. All rights reserved. Use of this source code is governed by a 8 // for details. All rights reserved. Use of this source code is governed by a
9 // BSD-style license that can be found in the LICENSE file. 9 // BSD-style license that can be found in the LICENSE file.
10 10
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 870
871 871
872 /** 872 /**
873 * Helper for iterating over cursors in a request. 873 * Helper for iterating over cursors in a request.
874 */ 874 */
875 static Stream<Cursor> _cursorStreamFromResult(Request request, 875 static Stream<Cursor> _cursorStreamFromResult(Request request,
876 bool autoAdvance) { 876 bool autoAdvance) {
877 // TODO: need to guarantee that the controller provides the values 877 // TODO: need to guarantee that the controller provides the values
878 // immediately as waiting until the next tick will cause the transaction to 878 // immediately as waiting until the next tick will cause the transaction to
879 // close. 879 // close.
880 var controller = new StreamController(); 880 var controller = new StreamController(sync: true);
881 881
882 request.onError.listen((e) { 882 request.onError.listen((e) {
883 //TODO: Report stacktrace once issue 4061 is resolved. 883 //TODO: Report stacktrace once issue 4061 is resolved.
884 controller.addError(e); 884 controller.addError(e);
885 }); 885 });
886 886
887 request.onSuccess.listen((e) { 887 request.onSuccess.listen((e) {
888 Cursor cursor = request.result; 888 Cursor cursor = request.result;
889 if (cursor == null) { 889 if (cursor == null) {
890 controller.close(); 890 controller.close();
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 // WARNING: Do not edit - generated code. 1126 // WARNING: Do not edit - generated code.
1127 1127
1128 1128
1129 @DocsEditable 1129 @DocsEditable
1130 @DomName('IDBAny') 1130 @DomName('IDBAny')
1131 @deprecated // nonstandard 1131 @deprecated // nonstandard
1132 abstract class _IDBAny extends NativeFieldWrapperClass1 { 1132 abstract class _IDBAny extends NativeFieldWrapperClass1 {
1133 _IDBAny.internal(); 1133 _IDBAny.internal();
1134 1134
1135 } 1135 }
OLDNEW
« no previous file with comments | « sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart ('k') | sdk/lib/io/directory_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698