| 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: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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 Request $dom_webkitGetDatabaseNames() native; | 457 Request $dom_webkitGetDatabaseNames() native; |
| 458 | 458 |
| 459 } | 459 } |
| 460 | 460 |
| 461 | 461 |
| 462 /** | 462 /** |
| 463 * Ties a request to a completer, so the completer is completed when it succeeds | 463 * Ties a request to a completer, so the completer is completed when it succeeds |
| 464 * and errors out when the request errors. | 464 * and errors out when the request errors. |
| 465 */ | 465 */ |
| 466 Future _completeRequest(Request request) { | 466 Future _completeRequest(Request request) { |
| 467 var completer = new Completer(); | 467 var completer = new Completer.sync(); |
| 468 // TODO: make sure that completer.complete is synchronous as transactions | 468 // TODO: make sure that completer.complete is synchronous as transactions |
| 469 // may be committed if the result is not processed immediately. | 469 // may be committed if the result is not processed immediately. |
| 470 request.onSuccess.listen((e) { | 470 request.onSuccess.listen((e) { |
| 471 completer.complete(request.result); | 471 completer.complete(request.result); |
| 472 }); | 472 }); |
| 473 request.onError.listen((e) { | 473 request.onError.listen((e) { |
| 474 completer.completeError(e); | 474 completer.completeError(e); |
| 475 }); | 475 }); |
| 476 return completer.future; | 476 return completer.future; |
| 477 } | 477 } |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 } | 1239 } |
| 1240 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1240 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1241 // for details. All rights reserved. Use of this source code is governed by a | 1241 // for details. All rights reserved. Use of this source code is governed by a |
| 1242 // BSD-style license that can be found in the LICENSE file. | 1242 // BSD-style license that can be found in the LICENSE file. |
| 1243 | 1243 |
| 1244 | 1244 |
| 1245 @DocsEditable | 1245 @DocsEditable |
| 1246 @DomName('IDBAny') | 1246 @DomName('IDBAny') |
| 1247 abstract class _IDBAny native "IDBAny" { | 1247 abstract class _IDBAny native "IDBAny" { |
| 1248 } | 1248 } |
| OLD | NEW |