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