| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
| 6 | 6 |
| 7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 8 /** | 8 /** |
| 9 * Checks to see if Indexed DB is supported on the current platform. | 9 * Checks to see if Indexed DB is supported on the current platform. |
| 10 */ | 10 */ |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 completer.completeError(e); | 64 completer.completeError(e); |
| 65 }); | 65 }); |
| 66 return completer.future; | 66 return completer.future; |
| 67 } catch (e, stacktrace) { | 67 } catch (e, stacktrace) { |
| 68 return new Future.error(e, stacktrace); | 68 return new Future.error(e, stacktrace); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 @DomName('IDBFactory.getDatabaseNames') | 72 @DomName('IDBFactory.getDatabaseNames') |
| 73 @SupportedBrowser(SupportedBrowser.CHROME) | 73 @SupportedBrowser(SupportedBrowser.CHROME) |
| 74 @Experimental | 74 @Experimental() |
| 75 Future<List<String>> getDatabaseNames() { | 75 Future<List<String>> getDatabaseNames() { |
| 76 try { | 76 try { |
| 77 var request = $dom_webkitGetDatabaseNames(); | 77 var request = $dom_webkitGetDatabaseNames(); |
| 78 | 78 |
| 79 return _completeRequest(request); | 79 return _completeRequest(request); |
| 80 } catch (e, stacktrace) { | 80 } catch (e, stacktrace) { |
| 81 return new Future.error(e, stacktrace); | 81 return new Future.error(e, stacktrace); |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 107 // TODO: make sure that completer.complete is synchronous as transactions | 107 // TODO: make sure that completer.complete is synchronous as transactions |
| 108 // may be committed if the result is not processed immediately. | 108 // may be committed if the result is not processed immediately. |
| 109 request.onSuccess.listen((e) { | 109 request.onSuccess.listen((e) { |
| 110 completer.complete(request.result); | 110 completer.complete(request.result); |
| 111 }); | 111 }); |
| 112 request.onError.listen((e) { | 112 request.onError.listen((e) { |
| 113 completer.completeError(e); | 113 completer.completeError(e); |
| 114 }); | 114 }); |
| 115 return completer.future; | 115 return completer.future; |
| 116 } | 116 } |
| OLD | NEW |