| 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: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 21 matching lines...) Expand all Loading... |
| 32 /*IDBKey*/ lower, /*IDBKey*/ upper, | 32 /*IDBKey*/ lower, /*IDBKey*/ upper, |
| 33 [bool lowerOpen = false, bool upperOpen = false]) => | 33 [bool lowerOpen = false, bool upperOpen = false]) => |
| 34 KeyRange.bound_(lower, upper, lowerOpen, upperOpen); | 34 KeyRange.bound_(lower, upper, lowerOpen, upperOpen); |
| 35 } | 35 } |
| 36 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 36 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 37 // for details. All rights reserved. Use of this source code is governed by a | 37 // for details. All rights reserved. Use of this source code is governed by a |
| 38 // BSD-style license that can be found in the LICENSE file. | 38 // BSD-style license that can be found in the LICENSE file. |
| 39 | 39 |
| 40 | 40 |
| 41 @DomName('IDBCursor') | 41 @DomName('IDBCursor') |
| 42 @Unstable | 42 @Unstable() |
| 43 class Cursor extends NativeFieldWrapperClass1 { | 43 class Cursor extends NativeFieldWrapperClass1 { |
| 44 @DomName('IDBCursor.delete') | 44 @DomName('IDBCursor.delete') |
| 45 Future delete() { | 45 Future delete() { |
| 46 try { | 46 try { |
| 47 return _completeRequest($dom_delete()); | 47 return _completeRequest($dom_delete()); |
| 48 } catch (e, stacktrace) { | 48 } catch (e, stacktrace) { |
| 49 return new Future.error(e, stacktrace); | 49 return new Future.error(e, stacktrace); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 @DomName('IDBCursor.value') | 53 @DomName('IDBCursor.value') |
| 54 Future update(value) { | 54 Future update(value) { |
| 55 try { | 55 try { |
| 56 return _completeRequest($dom_update(value)); | 56 return _completeRequest($dom_update(value)); |
| 57 } catch (e, stacktrace) { | 57 } catch (e, stacktrace) { |
| 58 return new Future.error(e, stacktrace); | 58 return new Future.error(e, stacktrace); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 | 62 |
| 63 @DomName('IDBCursor.direction') | 63 @DomName('IDBCursor.direction') |
| 64 @DocsEditable | 64 @DocsEditable() |
| 65 String get direction native "IDBCursor_direction_Getter"; | 65 String get direction native "IDBCursor_direction_Getter"; |
| 66 | 66 |
| 67 @DomName('IDBCursor.key') | 67 @DomName('IDBCursor.key') |
| 68 @DocsEditable | 68 @DocsEditable() |
| 69 Object get key native "IDBCursor_key_Getter"; | 69 Object get key native "IDBCursor_key_Getter"; |
| 70 | 70 |
| 71 @DomName('IDBCursor.primaryKey') | 71 @DomName('IDBCursor.primaryKey') |
| 72 @DocsEditable | 72 @DocsEditable() |
| 73 Object get primaryKey native "IDBCursor_primaryKey_Getter"; | 73 Object get primaryKey native "IDBCursor_primaryKey_Getter"; |
| 74 | 74 |
| 75 @DomName('IDBCursor.source') | 75 @DomName('IDBCursor.source') |
| 76 @DocsEditable | 76 @DocsEditable() |
| 77 dynamic get source native "IDBCursor_source_Getter"; | 77 dynamic get source native "IDBCursor_source_Getter"; |
| 78 | 78 |
| 79 @DomName('IDBCursor.advance') | 79 @DomName('IDBCursor.advance') |
| 80 @DocsEditable | 80 @DocsEditable() |
| 81 void advance(int count) native "IDBCursor_advance_Callback"; | 81 void advance(int count) native "IDBCursor_advance_Callback"; |
| 82 | 82 |
| 83 @DomName('IDBCursor.delete') | 83 @DomName('IDBCursor.delete') |
| 84 @DocsEditable | 84 @DocsEditable() |
| 85 Request $dom_delete() native "IDBCursor_delete_Callback"; | 85 Request $dom_delete() native "IDBCursor_delete_Callback"; |
| 86 | 86 |
| 87 @DomName('IDBCursor.next') | 87 @DomName('IDBCursor.next') |
| 88 @DocsEditable | 88 @DocsEditable() |
| 89 @Experimental // non-standard | 89 @Experimental() // non-standard |
| 90 void next([Object key]) native "IDBCursor_next_Callback"; | 90 void next([Object key]) native "IDBCursor_next_Callback"; |
| 91 | 91 |
| 92 @DomName('IDBCursor.update') | 92 @DomName('IDBCursor.update') |
| 93 @DocsEditable | 93 @DocsEditable() |
| 94 Request $dom_update(Object value) native "IDBCursor_update_Callback"; | 94 Request $dom_update(Object value) native "IDBCursor_update_Callback"; |
| 95 | 95 |
| 96 } | 96 } |
| 97 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 97 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 98 // for details. All rights reserved. Use of this source code is governed by a | 98 // for details. All rights reserved. Use of this source code is governed by a |
| 99 // BSD-style license that can be found in the LICENSE file. | 99 // BSD-style license that can be found in the LICENSE file. |
| 100 | 100 |
| 101 // WARNING: Do not edit - generated code. | 101 // WARNING: Do not edit - generated code. |
| 102 | 102 |
| 103 | 103 |
| 104 @DocsEditable | 104 @DocsEditable() |
| 105 @DomName('IDBCursorWithValue') | 105 @DomName('IDBCursorWithValue') |
| 106 @Unstable | 106 @Unstable() |
| 107 class CursorWithValue extends Cursor { | 107 class CursorWithValue extends Cursor { |
| 108 // To suppress missing implicit constructor warnings. | 108 // To suppress missing implicit constructor warnings. |
| 109 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); } | 109 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); } |
| 110 | 110 |
| 111 @DomName('IDBCursorWithValue.value') | 111 @DomName('IDBCursorWithValue.value') |
| 112 @DocsEditable | 112 @DocsEditable() |
| 113 Object get value native "IDBCursorWithValue_value_Getter"; | 113 Object get value native "IDBCursorWithValue_value_Getter"; |
| 114 | 114 |
| 115 } | 115 } |
| 116 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 116 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 117 // for details. All rights reserved. Use of this source code is governed by a | 117 // for details. All rights reserved. Use of this source code is governed by a |
| 118 // BSD-style license that can be found in the LICENSE file. | 118 // BSD-style license that can be found in the LICENSE file. |
| 119 | 119 |
| 120 | 120 |
| 121 @DocsEditable | 121 @DocsEditable() |
| 122 @DomName('IDBDatabase') | 122 @DomName('IDBDatabase') |
| 123 @SupportedBrowser(SupportedBrowser.CHROME) | 123 @SupportedBrowser(SupportedBrowser.CHROME) |
| 124 @SupportedBrowser(SupportedBrowser.FIREFOX, '15') | 124 @SupportedBrowser(SupportedBrowser.FIREFOX, '15') |
| 125 @SupportedBrowser(SupportedBrowser.IE, '10') | 125 @SupportedBrowser(SupportedBrowser.IE, '10') |
| 126 @Experimental | 126 @Experimental() |
| 127 @Unstable | 127 @Unstable() |
| 128 class Database extends EventTarget { | 128 class Database extends EventTarget { |
| 129 @DomName('IDBDatabase.createObjectStore') | 129 @DomName('IDBDatabase.createObjectStore') |
| 130 @DocsEditable | 130 @DocsEditable() |
| 131 ObjectStore createObjectStore(String name, | 131 ObjectStore createObjectStore(String name, |
| 132 {String keyPath, bool autoIncrement}) { | 132 {String keyPath, bool autoIncrement}) { |
| 133 var options = {}; | 133 var options = {}; |
| 134 if (keyPath != null) { | 134 if (keyPath != null) { |
| 135 options['keyPath'] = keyPath; | 135 options['keyPath'] = keyPath; |
| 136 } | 136 } |
| 137 if (autoIncrement != null) { | 137 if (autoIncrement != null) { |
| 138 options['autoIncrement'] = autoIncrement; | 138 options['autoIncrement'] = autoIncrement; |
| 139 } | 139 } |
| 140 | 140 |
| 141 return $dom_createObjectStore(name, options); | 141 return $dom_createObjectStore(name, options); |
| 142 } | 142 } |
| 143 | 143 |
| 144 | 144 |
| 145 // To suppress missing implicit constructor warnings. | 145 // To suppress missing implicit constructor warnings. |
| 146 factory Database._() { throw new UnsupportedError("Not supported"); } | 146 factory Database._() { throw new UnsupportedError("Not supported"); } |
| 147 | 147 |
| 148 @DomName('IDBDatabase.abortEvent') | 148 @DomName('IDBDatabase.abortEvent') |
| 149 @DocsEditable | 149 @DocsEditable() |
| 150 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); | 150 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); |
| 151 | 151 |
| 152 @DomName('IDBDatabase.errorEvent') | 152 @DomName('IDBDatabase.errorEvent') |
| 153 @DocsEditable | 153 @DocsEditable() |
| 154 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); | 154 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); |
| 155 | 155 |
| 156 @DomName('IDBDatabase.versionchangeEvent') | 156 @DomName('IDBDatabase.versionchangeEvent') |
| 157 @DocsEditable | 157 @DocsEditable() |
| 158 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons
t EventStreamProvider<VersionChangeEvent>('versionchange'); | 158 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons
t EventStreamProvider<VersionChangeEvent>('versionchange'); |
| 159 | 159 |
| 160 @DomName('IDBDatabase.name') | 160 @DomName('IDBDatabase.name') |
| 161 @DocsEditable | 161 @DocsEditable() |
| 162 String get name native "IDBDatabase_name_Getter"; | 162 String get name native "IDBDatabase_name_Getter"; |
| 163 | 163 |
| 164 @DomName('IDBDatabase.objectStoreNames') | 164 @DomName('IDBDatabase.objectStoreNames') |
| 165 @DocsEditable | 165 @DocsEditable() |
| 166 List<String> get objectStoreNames native "IDBDatabase_objectStoreNames_Getter"
; | 166 List<String> get objectStoreNames native "IDBDatabase_objectStoreNames_Getter"
; |
| 167 | 167 |
| 168 @DomName('IDBDatabase.version') | 168 @DomName('IDBDatabase.version') |
| 169 @DocsEditable | 169 @DocsEditable() |
| 170 dynamic get version native "IDBDatabase_version_Getter"; | 170 dynamic get version native "IDBDatabase_version_Getter"; |
| 171 | 171 |
| 172 @DomName('IDBDatabase.addEventListener') | 172 @DomName('IDBDatabase.addEventListener') |
| 173 @DocsEditable | 173 @DocsEditable() |
| 174 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "IDBDatabase_addEventListener_Callback"; | 174 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "IDBDatabase_addEventListener_Callback"; |
| 175 | 175 |
| 176 @DomName('IDBDatabase.close') | 176 @DomName('IDBDatabase.close') |
| 177 @DocsEditable | 177 @DocsEditable() |
| 178 void close() native "IDBDatabase_close_Callback"; | 178 void close() native "IDBDatabase_close_Callback"; |
| 179 | 179 |
| 180 @DomName('IDBDatabase.createObjectStore') | 180 @DomName('IDBDatabase.createObjectStore') |
| 181 @DocsEditable | 181 @DocsEditable() |
| 182 ObjectStore $dom_createObjectStore(String name, [Map options]) native "IDBData
base_createObjectStore_Callback"; | 182 ObjectStore $dom_createObjectStore(String name, [Map options]) native "IDBData
base_createObjectStore_Callback"; |
| 183 | 183 |
| 184 @DomName('IDBDatabase.deleteObjectStore') | 184 @DomName('IDBDatabase.deleteObjectStore') |
| 185 @DocsEditable | 185 @DocsEditable() |
| 186 void deleteObjectStore(String name) native "IDBDatabase_deleteObjectStore_Call
back"; | 186 void deleteObjectStore(String name) native "IDBDatabase_deleteObjectStore_Call
back"; |
| 187 | 187 |
| 188 @DomName('IDBDatabase.dispatchEvent') | 188 @DomName('IDBDatabase.dispatchEvent') |
| 189 @DocsEditable | 189 @DocsEditable() |
| 190 bool dispatchEvent(Event evt) native "IDBDatabase_dispatchEvent_Callback"; | 190 bool dispatchEvent(Event evt) native "IDBDatabase_dispatchEvent_Callback"; |
| 191 | 191 |
| 192 @DomName('IDBDatabase.removeEventListener') | 192 @DomName('IDBDatabase.removeEventListener') |
| 193 @DocsEditable | 193 @DocsEditable() |
| 194 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBDatabase_removeEventListener_Callback"; | 194 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBDatabase_removeEventListener_Callback"; |
| 195 | 195 |
| 196 Transaction transaction(storeName_OR_storeNames, String mode) { | 196 Transaction transaction(storeName_OR_storeNames, String mode) { |
| 197 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str
ing> || storeName_OR_storeNames == null)) { | 197 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str
ing> || storeName_OR_storeNames == null)) { |
| 198 return _transaction_1(storeName_OR_storeNames, mode); | 198 return _transaction_1(storeName_OR_storeNames, mode); |
| 199 } | 199 } |
| 200 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str
ing> || storeName_OR_storeNames == null)) { | 200 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str
ing> || storeName_OR_storeNames == null)) { |
| 201 return _transaction_2(storeName_OR_storeNames, mode); | 201 return _transaction_2(storeName_OR_storeNames, mode); |
| 202 } | 202 } |
| 203 if ((mode is String || mode == null) && (storeName_OR_storeNames is String |
| storeName_OR_storeNames == null)) { | 203 if ((mode is String || mode == null) && (storeName_OR_storeNames is String |
| storeName_OR_storeNames == null)) { |
| 204 return _transaction_3(storeName_OR_storeNames, mode); | 204 return _transaction_3(storeName_OR_storeNames, mode); |
| 205 } | 205 } |
| 206 throw new ArgumentError("Incorrect number or type of arguments"); | 206 throw new ArgumentError("Incorrect number or type of arguments"); |
| 207 } | 207 } |
| 208 | 208 |
| 209 Transaction _transaction_1(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_1_Callback"; | 209 Transaction _transaction_1(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_1_Callback"; |
| 210 | 210 |
| 211 Transaction _transaction_2(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_2_Callback"; | 211 Transaction _transaction_2(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_2_Callback"; |
| 212 | 212 |
| 213 Transaction _transaction_3(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_3_Callback"; | 213 Transaction _transaction_3(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_3_Callback"; |
| 214 | 214 |
| 215 @DomName('IDBDatabase.onabort') | 215 @DomName('IDBDatabase.onabort') |
| 216 @DocsEditable | 216 @DocsEditable() |
| 217 Stream<Event> get onAbort => abortEvent.forTarget(this); | 217 Stream<Event> get onAbort => abortEvent.forTarget(this); |
| 218 | 218 |
| 219 @DomName('IDBDatabase.onerror') | 219 @DomName('IDBDatabase.onerror') |
| 220 @DocsEditable | 220 @DocsEditable() |
| 221 Stream<Event> get onError => errorEvent.forTarget(this); | 221 Stream<Event> get onError => errorEvent.forTarget(this); |
| 222 | 222 |
| 223 @DomName('IDBDatabase.onversionchange') | 223 @DomName('IDBDatabase.onversionchange') |
| 224 @DocsEditable | 224 @DocsEditable() |
| 225 Stream<VersionChangeEvent> get onVersionChange => versionChangeEvent.forTarget
(this); | 225 Stream<VersionChangeEvent> get onVersionChange => versionChangeEvent.forTarget
(this); |
| 226 } | 226 } |
| 227 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 227 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 228 // for details. All rights reserved. Use of this source code is governed by a | 228 // for details. All rights reserved. Use of this source code is governed by a |
| 229 // BSD-style license that can be found in the LICENSE file. | 229 // BSD-style license that can be found in the LICENSE file. |
| 230 | 230 |
| 231 | 231 |
| 232 @DomName('IDBFactory') | 232 @DomName('IDBFactory') |
| 233 @SupportedBrowser(SupportedBrowser.CHROME) | 233 @SupportedBrowser(SupportedBrowser.CHROME) |
| 234 @SupportedBrowser(SupportedBrowser.FIREFOX, '15') | 234 @SupportedBrowser(SupportedBrowser.FIREFOX, '15') |
| 235 @SupportedBrowser(SupportedBrowser.IE, '10') | 235 @SupportedBrowser(SupportedBrowser.IE, '10') |
| 236 @Experimental | 236 @Experimental() |
| 237 @Unstable | 237 @Unstable() |
| 238 class IdbFactory extends NativeFieldWrapperClass1 { | 238 class IdbFactory extends NativeFieldWrapperClass1 { |
| 239 /** | 239 /** |
| 240 * Checks to see if Indexed DB is supported on the current platform. | 240 * Checks to see if Indexed DB is supported on the current platform. |
| 241 */ | 241 */ |
| 242 static bool get supported { | 242 static bool get supported { |
| 243 return true; | 243 return true; |
| 244 } | 244 } |
| 245 | 245 |
| 246 @DomName('IDBFactory.open') | 246 @DomName('IDBFactory.open') |
| 247 Future<Database> open(String name, | 247 Future<Database> open(String name, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 completer.completeError(e); | 288 completer.completeError(e); |
| 289 }); | 289 }); |
| 290 return completer.future; | 290 return completer.future; |
| 291 } catch (e, stacktrace) { | 291 } catch (e, stacktrace) { |
| 292 return new Future.error(e, stacktrace); | 292 return new Future.error(e, stacktrace); |
| 293 } | 293 } |
| 294 } | 294 } |
| 295 | 295 |
| 296 @DomName('IDBFactory.getDatabaseNames') | 296 @DomName('IDBFactory.getDatabaseNames') |
| 297 @SupportedBrowser(SupportedBrowser.CHROME) | 297 @SupportedBrowser(SupportedBrowser.CHROME) |
| 298 @Experimental | 298 @Experimental() |
| 299 Future<List<String>> getDatabaseNames() { | 299 Future<List<String>> getDatabaseNames() { |
| 300 try { | 300 try { |
| 301 var request = $dom_webkitGetDatabaseNames(); | 301 var request = $dom_webkitGetDatabaseNames(); |
| 302 | 302 |
| 303 return _completeRequest(request); | 303 return _completeRequest(request); |
| 304 } catch (e, stacktrace) { | 304 } catch (e, stacktrace) { |
| 305 return new Future.error(e, stacktrace); | 305 return new Future.error(e, stacktrace); |
| 306 } | 306 } |
| 307 } | 307 } |
| 308 | 308 |
| 309 /** | 309 /** |
| 310 * Checks to see if getDatabaseNames is supported by the current platform. | 310 * Checks to see if getDatabaseNames is supported by the current platform. |
| 311 */ | 311 */ |
| 312 bool get supportsDatabaseNames { | 312 bool get supportsDatabaseNames { |
| 313 return true; | 313 return true; |
| 314 } | 314 } |
| 315 | 315 |
| 316 | 316 |
| 317 @DomName('IDBFactory.cmp') | 317 @DomName('IDBFactory.cmp') |
| 318 @DocsEditable | 318 @DocsEditable() |
| 319 int cmp(Object first, Object second) native "IDBFactory_cmp_Callback"; | 319 int cmp(Object first, Object second) native "IDBFactory_cmp_Callback"; |
| 320 | 320 |
| 321 @DomName('IDBFactory.deleteDatabase') | 321 @DomName('IDBFactory.deleteDatabase') |
| 322 @DocsEditable | 322 @DocsEditable() |
| 323 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; | 323 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; |
| 324 | 324 |
| 325 OpenDBRequest $dom_open(String name, [int version]) { | 325 OpenDBRequest $dom_open(String name, [int version]) { |
| 326 if (version != null) { | 326 if (version != null) { |
| 327 return _open_1(name, version); | 327 return _open_1(name, version); |
| 328 } | 328 } |
| 329 return _open_2(name); | 329 return _open_2(name); |
| 330 } | 330 } |
| 331 | 331 |
| 332 OpenDBRequest _open_1(name, version) native "IDBFactory__open_1_Callback"; | 332 OpenDBRequest _open_1(name, version) native "IDBFactory__open_1_Callback"; |
| 333 | 333 |
| 334 OpenDBRequest _open_2(name) native "IDBFactory__open_2_Callback"; | 334 OpenDBRequest _open_2(name) native "IDBFactory__open_2_Callback"; |
| 335 | 335 |
| 336 @DomName('IDBFactory.webkitGetDatabaseNames') | 336 @DomName('IDBFactory.webkitGetDatabaseNames') |
| 337 @DocsEditable | 337 @DocsEditable() |
| 338 @SupportedBrowser(SupportedBrowser.CHROME) | 338 @SupportedBrowser(SupportedBrowser.CHROME) |
| 339 @SupportedBrowser(SupportedBrowser.SAFARI) | 339 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 340 @Experimental | 340 @Experimental() |
| 341 Request $dom_webkitGetDatabaseNames() native "IDBFactory_webkitGetDatabaseName
s_Callback"; | 341 Request $dom_webkitGetDatabaseNames() native "IDBFactory_webkitGetDatabaseName
s_Callback"; |
| 342 | 342 |
| 343 } | 343 } |
| 344 | 344 |
| 345 | 345 |
| 346 /** | 346 /** |
| 347 * Ties a request to a completer, so the completer is completed when it succeeds | 347 * Ties a request to a completer, so the completer is completed when it succeeds |
| 348 * and errors out when the request errors. | 348 * and errors out when the request errors. |
| 349 */ | 349 */ |
| 350 Future _completeRequest(Request request) { | 350 Future _completeRequest(Request request) { |
| 351 var completer = new Completer.sync(); | 351 var completer = new Completer.sync(); |
| 352 // TODO: make sure that completer.complete is synchronous as transactions | 352 // TODO: make sure that completer.complete is synchronous as transactions |
| 353 // may be committed if the result is not processed immediately. | 353 // may be committed if the result is not processed immediately. |
| 354 request.onSuccess.listen((e) { | 354 request.onSuccess.listen((e) { |
| 355 completer.complete(request.result); | 355 completer.complete(request.result); |
| 356 }); | 356 }); |
| 357 request.onError.listen((e) { | 357 request.onError.listen((e) { |
| 358 completer.completeError(e); | 358 completer.completeError(e); |
| 359 }); | 359 }); |
| 360 return completer.future; | 360 return completer.future; |
| 361 } | 361 } |
| 362 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 362 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 363 // for details. All rights reserved. Use of this source code is governed by a | 363 // for details. All rights reserved. Use of this source code is governed by a |
| 364 // BSD-style license that can be found in the LICENSE file. | 364 // BSD-style license that can be found in the LICENSE file. |
| 365 | 365 |
| 366 | 366 |
| 367 @DomName('IDBIndex') | 367 @DomName('IDBIndex') |
| 368 @Unstable | 368 @Unstable() |
| 369 class Index extends NativeFieldWrapperClass1 { | 369 class Index extends NativeFieldWrapperClass1 { |
| 370 @DomName('IDBIndex.count') | 370 @DomName('IDBIndex.count') |
| 371 Future<int> count([key_OR_range]) { | 371 Future<int> count([key_OR_range]) { |
| 372 try { | 372 try { |
| 373 var request; | 373 var request; |
| 374 if (key_OR_range != null) { | 374 if (key_OR_range != null) { |
| 375 request = $dom_count(key_OR_range); | 375 request = $dom_count(key_OR_range); |
| 376 } else { | 376 } else { |
| 377 request = $dom_count(); | 377 request = $dom_count(); |
| 378 } | 378 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 if (direction == null) { | 453 if (direction == null) { |
| 454 request = $dom_openKeyCursor(key_OR_range); | 454 request = $dom_openKeyCursor(key_OR_range); |
| 455 } else { | 455 } else { |
| 456 request = $dom_openKeyCursor(key_OR_range, direction); | 456 request = $dom_openKeyCursor(key_OR_range, direction); |
| 457 } | 457 } |
| 458 return ObjectStore._cursorStreamFromResult(request, autoAdvance); | 458 return ObjectStore._cursorStreamFromResult(request, autoAdvance); |
| 459 } | 459 } |
| 460 | 460 |
| 461 | 461 |
| 462 @DomName('IDBIndex.keyPath') | 462 @DomName('IDBIndex.keyPath') |
| 463 @DocsEditable | 463 @DocsEditable() |
| 464 dynamic get keyPath native "IDBIndex_keyPath_Getter"; | 464 dynamic get keyPath native "IDBIndex_keyPath_Getter"; |
| 465 | 465 |
| 466 @DomName('IDBIndex.multiEntry') | 466 @DomName('IDBIndex.multiEntry') |
| 467 @DocsEditable | 467 @DocsEditable() |
| 468 bool get multiEntry native "IDBIndex_multiEntry_Getter"; | 468 bool get multiEntry native "IDBIndex_multiEntry_Getter"; |
| 469 | 469 |
| 470 @DomName('IDBIndex.name') | 470 @DomName('IDBIndex.name') |
| 471 @DocsEditable | 471 @DocsEditable() |
| 472 String get name native "IDBIndex_name_Getter"; | 472 String get name native "IDBIndex_name_Getter"; |
| 473 | 473 |
| 474 @DomName('IDBIndex.objectStore') | 474 @DomName('IDBIndex.objectStore') |
| 475 @DocsEditable | 475 @DocsEditable() |
| 476 ObjectStore get objectStore native "IDBIndex_objectStore_Getter"; | 476 ObjectStore get objectStore native "IDBIndex_objectStore_Getter"; |
| 477 | 477 |
| 478 @DomName('IDBIndex.unique') | 478 @DomName('IDBIndex.unique') |
| 479 @DocsEditable | 479 @DocsEditable() |
| 480 bool get unique native "IDBIndex_unique_Getter"; | 480 bool get unique native "IDBIndex_unique_Getter"; |
| 481 | 481 |
| 482 Request $dom_count([key_OR_range]) { | 482 Request $dom_count([key_OR_range]) { |
| 483 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 483 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 484 return _count_1(key_OR_range); | 484 return _count_1(key_OR_range); |
| 485 } | 485 } |
| 486 if (key_OR_range != null) { | 486 if (key_OR_range != null) { |
| 487 return _count_2(key_OR_range); | 487 return _count_2(key_OR_range); |
| 488 } | 488 } |
| 489 throw new ArgumentError("Incorrect number or type of arguments"); | 489 throw new ArgumentError("Incorrect number or type of arguments"); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 | 549 |
| 550 Request _openKeyCursor_2(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_2_Callback"; | 550 Request _openKeyCursor_2(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_2_Callback"; |
| 551 | 551 |
| 552 } | 552 } |
| 553 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 553 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 554 // for details. All rights reserved. Use of this source code is governed by a | 554 // for details. All rights reserved. Use of this source code is governed by a |
| 555 // BSD-style license that can be found in the LICENSE file. | 555 // BSD-style license that can be found in the LICENSE file. |
| 556 | 556 |
| 557 | 557 |
| 558 @DomName('IDBKeyRange') | 558 @DomName('IDBKeyRange') |
| 559 @Unstable | 559 @Unstable() |
| 560 class KeyRange extends NativeFieldWrapperClass1 { | 560 class KeyRange extends NativeFieldWrapperClass1 { |
| 561 @DomName('IDBKeyRange.only') | 561 @DomName('IDBKeyRange.only') |
| 562 factory KeyRange.only(/*Key*/ value) => | 562 factory KeyRange.only(/*Key*/ value) => |
| 563 _KeyRangeFactoryProvider.createKeyRange_only(value); | 563 _KeyRangeFactoryProvider.createKeyRange_only(value); |
| 564 | 564 |
| 565 @DomName('IDBKeyRange.lowerBound') | 565 @DomName('IDBKeyRange.lowerBound') |
| 566 factory KeyRange.lowerBound(/*Key*/ bound, [bool open = false]) => | 566 factory KeyRange.lowerBound(/*Key*/ bound, [bool open = false]) => |
| 567 _KeyRangeFactoryProvider.createKeyRange_lowerBound(bound, open); | 567 _KeyRangeFactoryProvider.createKeyRange_lowerBound(bound, open); |
| 568 | 568 |
| 569 @DomName('IDBKeyRange.upperBound') | 569 @DomName('IDBKeyRange.upperBound') |
| 570 factory KeyRange.upperBound(/*Key*/ bound, [bool open = false]) => | 570 factory KeyRange.upperBound(/*Key*/ bound, [bool open = false]) => |
| 571 _KeyRangeFactoryProvider.createKeyRange_upperBound(bound, open); | 571 _KeyRangeFactoryProvider.createKeyRange_upperBound(bound, open); |
| 572 | 572 |
| 573 @DomName('KeyRange.bound') | 573 @DomName('KeyRange.bound') |
| 574 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, | 574 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, |
| 575 [bool lowerOpen = false, bool upperOpen = false]) => | 575 [bool lowerOpen = false, bool upperOpen = false]) => |
| 576 _KeyRangeFactoryProvider.createKeyRange_bound( | 576 _KeyRangeFactoryProvider.createKeyRange_bound( |
| 577 lower, upper, lowerOpen, upperOpen); | 577 lower, upper, lowerOpen, upperOpen); |
| 578 | 578 |
| 579 | 579 |
| 580 @DomName('IDBKeyRange.lower') | 580 @DomName('IDBKeyRange.lower') |
| 581 @DocsEditable | 581 @DocsEditable() |
| 582 Object get lower native "IDBKeyRange_lower_Getter"; | 582 Object get lower native "IDBKeyRange_lower_Getter"; |
| 583 | 583 |
| 584 @DomName('IDBKeyRange.lowerOpen') | 584 @DomName('IDBKeyRange.lowerOpen') |
| 585 @DocsEditable | 585 @DocsEditable() |
| 586 bool get lowerOpen native "IDBKeyRange_lowerOpen_Getter"; | 586 bool get lowerOpen native "IDBKeyRange_lowerOpen_Getter"; |
| 587 | 587 |
| 588 @DomName('IDBKeyRange.upper') | 588 @DomName('IDBKeyRange.upper') |
| 589 @DocsEditable | 589 @DocsEditable() |
| 590 Object get upper native "IDBKeyRange_upper_Getter"; | 590 Object get upper native "IDBKeyRange_upper_Getter"; |
| 591 | 591 |
| 592 @DomName('IDBKeyRange.upperOpen') | 592 @DomName('IDBKeyRange.upperOpen') |
| 593 @DocsEditable | 593 @DocsEditable() |
| 594 bool get upperOpen native "IDBKeyRange_upperOpen_Getter"; | 594 bool get upperOpen native "IDBKeyRange_upperOpen_Getter"; |
| 595 | 595 |
| 596 @DomName('IDBKeyRange.bound_') | 596 @DomName('IDBKeyRange.bound_') |
| 597 @DocsEditable | 597 @DocsEditable() |
| 598 @Experimental // non-standard | 598 @Experimental() // non-standard |
| 599 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper
Open]) native "IDBKeyRange_bound__Callback"; | 599 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper
Open]) native "IDBKeyRange_bound__Callback"; |
| 600 | 600 |
| 601 @DomName('IDBKeyRange.lowerBound_') | 601 @DomName('IDBKeyRange.lowerBound_') |
| 602 @DocsEditable | 602 @DocsEditable() |
| 603 @Experimental // non-standard | 603 @Experimental() // non-standard |
| 604 static KeyRange lowerBound_(Object bound, [bool open]) native "IDBKeyRange_low
erBound__Callback"; | 604 static KeyRange lowerBound_(Object bound, [bool open]) native "IDBKeyRange_low
erBound__Callback"; |
| 605 | 605 |
| 606 @DomName('IDBKeyRange.only_') | 606 @DomName('IDBKeyRange.only_') |
| 607 @DocsEditable | 607 @DocsEditable() |
| 608 @Experimental // non-standard | 608 @Experimental() // non-standard |
| 609 static KeyRange only_(Object value) native "IDBKeyRange_only__Callback"; | 609 static KeyRange only_(Object value) native "IDBKeyRange_only__Callback"; |
| 610 | 610 |
| 611 @DomName('IDBKeyRange.upperBound_') | 611 @DomName('IDBKeyRange.upperBound_') |
| 612 @DocsEditable | 612 @DocsEditable() |
| 613 @Experimental // non-standard | 613 @Experimental() // non-standard |
| 614 static KeyRange upperBound_(Object bound, [bool open]) native "IDBKeyRange_upp
erBound__Callback"; | 614 static KeyRange upperBound_(Object bound, [bool open]) native "IDBKeyRange_upp
erBound__Callback"; |
| 615 | 615 |
| 616 } | 616 } |
| 617 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 617 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 618 // for details. All rights reserved. Use of this source code is governed by a | 618 // for details. All rights reserved. Use of this source code is governed by a |
| 619 // BSD-style license that can be found in the LICENSE file. | 619 // BSD-style license that can be found in the LICENSE file. |
| 620 | 620 |
| 621 | 621 |
| 622 @DomName('IDBObjectStore') | 622 @DomName('IDBObjectStore') |
| 623 @Unstable | 623 @Unstable() |
| 624 class ObjectStore extends NativeFieldWrapperClass1 { | 624 class ObjectStore extends NativeFieldWrapperClass1 { |
| 625 | 625 |
| 626 @DomName('IDBObjectStore.add') | 626 @DomName('IDBObjectStore.add') |
| 627 Future add(value, [key]) { | 627 Future add(value, [key]) { |
| 628 try { | 628 try { |
| 629 var request; | 629 var request; |
| 630 if (key != null) { | 630 if (key != null) { |
| 631 request = $dom_add(value, key); | 631 request = $dom_add(value, key); |
| 632 } else { | 632 } else { |
| 633 request = $dom_add(value); | 633 request = $dom_add(value); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 } | 749 } |
| 750 if (multiEntry != null) { | 750 if (multiEntry != null) { |
| 751 options['multiEntry'] = multiEntry; | 751 options['multiEntry'] = multiEntry; |
| 752 } | 752 } |
| 753 | 753 |
| 754 return $dom_createIndex(name, keyPath, options); | 754 return $dom_createIndex(name, keyPath, options); |
| 755 } | 755 } |
| 756 | 756 |
| 757 | 757 |
| 758 @DomName('IDBObjectStore.autoIncrement') | 758 @DomName('IDBObjectStore.autoIncrement') |
| 759 @DocsEditable | 759 @DocsEditable() |
| 760 bool get autoIncrement native "IDBObjectStore_autoIncrement_Getter"; | 760 bool get autoIncrement native "IDBObjectStore_autoIncrement_Getter"; |
| 761 | 761 |
| 762 @DomName('IDBObjectStore.indexNames') | 762 @DomName('IDBObjectStore.indexNames') |
| 763 @DocsEditable | 763 @DocsEditable() |
| 764 List<String> get indexNames native "IDBObjectStore_indexNames_Getter"; | 764 List<String> get indexNames native "IDBObjectStore_indexNames_Getter"; |
| 765 | 765 |
| 766 @DomName('IDBObjectStore.keyPath') | 766 @DomName('IDBObjectStore.keyPath') |
| 767 @DocsEditable | 767 @DocsEditable() |
| 768 dynamic get keyPath native "IDBObjectStore_keyPath_Getter"; | 768 dynamic get keyPath native "IDBObjectStore_keyPath_Getter"; |
| 769 | 769 |
| 770 @DomName('IDBObjectStore.name') | 770 @DomName('IDBObjectStore.name') |
| 771 @DocsEditable | 771 @DocsEditable() |
| 772 String get name native "IDBObjectStore_name_Getter"; | 772 String get name native "IDBObjectStore_name_Getter"; |
| 773 | 773 |
| 774 @DomName('IDBObjectStore.transaction') | 774 @DomName('IDBObjectStore.transaction') |
| 775 @DocsEditable | 775 @DocsEditable() |
| 776 Transaction get transaction native "IDBObjectStore_transaction_Getter"; | 776 Transaction get transaction native "IDBObjectStore_transaction_Getter"; |
| 777 | 777 |
| 778 @DomName('IDBObjectStore.add') | 778 @DomName('IDBObjectStore.add') |
| 779 @DocsEditable | 779 @DocsEditable() |
| 780 Request $dom_add(Object value, [Object key]) native "IDBObjectStore_add_Callba
ck"; | 780 Request $dom_add(Object value, [Object key]) native "IDBObjectStore_add_Callba
ck"; |
| 781 | 781 |
| 782 @DomName('IDBObjectStore.clear') | 782 @DomName('IDBObjectStore.clear') |
| 783 @DocsEditable | 783 @DocsEditable() |
| 784 Request $dom_clear() native "IDBObjectStore_clear_Callback"; | 784 Request $dom_clear() native "IDBObjectStore_clear_Callback"; |
| 785 | 785 |
| 786 Request $dom_count([key_OR_range]) { | 786 Request $dom_count([key_OR_range]) { |
| 787 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 787 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 788 return _count_1(key_OR_range); | 788 return _count_1(key_OR_range); |
| 789 } | 789 } |
| 790 if (key_OR_range != null) { | 790 if (key_OR_range != null) { |
| 791 return _count_2(key_OR_range); | 791 return _count_2(key_OR_range); |
| 792 } | 792 } |
| 793 throw new ArgumentError("Incorrect number or type of arguments"); | 793 throw new ArgumentError("Incorrect number or type of arguments"); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 819 return _delete_2(key_OR_keyRange); | 819 return _delete_2(key_OR_keyRange); |
| 820 } | 820 } |
| 821 throw new ArgumentError("Incorrect number or type of arguments"); | 821 throw new ArgumentError("Incorrect number or type of arguments"); |
| 822 } | 822 } |
| 823 | 823 |
| 824 Request _delete_1(key_OR_keyRange) native "IDBObjectStore__delete_1_Callback"; | 824 Request _delete_1(key_OR_keyRange) native "IDBObjectStore__delete_1_Callback"; |
| 825 | 825 |
| 826 Request _delete_2(key_OR_keyRange) native "IDBObjectStore__delete_2_Callback"; | 826 Request _delete_2(key_OR_keyRange) native "IDBObjectStore__delete_2_Callback"; |
| 827 | 827 |
| 828 @DomName('IDBObjectStore.deleteIndex') | 828 @DomName('IDBObjectStore.deleteIndex') |
| 829 @DocsEditable | 829 @DocsEditable() |
| 830 void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback"; | 830 void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback"; |
| 831 | 831 |
| 832 Request $dom_get(key) { | 832 Request $dom_get(key) { |
| 833 if ((key is KeyRange || key == null)) { | 833 if ((key is KeyRange || key == null)) { |
| 834 return _get_1(key); | 834 return _get_1(key); |
| 835 } | 835 } |
| 836 if (key != null) { | 836 if (key != null) { |
| 837 return _get_2(key); | 837 return _get_2(key); |
| 838 } | 838 } |
| 839 throw new ArgumentError("Incorrect number or type of arguments"); | 839 throw new ArgumentError("Incorrect number or type of arguments"); |
| 840 } | 840 } |
| 841 | 841 |
| 842 Request _get_1(key) native "IDBObjectStore__get_1_Callback"; | 842 Request _get_1(key) native "IDBObjectStore__get_1_Callback"; |
| 843 | 843 |
| 844 Request _get_2(key) native "IDBObjectStore__get_2_Callback"; | 844 Request _get_2(key) native "IDBObjectStore__get_2_Callback"; |
| 845 | 845 |
| 846 @DomName('IDBObjectStore.index') | 846 @DomName('IDBObjectStore.index') |
| 847 @DocsEditable | 847 @DocsEditable() |
| 848 Index index(String name) native "IDBObjectStore_index_Callback"; | 848 Index index(String name) native "IDBObjectStore_index_Callback"; |
| 849 | 849 |
| 850 Request $dom_openCursor([key_OR_range, String direction]) { | 850 Request $dom_openCursor([key_OR_range, String direction]) { |
| 851 if ((direction is String || direction == null) && (key_OR_range is KeyRange
|| key_OR_range == null)) { | 851 if ((direction is String || direction == null) && (key_OR_range is KeyRange
|| key_OR_range == null)) { |
| 852 return _openCursor_1(key_OR_range, direction); | 852 return _openCursor_1(key_OR_range, direction); |
| 853 } | 853 } |
| 854 if ((direction is String || direction == null) && key_OR_range != null) { | 854 if ((direction is String || direction == null) && key_OR_range != null) { |
| 855 return _openCursor_2(key_OR_range, direction); | 855 return _openCursor_2(key_OR_range, direction); |
| 856 } | 856 } |
| 857 throw new ArgumentError("Incorrect number or type of arguments"); | 857 throw new ArgumentError("Incorrect number or type of arguments"); |
| 858 } | 858 } |
| 859 | 859 |
| 860 Request _openCursor_1(key_OR_range, direction) native "IDBObjectStore__openCur
sor_1_Callback"; | 860 Request _openCursor_1(key_OR_range, direction) native "IDBObjectStore__openCur
sor_1_Callback"; |
| 861 | 861 |
| 862 Request _openCursor_2(key_OR_range, direction) native "IDBObjectStore__openCur
sor_2_Callback"; | 862 Request _openCursor_2(key_OR_range, direction) native "IDBObjectStore__openCur
sor_2_Callback"; |
| 863 | 863 |
| 864 @DomName('IDBObjectStore.put') | 864 @DomName('IDBObjectStore.put') |
| 865 @DocsEditable | 865 @DocsEditable() |
| 866 Request $dom_put(Object value, [Object key]) native "IDBObjectStore_put_Callba
ck"; | 866 Request $dom_put(Object value, [Object key]) native "IDBObjectStore_put_Callba
ck"; |
| 867 | 867 |
| 868 | 868 |
| 869 /** | 869 /** |
| 870 * Helper for iterating over cursors in a request. | 870 * Helper for iterating over cursors in a request. |
| 871 */ | 871 */ |
| 872 static Stream<Cursor> _cursorStreamFromResult(Request request, | 872 static Stream<Cursor> _cursorStreamFromResult(Request request, |
| 873 bool autoAdvance) { | 873 bool autoAdvance) { |
| 874 // TODO: need to guarantee that the controller provides the values | 874 // TODO: need to guarantee that the controller provides the values |
| 875 // immediately as waiting until the next tick will cause the transaction to | 875 // immediately as waiting until the next tick will cause the transaction to |
| (...skipping 19 matching lines...) Expand all Loading... |
| 895 return controller.stream; | 895 return controller.stream; |
| 896 } | 896 } |
| 897 } | 897 } |
| 898 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 898 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 899 // for details. All rights reserved. Use of this source code is governed by a | 899 // for details. All rights reserved. Use of this source code is governed by a |
| 900 // BSD-style license that can be found in the LICENSE file. | 900 // BSD-style license that can be found in the LICENSE file. |
| 901 | 901 |
| 902 // WARNING: Do not edit - generated code. | 902 // WARNING: Do not edit - generated code. |
| 903 | 903 |
| 904 | 904 |
| 905 @DocsEditable | 905 @DocsEditable() |
| 906 @DomName('IDBOpenDBRequest') | 906 @DomName('IDBOpenDBRequest') |
| 907 @Unstable | 907 @Unstable() |
| 908 class OpenDBRequest extends Request implements EventTarget { | 908 class OpenDBRequest extends Request implements EventTarget { |
| 909 // To suppress missing implicit constructor warnings. | 909 // To suppress missing implicit constructor warnings. |
| 910 factory OpenDBRequest._() { throw new UnsupportedError("Not supported"); } | 910 factory OpenDBRequest._() { throw new UnsupportedError("Not supported"); } |
| 911 | 911 |
| 912 @DomName('IDBOpenDBRequest.blockedEvent') | 912 @DomName('IDBOpenDBRequest.blockedEvent') |
| 913 @DocsEditable | 913 @DocsEditable() |
| 914 static const EventStreamProvider<Event> blockedEvent = const EventStreamProvid
er<Event>('blocked'); | 914 static const EventStreamProvider<Event> blockedEvent = const EventStreamProvid
er<Event>('blocked'); |
| 915 | 915 |
| 916 @DomName('IDBOpenDBRequest.upgradeneededEvent') | 916 @DomName('IDBOpenDBRequest.upgradeneededEvent') |
| 917 @DocsEditable | 917 @DocsEditable() |
| 918 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons
t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); | 918 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons
t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); |
| 919 | 919 |
| 920 @DomName('IDBOpenDBRequest.onblocked') | 920 @DomName('IDBOpenDBRequest.onblocked') |
| 921 @DocsEditable | 921 @DocsEditable() |
| 922 Stream<Event> get onBlocked => blockedEvent.forTarget(this); | 922 Stream<Event> get onBlocked => blockedEvent.forTarget(this); |
| 923 | 923 |
| 924 @DomName('IDBOpenDBRequest.onupgradeneeded') | 924 @DomName('IDBOpenDBRequest.onupgradeneeded') |
| 925 @DocsEditable | 925 @DocsEditable() |
| 926 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget
(this); | 926 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget
(this); |
| 927 | 927 |
| 928 } | 928 } |
| 929 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 929 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 930 // for details. All rights reserved. Use of this source code is governed by a | 930 // for details. All rights reserved. Use of this source code is governed by a |
| 931 // BSD-style license that can be found in the LICENSE file. | 931 // BSD-style license that can be found in the LICENSE file. |
| 932 | 932 |
| 933 // WARNING: Do not edit - generated code. | 933 // WARNING: Do not edit - generated code. |
| 934 | 934 |
| 935 | 935 |
| 936 @DocsEditable | 936 @DocsEditable() |
| 937 @DomName('IDBRequest') | 937 @DomName('IDBRequest') |
| 938 @Unstable | 938 @Unstable() |
| 939 class Request extends EventTarget { | 939 class Request extends EventTarget { |
| 940 // To suppress missing implicit constructor warnings. | 940 // To suppress missing implicit constructor warnings. |
| 941 factory Request._() { throw new UnsupportedError("Not supported"); } | 941 factory Request._() { throw new UnsupportedError("Not supported"); } |
| 942 | 942 |
| 943 @DomName('IDBRequest.errorEvent') | 943 @DomName('IDBRequest.errorEvent') |
| 944 @DocsEditable | 944 @DocsEditable() |
| 945 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); | 945 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); |
| 946 | 946 |
| 947 @DomName('IDBRequest.successEvent') | 947 @DomName('IDBRequest.successEvent') |
| 948 @DocsEditable | 948 @DocsEditable() |
| 949 static const EventStreamProvider<Event> successEvent = const EventStreamProvid
er<Event>('success'); | 949 static const EventStreamProvider<Event> successEvent = const EventStreamProvid
er<Event>('success'); |
| 950 | 950 |
| 951 @DomName('IDBRequest.error') | 951 @DomName('IDBRequest.error') |
| 952 @DocsEditable | 952 @DocsEditable() |
| 953 DomError get error native "IDBRequest_error_Getter"; | 953 DomError get error native "IDBRequest_error_Getter"; |
| 954 | 954 |
| 955 @DomName('IDBRequest.readyState') | 955 @DomName('IDBRequest.readyState') |
| 956 @DocsEditable | 956 @DocsEditable() |
| 957 String get readyState native "IDBRequest_readyState_Getter"; | 957 String get readyState native "IDBRequest_readyState_Getter"; |
| 958 | 958 |
| 959 @DomName('IDBRequest.result') | 959 @DomName('IDBRequest.result') |
| 960 @DocsEditable | 960 @DocsEditable() |
| 961 dynamic get result native "IDBRequest_result_Getter"; | 961 dynamic get result native "IDBRequest_result_Getter"; |
| 962 | 962 |
| 963 @DomName('IDBRequest.source') | 963 @DomName('IDBRequest.source') |
| 964 @DocsEditable | 964 @DocsEditable() |
| 965 dynamic get source native "IDBRequest_source_Getter"; | 965 dynamic get source native "IDBRequest_source_Getter"; |
| 966 | 966 |
| 967 @DomName('IDBRequest.transaction') | 967 @DomName('IDBRequest.transaction') |
| 968 @DocsEditable | 968 @DocsEditable() |
| 969 Transaction get transaction native "IDBRequest_transaction_Getter"; | 969 Transaction get transaction native "IDBRequest_transaction_Getter"; |
| 970 | 970 |
| 971 @DomName('IDBRequest.webkitErrorMessage') | 971 @DomName('IDBRequest.webkitErrorMessage') |
| 972 @DocsEditable | 972 @DocsEditable() |
| 973 @SupportedBrowser(SupportedBrowser.CHROME) | 973 @SupportedBrowser(SupportedBrowser.CHROME) |
| 974 @SupportedBrowser(SupportedBrowser.SAFARI) | 974 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 975 @Experimental | 975 @Experimental() |
| 976 String get errorMessage native "IDBRequest_webkitErrorMessage_Getter"; | 976 String get errorMessage native "IDBRequest_webkitErrorMessage_Getter"; |
| 977 | 977 |
| 978 @DomName('IDBRequest.addEventListener') | 978 @DomName('IDBRequest.addEventListener') |
| 979 @DocsEditable | 979 @DocsEditable() |
| 980 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "IDBRequest_addEventListener_Callback"; | 980 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "IDBRequest_addEventListener_Callback"; |
| 981 | 981 |
| 982 @DomName('IDBRequest.dispatchEvent') | 982 @DomName('IDBRequest.dispatchEvent') |
| 983 @DocsEditable | 983 @DocsEditable() |
| 984 bool dispatchEvent(Event evt) native "IDBRequest_dispatchEvent_Callback"; | 984 bool dispatchEvent(Event evt) native "IDBRequest_dispatchEvent_Callback"; |
| 985 | 985 |
| 986 @DomName('IDBRequest.removeEventListener') | 986 @DomName('IDBRequest.removeEventListener') |
| 987 @DocsEditable | 987 @DocsEditable() |
| 988 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBRequest_removeEventListener_Callback"; | 988 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBRequest_removeEventListener_Callback"; |
| 989 | 989 |
| 990 @DomName('IDBRequest.onerror') | 990 @DomName('IDBRequest.onerror') |
| 991 @DocsEditable | 991 @DocsEditable() |
| 992 Stream<Event> get onError => errorEvent.forTarget(this); | 992 Stream<Event> get onError => errorEvent.forTarget(this); |
| 993 | 993 |
| 994 @DomName('IDBRequest.onsuccess') | 994 @DomName('IDBRequest.onsuccess') |
| 995 @DocsEditable | 995 @DocsEditable() |
| 996 Stream<Event> get onSuccess => successEvent.forTarget(this); | 996 Stream<Event> get onSuccess => successEvent.forTarget(this); |
| 997 | 997 |
| 998 } | 998 } |
| 999 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 999 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 1000 // for details. All rights reserved. Use of this source code is governed by a | 1000 // for details. All rights reserved. Use of this source code is governed by a |
| 1001 // BSD-style license that can be found in the LICENSE file. | 1001 // BSD-style license that can be found in the LICENSE file. |
| 1002 | 1002 |
| 1003 | 1003 |
| 1004 @DomName('IDBTransaction') | 1004 @DomName('IDBTransaction') |
| 1005 @Unstable | 1005 @Unstable() |
| 1006 class Transaction extends EventTarget { | 1006 class Transaction extends EventTarget { |
| 1007 | 1007 |
| 1008 /** | 1008 /** |
| 1009 * Provides a Future which will be completed once the transaction has | 1009 * Provides a Future which will be completed once the transaction has |
| 1010 * completed. | 1010 * completed. |
| 1011 * | 1011 * |
| 1012 * The future will error if an error occurrs on the transaction or if the | 1012 * The future will error if an error occurrs on the transaction or if the |
| 1013 * transaction is aborted. | 1013 * transaction is aborted. |
| 1014 */ | 1014 */ |
| 1015 Future<Database> get completed { | 1015 Future<Database> get completed { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1027 completer.completeError(e); | 1027 completer.completeError(e); |
| 1028 }); | 1028 }); |
| 1029 | 1029 |
| 1030 return completer.future; | 1030 return completer.future; |
| 1031 } | 1031 } |
| 1032 | 1032 |
| 1033 // To suppress missing implicit constructor warnings. | 1033 // To suppress missing implicit constructor warnings. |
| 1034 factory Transaction._() { throw new UnsupportedError("Not supported"); } | 1034 factory Transaction._() { throw new UnsupportedError("Not supported"); } |
| 1035 | 1035 |
| 1036 @DomName('IDBTransaction.abortEvent') | 1036 @DomName('IDBTransaction.abortEvent') |
| 1037 @DocsEditable | 1037 @DocsEditable() |
| 1038 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); | 1038 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); |
| 1039 | 1039 |
| 1040 @DomName('IDBTransaction.completeEvent') | 1040 @DomName('IDBTransaction.completeEvent') |
| 1041 @DocsEditable | 1041 @DocsEditable() |
| 1042 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); | 1042 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); |
| 1043 | 1043 |
| 1044 @DomName('IDBTransaction.errorEvent') | 1044 @DomName('IDBTransaction.errorEvent') |
| 1045 @DocsEditable | 1045 @DocsEditable() |
| 1046 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); | 1046 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); |
| 1047 | 1047 |
| 1048 @DomName('IDBTransaction.db') | 1048 @DomName('IDBTransaction.db') |
| 1049 @DocsEditable | 1049 @DocsEditable() |
| 1050 Database get db native "IDBTransaction_db_Getter"; | 1050 Database get db native "IDBTransaction_db_Getter"; |
| 1051 | 1051 |
| 1052 @DomName('IDBTransaction.error') | 1052 @DomName('IDBTransaction.error') |
| 1053 @DocsEditable | 1053 @DocsEditable() |
| 1054 DomError get error native "IDBTransaction_error_Getter"; | 1054 DomError get error native "IDBTransaction_error_Getter"; |
| 1055 | 1055 |
| 1056 @DomName('IDBTransaction.mode') | 1056 @DomName('IDBTransaction.mode') |
| 1057 @DocsEditable | 1057 @DocsEditable() |
| 1058 String get mode native "IDBTransaction_mode_Getter"; | 1058 String get mode native "IDBTransaction_mode_Getter"; |
| 1059 | 1059 |
| 1060 @DomName('IDBTransaction.webkitErrorMessage') | 1060 @DomName('IDBTransaction.webkitErrorMessage') |
| 1061 @DocsEditable | 1061 @DocsEditable() |
| 1062 @SupportedBrowser(SupportedBrowser.CHROME) | 1062 @SupportedBrowser(SupportedBrowser.CHROME) |
| 1063 @SupportedBrowser(SupportedBrowser.SAFARI) | 1063 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 1064 @Experimental | 1064 @Experimental() |
| 1065 String get errorMessage native "IDBTransaction_webkitErrorMessage_Getter"; | 1065 String get errorMessage native "IDBTransaction_webkitErrorMessage_Getter"; |
| 1066 | 1066 |
| 1067 @DomName('IDBTransaction.abort') | 1067 @DomName('IDBTransaction.abort') |
| 1068 @DocsEditable | 1068 @DocsEditable() |
| 1069 void abort() native "IDBTransaction_abort_Callback"; | 1069 void abort() native "IDBTransaction_abort_Callback"; |
| 1070 | 1070 |
| 1071 @DomName('IDBTransaction.addEventListener') | 1071 @DomName('IDBTransaction.addEventListener') |
| 1072 @DocsEditable | 1072 @DocsEditable() |
| 1073 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "IDBTransaction_addEventListener_Callback"; | 1073 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu
re]) native "IDBTransaction_addEventListener_Callback"; |
| 1074 | 1074 |
| 1075 @DomName('IDBTransaction.dispatchEvent') | 1075 @DomName('IDBTransaction.dispatchEvent') |
| 1076 @DocsEditable | 1076 @DocsEditable() |
| 1077 bool dispatchEvent(Event evt) native "IDBTransaction_dispatchEvent_Callback"; | 1077 bool dispatchEvent(Event evt) native "IDBTransaction_dispatchEvent_Callback"; |
| 1078 | 1078 |
| 1079 @DomName('IDBTransaction.objectStore') | 1079 @DomName('IDBTransaction.objectStore') |
| 1080 @DocsEditable | 1080 @DocsEditable() |
| 1081 ObjectStore objectStore(String name) native "IDBTransaction_objectStore_Callba
ck"; | 1081 ObjectStore objectStore(String name) native "IDBTransaction_objectStore_Callba
ck"; |
| 1082 | 1082 |
| 1083 @DomName('IDBTransaction.removeEventListener') | 1083 @DomName('IDBTransaction.removeEventListener') |
| 1084 @DocsEditable | 1084 @DocsEditable() |
| 1085 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBTransaction_removeEventListener_Callback"; | 1085 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBTransaction_removeEventListener_Callback"; |
| 1086 | 1086 |
| 1087 @DomName('IDBTransaction.onabort') | 1087 @DomName('IDBTransaction.onabort') |
| 1088 @DocsEditable | 1088 @DocsEditable() |
| 1089 Stream<Event> get onAbort => abortEvent.forTarget(this); | 1089 Stream<Event> get onAbort => abortEvent.forTarget(this); |
| 1090 | 1090 |
| 1091 @DomName('IDBTransaction.oncomplete') | 1091 @DomName('IDBTransaction.oncomplete') |
| 1092 @DocsEditable | 1092 @DocsEditable() |
| 1093 Stream<Event> get onComplete => completeEvent.forTarget(this); | 1093 Stream<Event> get onComplete => completeEvent.forTarget(this); |
| 1094 | 1094 |
| 1095 @DomName('IDBTransaction.onerror') | 1095 @DomName('IDBTransaction.onerror') |
| 1096 @DocsEditable | 1096 @DocsEditable() |
| 1097 Stream<Event> get onError => errorEvent.forTarget(this); | 1097 Stream<Event> get onError => errorEvent.forTarget(this); |
| 1098 | 1098 |
| 1099 } | 1099 } |
| 1100 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1100 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1101 // for details. All rights reserved. Use of this source code is governed by a | 1101 // for details. All rights reserved. Use of this source code is governed by a |
| 1102 // BSD-style license that can be found in the LICENSE file. | 1102 // BSD-style license that can be found in the LICENSE file. |
| 1103 | 1103 |
| 1104 // WARNING: Do not edit - generated code. | 1104 // WARNING: Do not edit - generated code. |
| 1105 | 1105 |
| 1106 | 1106 |
| 1107 @DocsEditable | 1107 @DocsEditable() |
| 1108 @DomName('IDBVersionChangeEvent') | 1108 @DomName('IDBVersionChangeEvent') |
| 1109 @Unstable | 1109 @Unstable() |
| 1110 class VersionChangeEvent extends Event { | 1110 class VersionChangeEvent extends Event { |
| 1111 // To suppress missing implicit constructor warnings. | 1111 // To suppress missing implicit constructor warnings. |
| 1112 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported");
} | 1112 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported");
} |
| 1113 | 1113 |
| 1114 @DomName('IDBVersionChangeEvent.newVersion') | 1114 @DomName('IDBVersionChangeEvent.newVersion') |
| 1115 @DocsEditable | 1115 @DocsEditable() |
| 1116 dynamic get newVersion native "IDBVersionChangeEvent_newVersion_Getter"; | 1116 dynamic get newVersion native "IDBVersionChangeEvent_newVersion_Getter"; |
| 1117 | 1117 |
| 1118 @DomName('IDBVersionChangeEvent.oldVersion') | 1118 @DomName('IDBVersionChangeEvent.oldVersion') |
| 1119 @DocsEditable | 1119 @DocsEditable() |
| 1120 dynamic get oldVersion native "IDBVersionChangeEvent_oldVersion_Getter"; | 1120 dynamic get oldVersion native "IDBVersionChangeEvent_oldVersion_Getter"; |
| 1121 | 1121 |
| 1122 } | 1122 } |
| 1123 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1123 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1124 // for details. All rights reserved. Use of this source code is governed by a | 1124 // for details. All rights reserved. Use of this source code is governed by a |
| 1125 // BSD-style license that can be found in the LICENSE file. | 1125 // BSD-style license that can be found in the LICENSE file. |
| 1126 | 1126 |
| 1127 // WARNING: Do not edit - generated code. | 1127 // WARNING: Do not edit - generated code. |
| 1128 | 1128 |
| 1129 | 1129 |
| 1130 @DocsEditable | 1130 @DocsEditable() |
| 1131 @DomName('IDBAny') | 1131 @DomName('IDBAny') |
| 1132 @deprecated // nonstandard | 1132 @deprecated // nonstandard |
| 1133 abstract class _IDBAny extends NativeFieldWrapperClass1 { | 1133 abstract class _IDBAny extends NativeFieldWrapperClass1 { |
| 1134 | 1134 |
| 1135 } | 1135 } |
| OLD | NEW |