| OLD | NEW |
| 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:_js_helper' show Creates, Returns, JSName, Null; | 6 import 'dart:_js_helper' show Creates, Returns, JSName, Null; |
| 7 import 'dart:_foreign_helper' show JS; | 7 import 'dart:_foreign_helper' show JS; |
| 8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 9 // for details. All rights reserved. Use of this source code is governed by a | 9 // for details. All rights reserved. Use of this source code is governed by a |
| 10 // BSD-style license that can be found in the LICENSE file. | 10 // BSD-style license that can be found in the LICENSE file. |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 | 773 |
| 774 | 774 |
| 775 /** | 775 /** |
| 776 * Helper for iterating over cursors in a request. | 776 * Helper for iterating over cursors in a request. |
| 777 */ | 777 */ |
| 778 static Stream<Cursor> _cursorStreamFromResult(Request request, | 778 static Stream<Cursor> _cursorStreamFromResult(Request request, |
| 779 bool autoAdvance) { | 779 bool autoAdvance) { |
| 780 // TODO: need to guarantee that the controller provides the values | 780 // TODO: need to guarantee that the controller provides the values |
| 781 // immediately as waiting until the next tick will cause the transaction to | 781 // immediately as waiting until the next tick will cause the transaction to |
| 782 // close. | 782 // close. |
| 783 var controller = new StreamController<Cursor>(); | 783 var controller = new StreamController(); |
| 784 | 784 |
| 785 request.onError.listen((e) { | 785 request.onError.listen((e) { |
| 786 //TODO: Report stacktrace once issue 4061 is resolved. | 786 //TODO: Report stacktrace once issue 4061 is resolved. |
| 787 controller.signalError(e); | 787 controller.signalError(e); |
| 788 }); | 788 }); |
| 789 | 789 |
| 790 request.onSuccess.listen((e) { | 790 request.onSuccess.listen((e) { |
| 791 Cursor cursor = request.result; | 791 Cursor cursor = request.result; |
| 792 if (cursor == null) { | 792 if (cursor == null) { |
| 793 controller.close(); | 793 controller.close(); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 } | 1017 } |
| 1018 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1018 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1019 // for details. All rights reserved. Use of this source code is governed by a | 1019 // for details. All rights reserved. Use of this source code is governed by a |
| 1020 // BSD-style license that can be found in the LICENSE file. | 1020 // BSD-style license that can be found in the LICENSE file. |
| 1021 | 1021 |
| 1022 | 1022 |
| 1023 @DocsEditable | 1023 @DocsEditable |
| 1024 @DomName('IDBAny') | 1024 @DomName('IDBAny') |
| 1025 class _IDBAny native "*IDBAny" { | 1025 class _IDBAny native "*IDBAny" { |
| 1026 } | 1026 } |
| OLD | NEW |