| 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 $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 8 | 8 |
| 9 @DomName('IDBObjectStore.add') | 9 @DomName('IDBObjectStore.add') |
| 10 Future add(value, [key]) { | 10 Future add(value, [key]) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 request = $dom_put(value, key); | 62 request = $dom_put(value, key); |
| 63 } else { | 63 } else { |
| 64 request = $dom_put(value); | 64 request = $dom_put(value); |
| 65 } | 65 } |
| 66 return _completeRequest(request); | 66 return _completeRequest(request); |
| 67 } catch (e, stacktrace) { | 67 } catch (e, stacktrace) { |
| 68 return new Future.immediateError(e, stacktrace); | 68 return new Future.immediateError(e, stacktrace); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 @DomName('IDBObjectStore.getObject') | 72 @DomName('IDBObjectStore.get') |
| 73 Future getObject(key) { | 73 Future getObject(key) { |
| 74 try { | 74 try { |
| 75 var request = $dom_getObject(key); | 75 var request = $dom_get(key); |
| 76 | 76 |
| 77 return _completeRequest(request); | 77 return _completeRequest(request); |
| 78 } catch (e, stacktrace) { | 78 } catch (e, stacktrace) { |
| 79 return new Future.immediateError(e, stacktrace); | 79 return new Future.immediateError(e, stacktrace); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 /** | 83 /** |
| 84 * Creates a stream of cursors over the records in this object store. | 84 * Creates a stream of cursors over the records in this object store. |
| 85 * | 85 * |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } else { | 161 } else { |
| 162 controller.add(cursor); | 162 controller.add(cursor); |
| 163 if (autoAdvance == true && controller.hasSubscribers) { | 163 if (autoAdvance == true && controller.hasSubscribers) { |
| 164 cursor.next(); | 164 cursor.next(); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 }); | 167 }); |
| 168 return controller.stream; | 168 return controller.stream; |
| 169 } | 169 } |
| 170 } | 170 } |
| OLD | NEW |