| OLD | NEW |
| 1 /** | 1 /** |
| 2 * A client-side key-value store with support for indexes. | 2 * A client-side key-value store with support for indexes. |
| 3 * | 3 * |
| 4 * Many browsers support IndexedDB—a web standard for | 4 * Many browsers support IndexedDB—a web standard for |
| 5 * an indexed database. | 5 * an indexed database. |
| 6 * By storing data on the client in an IndexedDB, | 6 * By storing data on the client in an IndexedDB, |
| 7 * a web app gets some advantages, such as faster performance and persistence. | 7 * a web app gets some advantages, such as faster performance and persistence. |
| 8 * To find out which browsers support IndexedDB, | 8 * To find out which browsers support IndexedDB, |
| 9 * refer to [Can I Use?](http://caniuse.com/#feat=indexeddb) | 9 * refer to [Can I Use?](http://caniuse.com/#feat=indexeddb) |
| 10 * | 10 * |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 * | 55 * |
| 56 * ## Other resources | 56 * ## Other resources |
| 57 * | 57 * |
| 58 * Other options for client-side data storage include: | 58 * Other options for client-side data storage include: |
| 59 * | 59 * |
| 60 * * [Window.localStorage]—a | 60 * * [Window.localStorage]—a |
| 61 * basic mechanism that stores data as a [Map], | 61 * basic mechanism that stores data as a [Map], |
| 62 * and where both the keys and the values are strings. | 62 * and where both the keys and the values are strings. |
| 63 * | 63 * |
| 64 * * [dart:web_sql]—a database that can be queried with SQL. | 64 * * [dart:web_sql]—a database that can be queried with SQL. |
| 65 * | 65 * |
| 66 * For a tutorial about using the indexed_db library with Dart, | 66 * For a tutorial about using the indexed_db library with Dart, |
| 67 * check out | 67 * check out |
| 68 * [Use IndexedDB](http://www.dartlang.org/docs/tutorials/indexeddb/). | 68 * [Use IndexedDB](http://www.dartlang.org/docs/tutorials/indexeddb/). |
| 69 * | 69 * |
| 70 * [IndexedDB reference](http://docs.webplatform.org/wiki/apis/indexeddb) | 70 * [IndexedDB reference](http://docs.webplatform.org/wiki/apis/indexeddb) |
| 71 * provides wiki-style docs about indexedDB | 71 * provides wiki-style docs about indexedDB |
| 72 */ | 72 */ |
| 73 library dart.dom.indexed_db; | 73 library dart.dom.indexed_db; |
| 74 | 74 |
| 75 import 'dart:async'; | 75 import 'dart:async'; |
| 76 import 'dart:html'; | 76 import 'dart:html'; |
| 77 import 'dart:html_common'; | 77 import 'dart:html_common'; |
| 78 import 'dart:nativewrappers'; | 78 import 'dart:nativewrappers'; |
| 79 import 'dart:_blink' as _blink; | 79 import 'dart:_blink' as _blink; |
| 80 import 'dart:js' as js; | |
| 81 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 80 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 82 // for details. All rights reserved. Use of this source code is governed by a | 81 // for details. All rights reserved. Use of this source code is governed by a |
| 83 // BSD-style license that can be found in the LICENSE file. | 82 // BSD-style license that can be found in the LICENSE file. |
| 84 | 83 |
| 85 // DO NOT EDIT | 84 // DO NOT EDIT |
| 86 // Auto-generated dart:indexed_db library. | 85 // Auto-generated dart:indexed_db library. |
| 87 | 86 |
| 88 | 87 |
| 89 | 88 |
| 90 | 89 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 116 'IDBIndex': () => Index, | 115 'IDBIndex': () => Index, |
| 117 'IDBKeyRange': () => KeyRange, | 116 'IDBKeyRange': () => KeyRange, |
| 118 'IDBObjectStore': () => ObjectStore, | 117 'IDBObjectStore': () => ObjectStore, |
| 119 'IDBOpenDBRequest': () => OpenDBRequest, | 118 'IDBOpenDBRequest': () => OpenDBRequest, |
| 120 'IDBRequest': () => Request, | 119 'IDBRequest': () => Request, |
| 121 'IDBTransaction': () => Transaction, | 120 'IDBTransaction': () => Transaction, |
| 122 'IDBVersionChangeEvent': () => VersionChangeEvent, | 121 'IDBVersionChangeEvent': () => VersionChangeEvent, |
| 123 | 122 |
| 124 }; | 123 }; |
| 125 | 124 |
| 126 // FIXME: Can we make this private? | |
| 127 final indexed_dbBlinkFunctionMap = { | |
| 128 'IDBCursor': () => Cursor.internalCreateCursor, | |
| 129 'IDBCursorWithValue': () => CursorWithValue.internalCreateCursorWithValue, | |
| 130 'IDBDatabase': () => Database.internalCreateDatabase, | |
| 131 'IDBFactory': () => IdbFactory.internalCreateIdbFactory, | |
| 132 'IDBIndex': () => Index.internalCreateIndex, | |
| 133 'IDBKeyRange': () => KeyRange.internalCreateKeyRange, | |
| 134 'IDBObjectStore': () => ObjectStore.internalCreateObjectStore, | |
| 135 'IDBOpenDBRequest': () => OpenDBRequest.internalCreateOpenDBRequest, | |
| 136 'IDBRequest': () => Request.internalCreateRequest, | |
| 137 'IDBTransaction': () => Transaction.internalCreateTransaction, | |
| 138 'IDBVersionChangeEvent': () => VersionChangeEvent.internalCreateVersionChangeE
vent, | |
| 139 | |
| 140 }; | |
| 141 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 125 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 142 // for details. All rights reserved. Use of this source code is governed by a | 126 // for details. All rights reserved. Use of this source code is governed by a |
| 143 // BSD-style license that can be found in the LICENSE file. | 127 // BSD-style license that can be found in the LICENSE file. |
| 144 | 128 |
| 145 | 129 |
| 146 @DomName('IDBCursor') | 130 @DomName('IDBCursor') |
| 147 @Unstable() | 131 @Unstable() |
| 148 class Cursor extends NativeFieldWrapperClass2 { | 132 class Cursor extends NativeFieldWrapperClass2 { |
| 149 @DomName('IDBCursor.delete') | 133 @DomName('IDBCursor.delete') |
| 150 Future delete() { | 134 Future delete() { |
| 151 try { | 135 try { |
| 152 return _completeRequest(_delete()); | 136 return _completeRequest(_delete()); |
| 153 } catch (e, stacktrace) { | 137 } catch (e, stacktrace) { |
| 154 return new Future.error(e, stacktrace); | 138 return new Future.error(e, stacktrace); |
| 155 } | 139 } |
| 156 } | 140 } |
| 157 | 141 |
| 158 @DomName('IDBCursor.value') | 142 @DomName('IDBCursor.value') |
| 159 Future update(value) { | 143 Future update(value) { |
| 160 try { | 144 try { |
| 161 return _completeRequest(_update(value)); | 145 return _completeRequest(_update(value)); |
| 162 } catch (e, stacktrace) { | 146 } catch (e, stacktrace) { |
| 163 return new Future.error(e, stacktrace); | 147 return new Future.error(e, stacktrace); |
| 164 } | 148 } |
| 165 } | 149 } |
| 166 | 150 |
| 167 // To suppress missing implicit constructor warnings. | 151 // To suppress missing implicit constructor warnings. |
| 168 factory Cursor._() { throw new UnsupportedError("Not supported"); } | 152 factory Cursor._() { throw new UnsupportedError("Not supported"); } |
| 169 | 153 |
| 170 static Cursor internalCreateCursor() { | |
| 171 return new Cursor._internalWrap(); | |
| 172 } | |
| 173 | |
| 174 js.JsObject blink_jsObject; | |
| 175 | |
| 176 factory Cursor._internalWrap() { | |
| 177 return new Cursor.internal_(); | |
| 178 } | |
| 179 | |
| 180 Cursor.internal_() { } | |
| 181 | |
| 182 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(
this, other); | |
| 183 int get hashCode => unwrap_jso(this).hashCode; | |
| 184 | |
| 185 @DomName('IDBCursor.direction') | 154 @DomName('IDBCursor.direction') |
| 186 @DocsEditable() | 155 @DocsEditable() |
| 187 String get direction => _blink.BlinkIDBCursor.instance.direction_Getter_(unwra
p_jso(this)); | 156 String get direction => _blink.BlinkIDBCursor.instance.direction_Getter_(unwra
p_jso(this)); |
| 188 | 157 |
| 189 @DomName('IDBCursor.key') | 158 @DomName('IDBCursor.key') |
| 190 @DocsEditable() | 159 @DocsEditable() |
| 191 Object get key => wrap_jso(_blink.BlinkIDBCursor.instance.key_Getter_(unwrap_j
so(this))); | 160 Object get key => _blink.BlinkIDBCursor.instance.key_Getter_(unwrap_jso(this))
; |
| 192 | 161 |
| 193 @DomName('IDBCursor.primaryKey') | 162 @DomName('IDBCursor.primaryKey') |
| 194 @DocsEditable() | 163 @DocsEditable() |
| 195 Object get primaryKey => wrap_jso(_blink.BlinkIDBCursor.instance.primaryKey_Ge
tter_(unwrap_jso(this))); | 164 Object get primaryKey => _blink.BlinkIDBCursor.instance.primaryKey_Getter_(unw
rap_jso(this)); |
| 196 | 165 |
| 197 @DomName('IDBCursor.source') | 166 @DomName('IDBCursor.source') |
| 198 @DocsEditable() | 167 @DocsEditable() |
| 199 Object get source => wrap_jso(_blink.BlinkIDBCursor.instance.source_Getter_(un
wrap_jso(this))); | 168 Object get source => _blink.BlinkIDBCursor.instance.source_Getter_(unwrap_jso(
this)); |
| 200 | 169 |
| 201 @DomName('IDBCursor.advance') | 170 @DomName('IDBCursor.advance') |
| 202 @DocsEditable() | 171 @DocsEditable() |
| 203 void advance(int count) => _blink.BlinkIDBCursor.instance.advance_Callback_1_(
unwrap_jso(this), count); | 172 void advance(int count) => _blink.BlinkIDBCursor.instance.advance_Callback_1_(
unwrap_jso(this), count); |
| 204 | 173 |
| 205 @DomName('IDBCursor.continuePrimaryKey') | 174 @DomName('IDBCursor.continuePrimaryKey') |
| 206 @DocsEditable() | 175 @DocsEditable() |
| 207 @Experimental() // untriaged | 176 @Experimental() // untriaged |
| 208 void continuePrimaryKey(Object key, Object primaryKey) => _blink.BlinkIDBCurso
r.instance.continuePrimaryKey_Callback_2_(unwrap_jso(this), key, primaryKey); | 177 void continuePrimaryKey(Object key, Object primaryKey) => _blink.BlinkIDBCurso
r.instance.continuePrimaryKey_Callback_2_(unwrap_jso(this), key, primaryKey); |
| 209 | 178 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 232 // WARNING: Do not edit - generated code. | 201 // WARNING: Do not edit - generated code. |
| 233 | 202 |
| 234 | 203 |
| 235 @DocsEditable() | 204 @DocsEditable() |
| 236 @DomName('IDBCursorWithValue') | 205 @DomName('IDBCursorWithValue') |
| 237 @Unstable() | 206 @Unstable() |
| 238 class CursorWithValue extends Cursor { | 207 class CursorWithValue extends Cursor { |
| 239 // To suppress missing implicit constructor warnings. | 208 // To suppress missing implicit constructor warnings. |
| 240 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); } | 209 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); } |
| 241 | 210 |
| 242 | |
| 243 static CursorWithValue internalCreateCursorWithValue() { | |
| 244 return new CursorWithValue._internalWrap(); | |
| 245 } | |
| 246 | |
| 247 factory CursorWithValue._internalWrap() { | |
| 248 return new CursorWithValue.internal_(); | |
| 249 } | |
| 250 | |
| 251 CursorWithValue.internal_() : super.internal_(); | |
| 252 | |
| 253 | |
| 254 @DomName('IDBCursorWithValue.value') | 211 @DomName('IDBCursorWithValue.value') |
| 255 @DocsEditable() | 212 @DocsEditable() |
| 256 Object get value => wrap_jso(_blink.BlinkIDBCursorWithValue.instance.value_Get
ter_(unwrap_jso(this))); | 213 Object get value => _blink.BlinkIDBCursorWithValue.instance.value_Getter_(unwr
ap_jso(this)); |
| 257 | 214 |
| 258 } | 215 } |
| 259 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 216 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 260 // for details. All rights reserved. Use of this source code is governed by a | 217 // for details. All rights reserved. Use of this source code is governed by a |
| 261 // BSD-style license that can be found in the LICENSE file. | 218 // BSD-style license that can be found in the LICENSE file. |
| 262 | 219 |
| 263 | 220 |
| 264 @DocsEditable() | 221 @DocsEditable() |
| 265 /** | 222 /** |
| 266 * An indexed database object for storing client-side data | 223 * An indexed database object for storing client-side data |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 /** | 284 /** |
| 328 * Static factory designed to expose `versionchange` events to event | 285 * Static factory designed to expose `versionchange` events to event |
| 329 * handlers that are not necessarily instances of [Database]. | 286 * handlers that are not necessarily instances of [Database]. |
| 330 * | 287 * |
| 331 * See [EventStreamProvider] for usage information. | 288 * See [EventStreamProvider] for usage information. |
| 332 */ | 289 */ |
| 333 @DomName('IDBDatabase.versionchangeEvent') | 290 @DomName('IDBDatabase.versionchangeEvent') |
| 334 @DocsEditable() | 291 @DocsEditable() |
| 335 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons
t EventStreamProvider<VersionChangeEvent>('versionchange'); | 292 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons
t EventStreamProvider<VersionChangeEvent>('versionchange'); |
| 336 | 293 |
| 337 | |
| 338 static Database internalCreateDatabase() { | |
| 339 return new Database._internalWrap(); | |
| 340 } | |
| 341 | |
| 342 factory Database._internalWrap() { | |
| 343 return new Database.internal_(); | |
| 344 } | |
| 345 | |
| 346 Database.internal_() : super.internal_(); | |
| 347 | |
| 348 | |
| 349 @DomName('IDBDatabase.name') | 294 @DomName('IDBDatabase.name') |
| 350 @DocsEditable() | 295 @DocsEditable() |
| 351 String get name => _blink.BlinkIDBDatabase.instance.name_Getter_(unwrap_jso(th
is)); | 296 String get name => _blink.BlinkIDBDatabase.instance.name_Getter_(unwrap_jso(th
is)); |
| 352 | 297 |
| 353 @DomName('IDBDatabase.objectStoreNames') | 298 @DomName('IDBDatabase.objectStoreNames') |
| 354 @DocsEditable() | 299 @DocsEditable() |
| 355 List<String> get objectStoreNames => _blink.BlinkIDBDatabase.instance.objectSt
oreNames_Getter_(unwrap_jso(this)); | 300 List<String> get objectStoreNames => _blink.BlinkIDBDatabase.instance.objectSt
oreNames_Getter_(unwrap_jso(this)); |
| 356 | 301 |
| 357 @DomName('IDBDatabase.version') | 302 @DomName('IDBDatabase.version') |
| 358 @DocsEditable() | 303 @DocsEditable() |
| 359 Object get version => wrap_jso(_blink.BlinkIDBDatabase.instance.version_Getter
_(unwrap_jso(this))); | 304 Object get version => _blink.BlinkIDBDatabase.instance.version_Getter_(unwrap_
jso(this)); |
| 360 | 305 |
| 361 @DomName('IDBDatabase.close') | 306 @DomName('IDBDatabase.close') |
| 362 @DocsEditable() | 307 @DocsEditable() |
| 363 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(unwrap_jso(
this)); | 308 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(unwrap_jso(
this)); |
| 364 | 309 |
| 365 ObjectStore _createObjectStore(String name, [Map options]) { | 310 ObjectStore _createObjectStore(String name, [Map options]) { |
| 366 if (options != null) { | 311 if (options != null) { |
| 367 return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callbac
k_2_(unwrap_jso(this), name, options != null ? new js.JsObject.jsify(options) :
options)); | 312 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_2_(unwr
ap_jso(this), name, options); |
| 368 } | 313 } |
| 369 return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callback_
1_(unwrap_jso(this), name)); | 314 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_1_(unwrap
_jso(this), name); |
| 370 } | 315 } |
| 371 | 316 |
| 372 @DomName('IDBDatabase.deleteObjectStore') | 317 @DomName('IDBDatabase.deleteObjectStore') |
| 373 @DocsEditable() | 318 @DocsEditable() |
| 374 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete
ObjectStore_Callback_1_(unwrap_jso(this), name); | 319 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete
ObjectStore_Callback_1_(unwrap_jso(this), name); |
| 375 | 320 |
| 376 Transaction transaction(storeName_OR_storeNames, [String mode]) { | 321 Transaction transaction(storeName_OR_storeNames, [String mode]) { |
| 377 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) &
& mode == null) { | 322 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) &
& mode == null) { |
| 378 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(u
nwrap_jso(this), unwrap_jso(storeName_OR_storeNames))); | 323 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso
(this), unwrap_jso(storeName_OR_storeNames)); |
| 379 } | 324 } |
| 380 if ((mode is String || mode == null) && (storeName_OR_storeNames is String |
| storeName_OR_storeNames == null)) { | 325 if ((mode is String || mode == null) && (storeName_OR_storeNames is String |
| storeName_OR_storeNames == null)) { |
| 381 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u
nwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode)); | 326 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso
(this), unwrap_jso(storeName_OR_storeNames), mode); |
| 382 } | 327 } |
| 383 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n
ull) && mode == null) { | 328 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n
ull) && mode == null) { |
| 384 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(u
nwrap_jso(this), unwrap_jso(storeName_OR_storeNames))); | 329 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso
(this), unwrap_jso(storeName_OR_storeNames)); |
| 385 } | 330 } |
| 386 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str
ing> || storeName_OR_storeNames == null)) { | 331 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str
ing> || storeName_OR_storeNames == null)) { |
| 387 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u
nwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode)); | 332 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso
(this), unwrap_jso(storeName_OR_storeNames), mode); |
| 388 } | 333 } |
| 389 if ((storeName_OR_storeNames is DomStringList || storeName_OR_storeNames ==
null) && mode == null) { | 334 if ((storeName_OR_storeNames is DomStringList || storeName_OR_storeNames ==
null) && mode == null) { |
| 390 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(u
nwrap_jso(this), unwrap_jso(storeName_OR_storeNames))); | 335 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso
(this), unwrap_jso(storeName_OR_storeNames)); |
| 391 } | 336 } |
| 392 if ((mode is String || mode == null) && (storeName_OR_storeNames is DomStrin
gList || storeName_OR_storeNames == null)) { | 337 if ((mode is String || mode == null) && (storeName_OR_storeNames is DomStrin
gList || storeName_OR_storeNames == null)) { |
| 393 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u
nwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode)); | 338 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso
(this), unwrap_jso(storeName_OR_storeNames), mode); |
| 394 } | 339 } |
| 395 throw new ArgumentError("Incorrect number or type of arguments"); | 340 throw new ArgumentError("Incorrect number or type of arguments"); |
| 396 } | 341 } |
| 397 | 342 |
| 398 Transaction transactionList(List<String> storeNames, [String mode]) { | 343 Transaction transactionList(List<String> storeNames, [String mode]) { |
| 399 if (mode != null) { | 344 if (mode != null) { |
| 400 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u
nwrap_jso(this), storeNames, mode)); | 345 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso
(this), storeNames, mode); |
| 401 } | 346 } |
| 402 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unw
rap_jso(this), storeNames)); | 347 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(t
his), storeNames); |
| 403 } | 348 } |
| 404 | 349 |
| 405 Transaction transactionStore(String storeName, [String mode]) { | 350 Transaction transactionStore(String storeName, [String mode]) { |
| 406 if (mode != null) { | 351 if (mode != null) { |
| 407 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u
nwrap_jso(this), storeName, mode)); | 352 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso
(this), storeName, mode); |
| 408 } | 353 } |
| 409 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unw
rap_jso(this), storeName)); | 354 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(t
his), storeName); |
| 410 } | 355 } |
| 411 | 356 |
| 412 Transaction transactionStores(List<String> storeNames, [String mode]) { | 357 Transaction transactionStores(List<String> storeNames, [String mode]) { |
| 413 if (mode != null) { | 358 if (mode != null) { |
| 414 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u
nwrap_jso(this), unwrap_jso(storeNames), mode)); | 359 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso
(this), unwrap_jso(storeNames), mode); |
| 415 } | 360 } |
| 416 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unw
rap_jso(this), unwrap_jso(storeNames))); | 361 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(t
his), unwrap_jso(storeNames)); |
| 417 } | 362 } |
| 418 | 363 |
| 419 /// Stream of `abort` events handled by this [Database]. | 364 /// Stream of `abort` events handled by this [Database]. |
| 420 @DomName('IDBDatabase.onabort') | 365 @DomName('IDBDatabase.onabort') |
| 421 @DocsEditable() | 366 @DocsEditable() |
| 422 Stream<Event> get onAbort => abortEvent.forTarget(this); | 367 Stream<Event> get onAbort => abortEvent.forTarget(this); |
| 423 | 368 |
| 424 /// Stream of `close` events handled by this [Database]. | 369 /// Stream of `close` events handled by this [Database]. |
| 425 @DomName('IDBDatabase.onclose') | 370 @DomName('IDBDatabase.onclose') |
| 426 @DocsEditable() | 371 @DocsEditable() |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 /** | 466 /** |
| 522 * Checks to see if getDatabaseNames is supported by the current platform. | 467 * Checks to see if getDatabaseNames is supported by the current platform. |
| 523 */ | 468 */ |
| 524 bool get supportsDatabaseNames { | 469 bool get supportsDatabaseNames { |
| 525 return true; | 470 return true; |
| 526 } | 471 } |
| 527 | 472 |
| 528 // To suppress missing implicit constructor warnings. | 473 // To suppress missing implicit constructor warnings. |
| 529 factory IdbFactory._() { throw new UnsupportedError("Not supported"); } | 474 factory IdbFactory._() { throw new UnsupportedError("Not supported"); } |
| 530 | 475 |
| 531 static IdbFactory internalCreateIdbFactory() { | |
| 532 return new IdbFactory._internalWrap(); | |
| 533 } | |
| 534 | |
| 535 js.JsObject blink_jsObject; | |
| 536 | |
| 537 factory IdbFactory._internalWrap() { | |
| 538 return new IdbFactory.internal_(); | |
| 539 } | |
| 540 | |
| 541 IdbFactory.internal_() { } | |
| 542 | |
| 543 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(
this, other); | |
| 544 int get hashCode => unwrap_jso(this).hashCode; | |
| 545 | |
| 546 @DomName('IDBFactory.cmp') | 476 @DomName('IDBFactory.cmp') |
| 547 @DocsEditable() | 477 @DocsEditable() |
| 548 int cmp(Object first, Object second) => _blink.BlinkIDBFactory.instance.cmp_Ca
llback_2_(unwrap_jso(this), first, second); | 478 int cmp(Object first, Object second) => _blink.BlinkIDBFactory.instance.cmp_Ca
llback_2_(unwrap_jso(this), first, second); |
| 549 | 479 |
| 550 @DomName('IDBFactory.deleteDatabase') | 480 @DomName('IDBFactory.deleteDatabase') |
| 551 @DocsEditable() | 481 @DocsEditable() |
| 552 OpenDBRequest _deleteDatabase(String name) => wrap_jso(_blink.BlinkIDBFactory.
instance.deleteDatabase_Callback_1_(unwrap_jso(this), name)); | 482 OpenDBRequest _deleteDatabase(String name) => _blink.BlinkIDBFactory.instance.
deleteDatabase_Callback_1_(unwrap_jso(this), name); |
| 553 | 483 |
| 554 OpenDBRequest _open(String name, [int version]) { | 484 OpenDBRequest _open(String name, [int version]) { |
| 555 if (version != null) { | 485 if (version != null) { |
| 556 return wrap_jso(_blink.BlinkIDBFactory.instance.open_Callback_2_(unwrap_js
o(this), name, version)); | 486 return _blink.BlinkIDBFactory.instance.open_Callback_2_(unwrap_jso(this),
name, version); |
| 557 } | 487 } |
| 558 return wrap_jso(_blink.BlinkIDBFactory.instance.open_Callback_1_(unwrap_jso(
this), name)); | 488 return _blink.BlinkIDBFactory.instance.open_Callback_1_(unwrap_jso(this), na
me); |
| 559 } | 489 } |
| 560 | 490 |
| 561 @DomName('IDBFactory.webkitGetDatabaseNames') | 491 @DomName('IDBFactory.webkitGetDatabaseNames') |
| 562 @DocsEditable() | 492 @DocsEditable() |
| 563 @SupportedBrowser(SupportedBrowser.CHROME) | 493 @SupportedBrowser(SupportedBrowser.CHROME) |
| 564 @SupportedBrowser(SupportedBrowser.SAFARI) | 494 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 565 @Experimental() | 495 @Experimental() |
| 566 Request _webkitGetDatabaseNames() => wrap_jso(_blink.BlinkIDBFactory.instance.
webkitGetDatabaseNames_Callback_0_(unwrap_jso(this))); | 496 Request _webkitGetDatabaseNames() => wrap_jso(_blink.BlinkIDBFactory.instance.
webkitGetDatabaseNames_Callback_0_(unwrap_jso(this))); |
| 567 | 497 |
| 568 } | 498 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 request = _openKeyCursor(key_OR_range, "next"); | 604 request = _openKeyCursor(key_OR_range, "next"); |
| 675 } else { | 605 } else { |
| 676 request = _openKeyCursor(key_OR_range, direction); | 606 request = _openKeyCursor(key_OR_range, direction); |
| 677 } | 607 } |
| 678 return ObjectStore._cursorStreamFromResult(request, autoAdvance); | 608 return ObjectStore._cursorStreamFromResult(request, autoAdvance); |
| 679 } | 609 } |
| 680 | 610 |
| 681 // To suppress missing implicit constructor warnings. | 611 // To suppress missing implicit constructor warnings. |
| 682 factory Index._() { throw new UnsupportedError("Not supported"); } | 612 factory Index._() { throw new UnsupportedError("Not supported"); } |
| 683 | 613 |
| 684 static Index internalCreateIndex() { | |
| 685 return new Index._internalWrap(); | |
| 686 } | |
| 687 | |
| 688 js.JsObject blink_jsObject; | |
| 689 | |
| 690 factory Index._internalWrap() { | |
| 691 return new Index.internal_(); | |
| 692 } | |
| 693 | |
| 694 Index.internal_() { } | |
| 695 | |
| 696 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(
this, other); | |
| 697 int get hashCode => unwrap_jso(this).hashCode; | |
| 698 | |
| 699 @DomName('IDBIndex.keyPath') | 614 @DomName('IDBIndex.keyPath') |
| 700 @DocsEditable() | 615 @DocsEditable() |
| 701 Object get keyPath => wrap_jso(_blink.BlinkIDBIndex.instance.keyPath_Getter_(u
nwrap_jso(this))); | 616 Object get keyPath => _blink.BlinkIDBIndex.instance.keyPath_Getter_(unwrap_jso
(this)); |
| 702 | 617 |
| 703 @DomName('IDBIndex.multiEntry') | 618 @DomName('IDBIndex.multiEntry') |
| 704 @DocsEditable() | 619 @DocsEditable() |
| 705 bool get multiEntry => _blink.BlinkIDBIndex.instance.multiEntry_Getter_(unwrap
_jso(this)); | 620 bool get multiEntry => _blink.BlinkIDBIndex.instance.multiEntry_Getter_(unwrap
_jso(this)); |
| 706 | 621 |
| 707 @DomName('IDBIndex.name') | 622 @DomName('IDBIndex.name') |
| 708 @DocsEditable() | 623 @DocsEditable() |
| 709 String get name => _blink.BlinkIDBIndex.instance.name_Getter_(unwrap_jso(this)
); | 624 String get name => _blink.BlinkIDBIndex.instance.name_Getter_(unwrap_jso(this)
); |
| 710 | 625 |
| 711 @DomName('IDBIndex.objectStore') | 626 @DomName('IDBIndex.objectStore') |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 | 680 |
| 766 @DomName('KeyRange.bound') | 681 @DomName('KeyRange.bound') |
| 767 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, | 682 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, |
| 768 [bool lowerOpen = false, bool upperOpen = false]) => | 683 [bool lowerOpen = false, bool upperOpen = false]) => |
| 769 _KeyRangeFactoryProvider.createKeyRange_bound( | 684 _KeyRangeFactoryProvider.createKeyRange_bound( |
| 770 lower, upper, lowerOpen, upperOpen); | 685 lower, upper, lowerOpen, upperOpen); |
| 771 | 686 |
| 772 // To suppress missing implicit constructor warnings. | 687 // To suppress missing implicit constructor warnings. |
| 773 factory KeyRange._() { throw new UnsupportedError("Not supported"); } | 688 factory KeyRange._() { throw new UnsupportedError("Not supported"); } |
| 774 | 689 |
| 775 static KeyRange internalCreateKeyRange() { | |
| 776 return new KeyRange._internalWrap(); | |
| 777 } | |
| 778 | |
| 779 js.JsObject blink_jsObject; | |
| 780 | |
| 781 factory KeyRange._internalWrap() { | |
| 782 return new KeyRange.internal_(); | |
| 783 } | |
| 784 | |
| 785 KeyRange.internal_() { } | |
| 786 | |
| 787 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(
this, other); | |
| 788 int get hashCode => unwrap_jso(this).hashCode; | |
| 789 | |
| 790 @DomName('IDBKeyRange.lower') | 690 @DomName('IDBKeyRange.lower') |
| 791 @DocsEditable() | 691 @DocsEditable() |
| 792 Object get lower => wrap_jso(_blink.BlinkIDBKeyRange.instance.lower_Getter_(un
wrap_jso(this))); | 692 Object get lower => _blink.BlinkIDBKeyRange.instance.lower_Getter_(unwrap_jso(
this)); |
| 793 | 693 |
| 794 @DomName('IDBKeyRange.lowerOpen') | 694 @DomName('IDBKeyRange.lowerOpen') |
| 795 @DocsEditable() | 695 @DocsEditable() |
| 796 bool get lowerOpen => _blink.BlinkIDBKeyRange.instance.lowerOpen_Getter_(unwra
p_jso(this)); | 696 bool get lowerOpen => _blink.BlinkIDBKeyRange.instance.lowerOpen_Getter_(unwra
p_jso(this)); |
| 797 | 697 |
| 798 @DomName('IDBKeyRange.upper') | 698 @DomName('IDBKeyRange.upper') |
| 799 @DocsEditable() | 699 @DocsEditable() |
| 800 Object get upper => wrap_jso(_blink.BlinkIDBKeyRange.instance.upper_Getter_(un
wrap_jso(this))); | 700 Object get upper => _blink.BlinkIDBKeyRange.instance.upper_Getter_(unwrap_jso(
this)); |
| 801 | 701 |
| 802 @DomName('IDBKeyRange.upperOpen') | 702 @DomName('IDBKeyRange.upperOpen') |
| 803 @DocsEditable() | 703 @DocsEditable() |
| 804 bool get upperOpen => _blink.BlinkIDBKeyRange.instance.upperOpen_Getter_(unwra
p_jso(this)); | 704 bool get upperOpen => _blink.BlinkIDBKeyRange.instance.upperOpen_Getter_(unwra
p_jso(this)); |
| 805 | 705 |
| 806 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper
Open]) { | 706 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper
Open]) { |
| 807 if (upperOpen != null) { | 707 if (upperOpen != null) { |
| 808 return wrap_jso(_blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower,
upper, lowerOpen, upperOpen)); | 708 return _blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower, upper, lo
werOpen, upperOpen); |
| 809 } | 709 } |
| 810 if (lowerOpen != null) { | 710 if (lowerOpen != null) { |
| 811 return wrap_jso(_blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower,
upper, lowerOpen)); | 711 return _blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower, upper, lo
werOpen); |
| 812 } | 712 } |
| 813 return wrap_jso(_blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, up
per)); | 713 return _blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, upper); |
| 814 } | 714 } |
| 815 | 715 |
| 816 static KeyRange lowerBound_(Object bound, [bool open]) { | 716 static KeyRange lowerBound_(Object bound, [bool open]) { |
| 817 if (open != null) { | 717 if (open != null) { |
| 818 return wrap_jso(_blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bo
und, open)); | 718 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bound, open
); |
| 819 } | 719 } |
| 820 return wrap_jso(_blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(boun
d)); | 720 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(bound); |
| 821 } | 721 } |
| 822 | 722 |
| 823 @DomName('IDBKeyRange.only_') | 723 @DomName('IDBKeyRange.only_') |
| 824 @DocsEditable() | 724 @DocsEditable() |
| 825 @Experimental() // non-standard | 725 @Experimental() // non-standard |
| 826 static KeyRange only_(Object value) => wrap_jso(_blink.BlinkIDBKeyRange.instan
ce.only_Callback_1_(value)); | 726 static KeyRange only_(Object value) => _blink.BlinkIDBKeyRange.instance.only_C
allback_1_(value); |
| 827 | 727 |
| 828 static KeyRange upperBound_(Object bound, [bool open]) { | 728 static KeyRange upperBound_(Object bound, [bool open]) { |
| 829 if (open != null) { | 729 if (open != null) { |
| 830 return wrap_jso(_blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bo
und, open)); | 730 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bound, open
); |
| 831 } | 731 } |
| 832 return wrap_jso(_blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(boun
d)); | 732 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(bound); |
| 833 } | 733 } |
| 834 | 734 |
| 835 } | 735 } |
| 836 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 736 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 837 // for details. All rights reserved. Use of this source code is governed by a | 737 // for details. All rights reserved. Use of this source code is governed by a |
| 838 // BSD-style license that can be found in the LICENSE file. | 738 // BSD-style license that can be found in the LICENSE file. |
| 839 | 739 |
| 840 | 740 |
| 841 @DomName('IDBObjectStore') | 741 @DomName('IDBObjectStore') |
| 842 @Unstable() | 742 @Unstable() |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 if (multiEntry != null) { | 864 if (multiEntry != null) { |
| 965 options['multiEntry'] = multiEntry; | 865 options['multiEntry'] = multiEntry; |
| 966 } | 866 } |
| 967 | 867 |
| 968 return _createIndex(name, keyPath, options); | 868 return _createIndex(name, keyPath, options); |
| 969 } | 869 } |
| 970 | 870 |
| 971 // To suppress missing implicit constructor warnings. | 871 // To suppress missing implicit constructor warnings. |
| 972 factory ObjectStore._() { throw new UnsupportedError("Not supported"); } | 872 factory ObjectStore._() { throw new UnsupportedError("Not supported"); } |
| 973 | 873 |
| 974 static ObjectStore internalCreateObjectStore() { | |
| 975 return new ObjectStore._internalWrap(); | |
| 976 } | |
| 977 | |
| 978 js.JsObject blink_jsObject; | |
| 979 | |
| 980 factory ObjectStore._internalWrap() { | |
| 981 return new ObjectStore.internal_(); | |
| 982 } | |
| 983 | |
| 984 ObjectStore.internal_() { } | |
| 985 | |
| 986 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(
this, other); | |
| 987 int get hashCode => unwrap_jso(this).hashCode; | |
| 988 | |
| 989 @DomName('IDBObjectStore.autoIncrement') | 874 @DomName('IDBObjectStore.autoIncrement') |
| 990 @DocsEditable() | 875 @DocsEditable() |
| 991 bool get autoIncrement => _blink.BlinkIDBObjectStore.instance.autoIncrement_Ge
tter_(unwrap_jso(this)); | 876 bool get autoIncrement => _blink.BlinkIDBObjectStore.instance.autoIncrement_Ge
tter_(unwrap_jso(this)); |
| 992 | 877 |
| 993 @DomName('IDBObjectStore.indexNames') | 878 @DomName('IDBObjectStore.indexNames') |
| 994 @DocsEditable() | 879 @DocsEditable() |
| 995 List<String> get indexNames => _blink.BlinkIDBObjectStore.instance.indexNames_
Getter_(unwrap_jso(this)); | 880 List<String> get indexNames => _blink.BlinkIDBObjectStore.instance.indexNames_
Getter_(unwrap_jso(this)); |
| 996 | 881 |
| 997 @DomName('IDBObjectStore.keyPath') | 882 @DomName('IDBObjectStore.keyPath') |
| 998 @DocsEditable() | 883 @DocsEditable() |
| 999 Object get keyPath => wrap_jso(_blink.BlinkIDBObjectStore.instance.keyPath_Get
ter_(unwrap_jso(this))); | 884 Object get keyPath => _blink.BlinkIDBObjectStore.instance.keyPath_Getter_(unwr
ap_jso(this)); |
| 1000 | 885 |
| 1001 @DomName('IDBObjectStore.name') | 886 @DomName('IDBObjectStore.name') |
| 1002 @DocsEditable() | 887 @DocsEditable() |
| 1003 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(unwrap_jso
(this)); | 888 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(unwrap_jso
(this)); |
| 1004 | 889 |
| 1005 @DomName('IDBObjectStore.transaction') | 890 @DomName('IDBObjectStore.transaction') |
| 1006 @DocsEditable() | 891 @DocsEditable() |
| 1007 Transaction get transaction => wrap_jso(_blink.BlinkIDBObjectStore.instance.tr
ansaction_Getter_(unwrap_jso(this))); | 892 Transaction get transaction => wrap_jso(_blink.BlinkIDBObjectStore.instance.tr
ansaction_Getter_(unwrap_jso(this))); |
| 1008 | 893 |
| 1009 Request _add(Object value, [Object key]) { | 894 Request _add(Object value, [Object key]) { |
| 1010 if (key != null) { | 895 if (key != null) { |
| 1011 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_2_(unwrap
_jso(this), value, key)); | 896 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_2_(unwrap
_jso(this), value, key)); |
| 1012 } | 897 } |
| 1013 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_1_(unwrap_j
so(this), value)); | 898 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_1_(unwrap_j
so(this), value)); |
| 1014 } | 899 } |
| 1015 | 900 |
| 1016 @DomName('IDBObjectStore.clear') | 901 @DomName('IDBObjectStore.clear') |
| 1017 @DocsEditable() | 902 @DocsEditable() |
| 1018 Request _clear() => wrap_jso(_blink.BlinkIDBObjectStore.instance.clear_Callbac
k_0_(unwrap_jso(this))); | 903 Request _clear() => wrap_jso(_blink.BlinkIDBObjectStore.instance.clear_Callbac
k_0_(unwrap_jso(this))); |
| 1019 | 904 |
| 1020 @DomName('IDBObjectStore.count') | 905 @DomName('IDBObjectStore.count') |
| 1021 @DocsEditable() | 906 @DocsEditable() |
| 1022 Request _count(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.cou
nt_Callback_1_(unwrap_jso(this), key)); | 907 Request _count(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.cou
nt_Callback_1_(unwrap_jso(this), key)); |
| 1023 | 908 |
| 1024 Index _createIndex(String name, keyPath, [Map options]) { | 909 Index _createIndex(String name, keyPath, [Map options]) { |
| 1025 if ((keyPath is String || keyPath == null) && (name is String || name == nul
l) && options == null) { | 910 if ((keyPath is String || keyPath == null) && (name is String || name == nul
l) && options == null) { |
| 1026 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_2
_(unwrap_jso(this), name, unwrap_jso(keyPath))); | 911 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_
jso(this), name, unwrap_jso(keyPath)); |
| 1027 } | 912 } |
| 1028 if ((options is Map || options == null) && (keyPath is String || keyPath ==
null) && (name is String || name == null)) { | 913 if ((options is Map || options == null) && (keyPath is String || keyPath ==
null) && (name is String || name == null)) { |
| 1029 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_3
_(unwrap_jso(this), name, unwrap_jso(keyPath), options != null ? new js.JsObject
.jsify(options) : options)); | 914 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_
jso(this), name, unwrap_jso(keyPath), options); |
| 1030 } | 915 } |
| 1031 if ((keyPath is List<String> || keyPath == null) && (name is String || name
== null) && options == null) { | 916 if ((keyPath is List<String> || keyPath == null) && (name is String || name
== null) && options == null) { |
| 1032 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_2
_(unwrap_jso(this), name, unwrap_jso(keyPath))); | 917 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_
jso(this), name, unwrap_jso(keyPath)); |
| 1033 } | 918 } |
| 1034 if ((options is Map || options == null) && (keyPath is List<String> || keyPa
th == null) && (name is String || name == null)) { | 919 if ((options is Map || options == null) && (keyPath is List<String> || keyPa
th == null) && (name is String || name == null)) { |
| 1035 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_3
_(unwrap_jso(this), name, unwrap_jso(keyPath), options != null ? new js.JsObject
.jsify(options) : options)); | 920 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_
jso(this), name, unwrap_jso(keyPath), options); |
| 1036 } | 921 } |
| 1037 throw new ArgumentError("Incorrect number or type of arguments"); | 922 throw new ArgumentError("Incorrect number or type of arguments"); |
| 1038 } | 923 } |
| 1039 | 924 |
| 1040 @DomName('IDBObjectStore.delete') | 925 @DomName('IDBObjectStore.delete') |
| 1041 @DocsEditable() | 926 @DocsEditable() |
| 1042 Request _delete(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.de
lete_Callback_1_(unwrap_jso(this), key)); | 927 Request _delete(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.de
lete_Callback_1_(unwrap_jso(this), key)); |
| 1043 | 928 |
| 1044 @DomName('IDBObjectStore.deleteIndex') | 929 @DomName('IDBObjectStore.deleteIndex') |
| 1045 @DocsEditable() | 930 @DocsEditable() |
| 1046 void deleteIndex(String name) => _blink.BlinkIDBObjectStore.instance.deleteInd
ex_Callback_1_(unwrap_jso(this), name); | 931 void deleteIndex(String name) => _blink.BlinkIDBObjectStore.instance.deleteInd
ex_Callback_1_(unwrap_jso(this), name); |
| 1047 | 932 |
| 1048 @DomName('IDBObjectStore.get') | 933 @DomName('IDBObjectStore.get') |
| 1049 @DocsEditable() | 934 @DocsEditable() |
| 1050 Request _get(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.get_C
allback_1_(unwrap_jso(this), key)); | 935 Request _get(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.get_C
allback_1_(unwrap_jso(this), key)); |
| 1051 | 936 |
| 1052 @DomName('IDBObjectStore.index') | 937 @DomName('IDBObjectStore.index') |
| 1053 @DocsEditable() | 938 @DocsEditable() |
| 1054 Index index(String name) => wrap_jso(_blink.BlinkIDBObjectStore.instance.index
_Callback_1_(unwrap_jso(this), name)); | 939 Index index(String name) => _blink.BlinkIDBObjectStore.instance.index_Callback
_1_(unwrap_jso(this), name); |
| 1055 | 940 |
| 1056 Request _openCursor(Object range, [String direction]) { | 941 Request _openCursor(Object range, [String direction]) { |
| 1057 if (direction != null) { | 942 if (direction != null) { |
| 1058 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_2_
(unwrap_jso(this), range, direction)); | 943 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_2_
(unwrap_jso(this), range, direction)); |
| 1059 } | 944 } |
| 1060 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_1_(u
nwrap_jso(this), range)); | 945 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_1_(u
nwrap_jso(this), range)); |
| 1061 } | 946 } |
| 1062 | 947 |
| 1063 Request openKeyCursor(Object range, [String direction]) { | 948 Request openKeyCursor(Object range, [String direction]) { |
| 1064 if (direction != null) { | 949 if (direction != null) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1129 /** | 1014 /** |
| 1130 * Static factory designed to expose `upgradeneeded` events to event | 1015 * Static factory designed to expose `upgradeneeded` events to event |
| 1131 * handlers that are not necessarily instances of [OpenDBRequest]. | 1016 * handlers that are not necessarily instances of [OpenDBRequest]. |
| 1132 * | 1017 * |
| 1133 * See [EventStreamProvider] for usage information. | 1018 * See [EventStreamProvider] for usage information. |
| 1134 */ | 1019 */ |
| 1135 @DomName('IDBOpenDBRequest.upgradeneededEvent') | 1020 @DomName('IDBOpenDBRequest.upgradeneededEvent') |
| 1136 @DocsEditable() | 1021 @DocsEditable() |
| 1137 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons
t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); | 1022 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons
t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); |
| 1138 | 1023 |
| 1139 | |
| 1140 static OpenDBRequest internalCreateOpenDBRequest() { | |
| 1141 return new OpenDBRequest._internalWrap(); | |
| 1142 } | |
| 1143 | |
| 1144 factory OpenDBRequest._internalWrap() { | |
| 1145 return new OpenDBRequest.internal_(); | |
| 1146 } | |
| 1147 | |
| 1148 OpenDBRequest.internal_() : super.internal_(); | |
| 1149 | |
| 1150 | |
| 1151 /// Stream of `blocked` events handled by this [OpenDBRequest]. | 1024 /// Stream of `blocked` events handled by this [OpenDBRequest]. |
| 1152 @DomName('IDBOpenDBRequest.onblocked') | 1025 @DomName('IDBOpenDBRequest.onblocked') |
| 1153 @DocsEditable() | 1026 @DocsEditable() |
| 1154 Stream<Event> get onBlocked => blockedEvent.forTarget(this); | 1027 Stream<Event> get onBlocked => blockedEvent.forTarget(this); |
| 1155 | 1028 |
| 1156 /// Stream of `upgradeneeded` events handled by this [OpenDBRequest]. | 1029 /// Stream of `upgradeneeded` events handled by this [OpenDBRequest]. |
| 1157 @DomName('IDBOpenDBRequest.onupgradeneeded') | 1030 @DomName('IDBOpenDBRequest.onupgradeneeded') |
| 1158 @DocsEditable() | 1031 @DocsEditable() |
| 1159 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget
(this); | 1032 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget
(this); |
| 1160 | 1033 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1186 /** | 1059 /** |
| 1187 * Static factory designed to expose `success` events to event | 1060 * Static factory designed to expose `success` events to event |
| 1188 * handlers that are not necessarily instances of [Request]. | 1061 * handlers that are not necessarily instances of [Request]. |
| 1189 * | 1062 * |
| 1190 * See [EventStreamProvider] for usage information. | 1063 * See [EventStreamProvider] for usage information. |
| 1191 */ | 1064 */ |
| 1192 @DomName('IDBRequest.successEvent') | 1065 @DomName('IDBRequest.successEvent') |
| 1193 @DocsEditable() | 1066 @DocsEditable() |
| 1194 static const EventStreamProvider<Event> successEvent = const EventStreamProvid
er<Event>('success'); | 1067 static const EventStreamProvider<Event> successEvent = const EventStreamProvid
er<Event>('success'); |
| 1195 | 1068 |
| 1196 | |
| 1197 static Request internalCreateRequest() { | |
| 1198 return new Request._internalWrap(); | |
| 1199 } | |
| 1200 | |
| 1201 factory Request._internalWrap() { | |
| 1202 return new Request.internal_(); | |
| 1203 } | |
| 1204 | |
| 1205 Request.internal_() : super.internal_(); | |
| 1206 | |
| 1207 | |
| 1208 @DomName('IDBRequest.error') | 1069 @DomName('IDBRequest.error') |
| 1209 @DocsEditable() | 1070 @DocsEditable() |
| 1210 DomError get error => wrap_jso(_blink.BlinkIDBRequest.instance.error_Getter_(u
nwrap_jso(this))); | 1071 DomError get error => wrap_jso(_blink.BlinkIDBRequest.instance.error_Getter_(u
nwrap_jso(this))); |
| 1211 | 1072 |
| 1212 @DomName('IDBRequest.readyState') | 1073 @DomName('IDBRequest.readyState') |
| 1213 @DocsEditable() | 1074 @DocsEditable() |
| 1214 String get readyState => _blink.BlinkIDBRequest.instance.readyState_Getter_(un
wrap_jso(this)); | 1075 String get readyState => _blink.BlinkIDBRequest.instance.readyState_Getter_(un
wrap_jso(this)); |
| 1215 | 1076 |
| 1216 @DomName('IDBRequest.result') | 1077 @DomName('IDBRequest.result') |
| 1217 @DocsEditable() | 1078 @DocsEditable() |
| 1218 Object get result => wrap_jso(_blink.BlinkIDBRequest.instance.result_Getter_(u
nwrap_jso(this))); | 1079 Object get result => _blink.BlinkIDBRequest.instance.result_Getter_(unwrap_jso
(this)); |
| 1219 | 1080 |
| 1220 @DomName('IDBRequest.source') | 1081 @DomName('IDBRequest.source') |
| 1221 @DocsEditable() | 1082 @DocsEditable() |
| 1222 Object get source => wrap_jso(_blink.BlinkIDBRequest.instance.source_Getter_(u
nwrap_jso(this))); | 1083 Object get source => _blink.BlinkIDBRequest.instance.source_Getter_(unwrap_jso
(this)); |
| 1223 | 1084 |
| 1224 @DomName('IDBRequest.transaction') | 1085 @DomName('IDBRequest.transaction') |
| 1225 @DocsEditable() | 1086 @DocsEditable() |
| 1226 Transaction get transaction => wrap_jso(_blink.BlinkIDBRequest.instance.transa
ction_Getter_(unwrap_jso(this))); | 1087 Transaction get transaction => wrap_jso(_blink.BlinkIDBRequest.instance.transa
ction_Getter_(unwrap_jso(this))); |
| 1227 | 1088 |
| 1228 /// Stream of `error` events handled by this [Request]. | 1089 /// Stream of `error` events handled by this [Request]. |
| 1229 @DomName('IDBRequest.onerror') | 1090 @DomName('IDBRequest.onerror') |
| 1230 @DocsEditable() | 1091 @DocsEditable() |
| 1231 Stream<Event> get onError => errorEvent.forTarget(this); | 1092 Stream<Event> get onError => errorEvent.forTarget(this); |
| 1232 | 1093 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 /** | 1160 /** |
| 1300 * Static factory designed to expose `error` events to event | 1161 * Static factory designed to expose `error` events to event |
| 1301 * handlers that are not necessarily instances of [Transaction]. | 1162 * handlers that are not necessarily instances of [Transaction]. |
| 1302 * | 1163 * |
| 1303 * See [EventStreamProvider] for usage information. | 1164 * See [EventStreamProvider] for usage information. |
| 1304 */ | 1165 */ |
| 1305 @DomName('IDBTransaction.errorEvent') | 1166 @DomName('IDBTransaction.errorEvent') |
| 1306 @DocsEditable() | 1167 @DocsEditable() |
| 1307 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); | 1168 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); |
| 1308 | 1169 |
| 1309 | |
| 1310 static Transaction internalCreateTransaction() { | |
| 1311 return new Transaction._internalWrap(); | |
| 1312 } | |
| 1313 | |
| 1314 factory Transaction._internalWrap() { | |
| 1315 return new Transaction.internal_(); | |
| 1316 } | |
| 1317 | |
| 1318 Transaction.internal_() : super.internal_(); | |
| 1319 | |
| 1320 | |
| 1321 @DomName('IDBTransaction.db') | 1170 @DomName('IDBTransaction.db') |
| 1322 @DocsEditable() | 1171 @DocsEditable() |
| 1323 Database get db => wrap_jso(_blink.BlinkIDBTransaction.instance.db_Getter_(unw
rap_jso(this))); | 1172 Database get db => wrap_jso(_blink.BlinkIDBTransaction.instance.db_Getter_(unw
rap_jso(this))); |
| 1324 | 1173 |
| 1325 @DomName('IDBTransaction.error') | 1174 @DomName('IDBTransaction.error') |
| 1326 @DocsEditable() | 1175 @DocsEditable() |
| 1327 DomError get error => wrap_jso(_blink.BlinkIDBTransaction.instance.error_Gette
r_(unwrap_jso(this))); | 1176 DomError get error => wrap_jso(_blink.BlinkIDBTransaction.instance.error_Gette
r_(unwrap_jso(this))); |
| 1328 | 1177 |
| 1329 @DomName('IDBTransaction.mode') | 1178 @DomName('IDBTransaction.mode') |
| 1330 @DocsEditable() | 1179 @DocsEditable() |
| 1331 String get mode => _blink.BlinkIDBTransaction.instance.mode_Getter_(unwrap_jso
(this)); | 1180 String get mode => _blink.BlinkIDBTransaction.instance.mode_Getter_(unwrap_jso
(this)); |
| 1332 | 1181 |
| 1333 @DomName('IDBTransaction.abort') | 1182 @DomName('IDBTransaction.abort') |
| 1334 @DocsEditable() | 1183 @DocsEditable() |
| 1335 void abort() => _blink.BlinkIDBTransaction.instance.abort_Callback_0_(unwrap_j
so(this)); | 1184 void abort() => _blink.BlinkIDBTransaction.instance.abort_Callback_0_(unwrap_j
so(this)); |
| 1336 | 1185 |
| 1337 @DomName('IDBTransaction.objectStore') | 1186 @DomName('IDBTransaction.objectStore') |
| 1338 @DocsEditable() | 1187 @DocsEditable() |
| 1339 ObjectStore objectStore(String name) => wrap_jso(_blink.BlinkIDBTransaction.in
stance.objectStore_Callback_1_(unwrap_jso(this), name)); | 1188 ObjectStore objectStore(String name) => _blink.BlinkIDBTransaction.instance.ob
jectStore_Callback_1_(unwrap_jso(this), name); |
| 1340 | 1189 |
| 1341 /// Stream of `abort` events handled by this [Transaction]. | 1190 /// Stream of `abort` events handled by this [Transaction]. |
| 1342 @DomName('IDBTransaction.onabort') | 1191 @DomName('IDBTransaction.onabort') |
| 1343 @DocsEditable() | 1192 @DocsEditable() |
| 1344 Stream<Event> get onAbort => abortEvent.forTarget(this); | 1193 Stream<Event> get onAbort => abortEvent.forTarget(this); |
| 1345 | 1194 |
| 1346 /// Stream of `complete` events handled by this [Transaction]. | 1195 /// Stream of `complete` events handled by this [Transaction]. |
| 1347 @DomName('IDBTransaction.oncomplete') | 1196 @DomName('IDBTransaction.oncomplete') |
| 1348 @DocsEditable() | 1197 @DocsEditable() |
| 1349 Stream<Event> get onComplete => completeEvent.forTarget(this); | 1198 Stream<Event> get onComplete => completeEvent.forTarget(this); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1361 // WARNING: Do not edit - generated code. | 1210 // WARNING: Do not edit - generated code. |
| 1362 | 1211 |
| 1363 | 1212 |
| 1364 @DocsEditable() | 1213 @DocsEditable() |
| 1365 @DomName('IDBVersionChangeEvent') | 1214 @DomName('IDBVersionChangeEvent') |
| 1366 @Unstable() | 1215 @Unstable() |
| 1367 class VersionChangeEvent extends Event { | 1216 class VersionChangeEvent extends Event { |
| 1368 // To suppress missing implicit constructor warnings. | 1217 // To suppress missing implicit constructor warnings. |
| 1369 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported");
} | 1218 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported");
} |
| 1370 | 1219 |
| 1371 | |
| 1372 static VersionChangeEvent internalCreateVersionChangeEvent() { | |
| 1373 return new VersionChangeEvent._internalWrap(); | |
| 1374 } | |
| 1375 | |
| 1376 factory VersionChangeEvent._internalWrap() { | |
| 1377 return new VersionChangeEvent.internal_(); | |
| 1378 } | |
| 1379 | |
| 1380 VersionChangeEvent.internal_() : super.internal_(); | |
| 1381 | |
| 1382 | |
| 1383 @DomName('IDBVersionChangeEvent.dataLoss') | 1220 @DomName('IDBVersionChangeEvent.dataLoss') |
| 1384 @DocsEditable() | 1221 @DocsEditable() |
| 1385 @Experimental() // untriaged | 1222 @Experimental() // untriaged |
| 1386 String get dataLoss => _blink.BlinkIDBVersionChangeEvent.instance.dataLoss_Get
ter_(unwrap_jso(this)); | 1223 String get dataLoss => _blink.BlinkIDBVersionChangeEvent.instance.dataLoss_Get
ter_(unwrap_jso(this)); |
| 1387 | 1224 |
| 1388 @DomName('IDBVersionChangeEvent.dataLossMessage') | 1225 @DomName('IDBVersionChangeEvent.dataLossMessage') |
| 1389 @DocsEditable() | 1226 @DocsEditable() |
| 1390 @Experimental() // untriaged | 1227 @Experimental() // untriaged |
| 1391 String get dataLossMessage => _blink.BlinkIDBVersionChangeEvent.instance.dataL
ossMessage_Getter_(unwrap_jso(this)); | 1228 String get dataLossMessage => _blink.BlinkIDBVersionChangeEvent.instance.dataL
ossMessage_Getter_(unwrap_jso(this)); |
| 1392 | 1229 |
| 1393 @DomName('IDBVersionChangeEvent.newVersion') | 1230 @DomName('IDBVersionChangeEvent.newVersion') |
| 1394 @DocsEditable() | 1231 @DocsEditable() |
| 1395 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge
tter_(unwrap_jso(this)); | 1232 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge
tter_(unwrap_jso(this)); |
| 1396 | 1233 |
| 1397 @DomName('IDBVersionChangeEvent.oldVersion') | 1234 @DomName('IDBVersionChangeEvent.oldVersion') |
| 1398 @DocsEditable() | 1235 @DocsEditable() |
| 1399 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge
tter_(unwrap_jso(this)); | 1236 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge
tter_(unwrap_jso(this)); |
| 1400 | 1237 |
| 1401 } | 1238 } |
| OLD | NEW |