Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: sdk/lib/indexed_db/dartium/indexed_db_dartium.dart

Issue 1832713002: Optimize dartium dart:html bindings so real world application performance is acceptable. Improves d… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: update cached patches Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 KeyRange.upperBound_(bound, open); 103 KeyRange.upperBound_(bound, open);
104 104
105 static KeyRange createKeyRange_bound( 105 static KeyRange createKeyRange_bound(
106 /*IDBKey*/ lower, /*IDBKey*/ upper, 106 /*IDBKey*/ lower, /*IDBKey*/ upper,
107 [bool lowerOpen = false, bool upperOpen = false]) => 107 [bool lowerOpen = false, bool upperOpen = false]) =>
108 KeyRange.bound_(lower, upper, lowerOpen, upperOpen); 108 KeyRange.bound_(lower, upper, lowerOpen, upperOpen);
109 } 109 }
110 // FIXME: Can we make this private? 110 // FIXME: Can we make this private?
111 @Deprecated("Internal Use Only") 111 @Deprecated("Internal Use Only")
112 final indexed_dbBlinkMap = { 112 final indexed_dbBlinkMap = {
113 'IDBCursor': () => Cursor, 113 'IDBCursor': () => Cursor.instanceRuntimeType,
114 'IDBCursorWithValue': () => CursorWithValue, 114 'IDBCursorWithValue': () => CursorWithValue.instanceRuntimeType,
115 'IDBDatabase': () => Database, 115 'IDBDatabase': () => Database.instanceRuntimeType,
116 'IDBFactory': () => IdbFactory, 116 'IDBFactory': () => IdbFactory.instanceRuntimeType,
117 'IDBIndex': () => Index, 117 'IDBIndex': () => Index.instanceRuntimeType,
118 'IDBKeyRange': () => KeyRange, 118 'IDBKeyRange': () => KeyRange.instanceRuntimeType,
119 'IDBObjectStore': () => ObjectStore, 119 'IDBObjectStore': () => ObjectStore.instanceRuntimeType,
120 'IDBOpenDBRequest': () => OpenDBRequest, 120 'IDBOpenDBRequest': () => OpenDBRequest.instanceRuntimeType,
121 'IDBRequest': () => Request, 121 'IDBRequest': () => Request.instanceRuntimeType,
122 'IDBTransaction': () => Transaction, 122 'IDBTransaction': () => Transaction.instanceRuntimeType,
123 'IDBVersionChangeEvent': () => VersionChangeEvent, 123 'IDBVersionChangeEvent': () => VersionChangeEvent.instanceRuntimeType,
124 124
125 }; 125 };
126 126
127 // FIXME: Can we make this private?
128 @Deprecated("Internal Use Only")
129 final indexed_dbBlinkFunctionMap = {
130 'IDBCursor': () => Cursor.internalCreateCursor,
131 'IDBCursorWithValue': () => CursorWithValue.internalCreateCursorWithValue,
132 'IDBDatabase': () => Database.internalCreateDatabase,
133 'IDBFactory': () => IdbFactory.internalCreateIdbFactory,
134 'IDBIndex': () => Index.internalCreateIndex,
135 'IDBKeyRange': () => KeyRange.internalCreateKeyRange,
136 'IDBObjectStore': () => ObjectStore.internalCreateObjectStore,
137 'IDBOpenDBRequest': () => OpenDBRequest.internalCreateOpenDBRequest,
138 'IDBRequest': () => Request.internalCreateRequest,
139 'IDBTransaction': () => Transaction.internalCreateTransaction,
140 'IDBVersionChangeEvent': () => VersionChangeEvent.internalCreateVersionChangeE vent,
141 127
142 }; 128 //
143 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 129 // Per http://www.w3.org/TR/IndexedDB/#key-construct
130 //
131 // "A value is said to be a valid key if it is one of the following types: Array
132 // JavaScript objects [ECMA-262], DOMString [WEBIDL], Date [ECMA-262] or float
133 // [WEBIDL]. However Arrays are only valid keys if every item in the array is
134 // defined and is a valid key (i.e. sparse arrays can not be valid keys) and if
135 // the Array doesn't directly or indirectly contain itself. Any non-numeric
136 // properties are ignored, and thus does not affect whether the Array is a valid
137 // key. Additionally, if the value is of type float, it is only a valid key if
138 // it is not NaN, and if the value is of type Date it is only a valid key if its
139 // [[PrimitiveValue]] internal property, as defined by [ECMA-262], is not NaN."
140
141 // What is required is to ensure that an Lists in the key are actually
142 // JavaScript arrays, and any Dates are JavaScript Dates.
143
144
145 /**
146 * Converts a native IDBKey into a Dart object.
147 *
148 * May return the original input. May mutate the original input (but will be
149 * idempotent if mutation occurs). It is assumed that this conversion happens
150 * on native IDBKeys on all paths that return IDBKeys from native DOM calls.
151 *
152 * If necessary, JavaScript Dates are converted into Dart Dates.
153 */
154 _convertNativeToDart_IDBKey(nativeKey) {
155 containsDate(object) {
156 if (object is DateTime) return true;
157 if (object is List) {
158 for (int i = 0; i < object.length; i++) {
159 if (containsDate(object[i])) return true;
160 }
161 }
162 return false; // number, string.
163 }
164 if (nativeKey is DateTime) {
165 throw new UnimplementedError('Key containing DateTime');
166 }
167 // TODO: Cache conversion somewhere?
168 return nativeKey;
169 }
170
171 /**
172 * Converts a Dart object into a valid IDBKey.
173 *
174 * May return the original input. Does not mutate input.
175 *
176 * If necessary, [dartKey] may be copied to ensure all lists are converted into
177 * JavaScript Arrays and Dart Dates into JavaScript Dates.
178 */
179 _convertDartToNative_IDBKey(dartKey) {
180 // TODO: Implement.
181 return dartKey;
182 }
183
184
185
186 /// May modify original. If so, action is idempotent.
187 _convertNativeToDart_IDBAny(object) {
188 return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false);
189 }// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
144 // for details. All rights reserved. Use of this source code is governed by a 190 // for details. All rights reserved. Use of this source code is governed by a
145 // BSD-style license that can be found in the LICENSE file. 191 // BSD-style license that can be found in the LICENSE file.
146 192
147 193
148 @DomName('IDBCursor') 194 @DomName('IDBCursor')
149 @Unstable() 195 @Unstable()
150 class Cursor extends DartHtmlDomObject { 196 class Cursor extends DartHtmlDomObject {
151 @DomName('IDBCursor.delete') 197 @DomName('IDBCursor.delete')
152 Future delete() { 198 Future delete() {
153 try { 199 try {
154 return _completeRequest(_delete()); 200 return _completeRequest(_delete());
155 } catch (e, stacktrace) { 201 } catch (e, stacktrace) {
156 return new Future.error(e, stacktrace); 202 return new Future.error(e, stacktrace);
157 } 203 }
158 } 204 }
159 205
160 @DomName('IDBCursor.value') 206 @DomName('IDBCursor.value')
161 Future update(value) { 207 Future update(value) {
162 try { 208 try {
163 return _completeRequest(_update(value)); 209 return _completeRequest(_update(value));
164 } catch (e, stacktrace) { 210 } catch (e, stacktrace) {
165 return new Future.error(e, stacktrace); 211 return new Future.error(e, stacktrace);
166 } 212 }
167 } 213 }
168 214
169 // To suppress missing implicit constructor warnings. 215 // To suppress missing implicit constructor warnings.
170 factory Cursor._() { throw new UnsupportedError("Not supported"); } 216 factory Cursor._() { throw new UnsupportedError("Not supported"); }
171 217
218
172 @Deprecated("Internal Use Only") 219 @Deprecated("Internal Use Only")
173 static Cursor internalCreateCursor() { 220 external static Type get instanceRuntimeType;
174 return new Cursor._internalWrap();
175 }
176
177 factory Cursor._internalWrap() {
178 return new Cursor.internal_();
179 }
180 221
181 @Deprecated("Internal Use Only") 222 @Deprecated("Internal Use Only")
182 Cursor.internal_() { } 223 Cursor.internal_() { }
183 224
184 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
185 int get hashCode => unwrap_jso(this).hashCode;
186
187 @DomName('IDBCursor.direction') 225 @DomName('IDBCursor.direction')
188 @DocsEditable() 226 @DocsEditable()
189 String get direction => _blink.BlinkIDBCursor.instance.direction_Getter_(unwra p_jso(this)); 227 String get direction => _blink.BlinkIDBCursor.instance.direction_Getter_(this) ;
190 228
191 @DomName('IDBCursor.key') 229 @DomName('IDBCursor.key')
192 @DocsEditable() 230 @DocsEditable()
193 Object get key => wrap_jso(_blink.BlinkIDBCursor.instance.key_Getter_(unwrap_j so(this))); 231 Object get key => (_blink.BlinkIDBCursor.instance.key_Getter_(this));
194 232
195 @DomName('IDBCursor.primaryKey') 233 @DomName('IDBCursor.primaryKey')
196 @DocsEditable() 234 @DocsEditable()
197 Object get primaryKey => wrap_jso(_blink.BlinkIDBCursor.instance.primaryKey_Ge tter_(unwrap_jso(this))); 235 Object get primaryKey => (_blink.BlinkIDBCursor.instance.primaryKey_Getter_(th is));
198 236
199 @DomName('IDBCursor.source') 237 @DomName('IDBCursor.source')
200 @DocsEditable() 238 @DocsEditable()
201 Object get source => wrap_jso(_blink.BlinkIDBCursor.instance.source_Getter_(un wrap_jso(this))); 239 Object get source => (_blink.BlinkIDBCursor.instance.source_Getter_(this));
202 240
203 @DomName('IDBCursor.advance') 241 @DomName('IDBCursor.advance')
204 @DocsEditable() 242 @DocsEditable()
205 void advance(int count) => _blink.BlinkIDBCursor.instance.advance_Callback_1_( unwrap_jso(this), count); 243 void advance(int count) => _blink.BlinkIDBCursor.instance.advance_Callback_1_( this, count);
206 244
207 @DomName('IDBCursor.continuePrimaryKey') 245 @DomName('IDBCursor.continuePrimaryKey')
208 @DocsEditable() 246 @DocsEditable()
209 @Experimental() // untriaged 247 @Experimental() // untriaged
210 void continuePrimaryKey(Object key, Object primaryKey) => _blink.BlinkIDBCurso r.instance.continuePrimaryKey_Callback_2_(unwrap_jso(this), key, primaryKey); 248 void continuePrimaryKey(Object key, Object primaryKey) => _blink.BlinkIDBCurso r.instance.continuePrimaryKey_Callback_2_(this, key, primaryKey);
211 249
212 @DomName('IDBCursor.delete') 250 @DomName('IDBCursor.delete')
213 @DocsEditable() 251 @DocsEditable()
214 Request _delete() => wrap_jso(_blink.BlinkIDBCursor.instance.delete_Callback_0 _(unwrap_jso(this))); 252 Request _delete() => _blink.BlinkIDBCursor.instance.delete_Callback_0_(this);
215 253
216 void next([Object key]) { 254 void next([Object key]) {
217 if (key != null) { 255 if (key != null) {
218 _blink.BlinkIDBCursor.instance.continue_Callback_1_(unwrap_jso(this), key) ; 256 _blink.BlinkIDBCursor.instance.continue_Callback_1_(this, key);
219 return; 257 return;
220 } 258 }
221 _blink.BlinkIDBCursor.instance.continue_Callback_0_(unwrap_jso(this)); 259 _blink.BlinkIDBCursor.instance.continue_Callback_0_(this);
222 return; 260 return;
223 } 261 }
224 262
225 @DomName('IDBCursor.update') 263 @DomName('IDBCursor.update')
226 @DocsEditable() 264 @DocsEditable()
227 Request _update(Object value) => wrap_jso(_blink.BlinkIDBCursor.instance.updat e_Callback_1_(unwrap_jso(this), convertDartToNative_SerializedScriptValue(value) )); 265 Request _update(Object value) => _blink.BlinkIDBCursor.instance.update_Callbac k_1_(this, convertDartToNative_SerializedScriptValue(value));
228 266
229 } 267 }
230 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 268 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
231 // for details. All rights reserved. Use of this source code is governed by a 269 // for details. All rights reserved. Use of this source code is governed by a
232 // BSD-style license that can be found in the LICENSE file. 270 // BSD-style license that can be found in the LICENSE file.
233 271
234 // WARNING: Do not edit - generated code. 272 // WARNING: Do not edit - generated code.
235 273
236 274
237 @DocsEditable() 275 @DocsEditable()
238 @DomName('IDBCursorWithValue') 276 @DomName('IDBCursorWithValue')
239 @Unstable() 277 @Unstable()
240 class CursorWithValue extends Cursor { 278 class CursorWithValue extends Cursor {
241 // To suppress missing implicit constructor warnings. 279 // To suppress missing implicit constructor warnings.
242 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); } 280 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); }
243 281
244 282
245 @Deprecated("Internal Use Only") 283 @Deprecated("Internal Use Only")
246 static CursorWithValue internalCreateCursorWithValue() { 284 external static Type get instanceRuntimeType;
247 return new CursorWithValue._internalWrap();
248 }
249
250 external factory CursorWithValue._internalWrap();
251 285
252 @Deprecated("Internal Use Only") 286 @Deprecated("Internal Use Only")
253 CursorWithValue.internal_() : super.internal_(); 287 CursorWithValue.internal_() : super.internal_();
254 288
255 289
256 @DomName('IDBCursorWithValue.value') 290 @DomName('IDBCursorWithValue.value')
257 @DocsEditable() 291 @DocsEditable()
258 Object get value => wrap_jso(_blink.BlinkIDBCursorWithValue.instance.value_Get ter_(unwrap_jso(this))); 292 Object get value => _convertNativeToDart_IDBAny(_blink.BlinkIDBCursorWithValue .instance.value_Getter_(this));
259 293
260 } 294 }
261 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 295 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
262 // for details. All rights reserved. Use of this source code is governed by a 296 // for details. All rights reserved. Use of this source code is governed by a
263 // BSD-style license that can be found in the LICENSE file. 297 // BSD-style license that can be found in the LICENSE file.
264 298
265 299
266 @DocsEditable() 300 @DocsEditable()
267 /** 301 /**
268 * An indexed database object for storing client-side data 302 * An indexed database object for storing client-side data
(...skipping 22 matching lines...) Expand all
291 } 325 }
292 326
293 Transaction transaction(storeName_OR_storeNames, String mode) { 327 Transaction transaction(storeName_OR_storeNames, String mode) {
294 if (mode != 'readonly' && mode != 'readwrite') { 328 if (mode != 'readonly' && mode != 'readwrite') {
295 throw new ArgumentError("Invalid transaction mode $mode"); 329 throw new ArgumentError("Invalid transaction mode $mode");
296 } 330 }
297 var names; 331 var names;
298 if (storeName_OR_storeNames == null) { 332 if (storeName_OR_storeNames == null) {
299 throw new ArgumentError("stores may not be null in transaction"); 333 throw new ArgumentError("stores may not be null in transaction");
300 } else if (storeName_OR_storeNames is String || storeName_OR_storeNames is D omStringList) { 334 } else if (storeName_OR_storeNames is String || storeName_OR_storeNames is D omStringList) {
301 names = unwrap_jso(storeName_OR_storeNames); 335 names = storeName_OR_storeNames;
302 } else if (storeName_OR_storeNames is List<String>) { 336 } else if (storeName_OR_storeNames is List<String>) {
303 names = convertDartToNative_List(storeName_OR_storeNames); 337 names = convertDartToNative_List(storeName_OR_storeNames);
304 } else { 338 } else {
305 throw new ArgumentError("Invalid store(s) $store_Name_OR_storeNames"); 339 throw new ArgumentError("Invalid store(s) $store_Name_OR_storeNames");
306 } 340 }
307 341
308 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unw rap_jso(this), names, mode)); 342 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, names, mode);
309 } 343 }
310 344
311 Transaction transactionList(List<String> storeNames, String mode) => transacti on(storeNames, mode); 345 Transaction transactionList(List<String> storeNames, String mode) => transacti on(storeNames, mode);
312 Transaction transactionStores(List<String> storeNames, String mode) => transac tion(storeNames, mode); 346 Transaction transactionStores(List<String> storeNames, String mode) => transac tion(storeNames, mode);
313 Transaction transactionStore(String storeName, String mode) => transaction(sto reName, mode); 347 Transaction transactionStore(String storeName, String mode) => transaction(sto reName, mode);
314 348
315 // To suppress missing implicit constructor warnings. 349 // To suppress missing implicit constructor warnings.
316 factory Database._() { throw new UnsupportedError("Not supported"); } 350 factory Database._() { throw new UnsupportedError("Not supported"); }
317 351
318 /** 352 /**
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 * handlers that are not necessarily instances of [Database]. 386 * handlers that are not necessarily instances of [Database].
353 * 387 *
354 * See [EventStreamProvider] for usage information. 388 * See [EventStreamProvider] for usage information.
355 */ 389 */
356 @DomName('IDBDatabase.versionchangeEvent') 390 @DomName('IDBDatabase.versionchangeEvent')
357 @DocsEditable() 391 @DocsEditable()
358 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons t EventStreamProvider<VersionChangeEvent>('versionchange'); 392 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons t EventStreamProvider<VersionChangeEvent>('versionchange');
359 393
360 394
361 @Deprecated("Internal Use Only") 395 @Deprecated("Internal Use Only")
362 static Database internalCreateDatabase() { 396 external static Type get instanceRuntimeType;
363 return new Database._internalWrap();
364 }
365
366 external factory Database._internalWrap();
367 397
368 @Deprecated("Internal Use Only") 398 @Deprecated("Internal Use Only")
369 Database.internal_() : super.internal_(); 399 Database.internal_() : super.internal_();
370 400
371 401
372 @DomName('IDBDatabase.name') 402 @DomName('IDBDatabase.name')
373 @DocsEditable() 403 @DocsEditable()
374 String get name => _blink.BlinkIDBDatabase.instance.name_Getter_(unwrap_jso(th is)); 404 String get name => _blink.BlinkIDBDatabase.instance.name_Getter_(this);
375 405
376 @DomName('IDBDatabase.objectStoreNames') 406 @DomName('IDBDatabase.objectStoreNames')
377 @DocsEditable() 407 @DocsEditable()
378 List<String> get objectStoreNames => wrap_jso(_blink.BlinkIDBDatabase.instance .objectStoreNames_Getter_(unwrap_jso(this))); 408 List<String> get objectStoreNames => _blink.BlinkIDBDatabase.instance.objectSt oreNames_Getter_(this);
379 409
380 @DomName('IDBDatabase.version') 410 @DomName('IDBDatabase.version')
381 @DocsEditable() 411 @DocsEditable()
382 Object get version => wrap_jso(_blink.BlinkIDBDatabase.instance.version_Getter _(unwrap_jso(this))); 412 Object get version => (_blink.BlinkIDBDatabase.instance.version_Getter_(this)) ;
383 413
384 @DomName('IDBDatabase.close') 414 @DomName('IDBDatabase.close')
385 @DocsEditable() 415 @DocsEditable()
386 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(unwrap_jso( this)); 416 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(this);
387 417
388 ObjectStore _createObjectStore(String name, [Map options]) { 418 ObjectStore _createObjectStore(String name, [Map options]) {
389 if (options != null) { 419 if (options != null) {
390 return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callbac k_2_(unwrap_jso(this), name, convertDartToNative_Dictionary(options))); 420 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_2_(this , name, convertDartToNative_Dictionary(options));
391 } 421 }
392 return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callback_ 1_(unwrap_jso(this), name)); 422 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_1_(this, name);
393 } 423 }
394 424
395 @DomName('IDBDatabase.deleteObjectStore') 425 @DomName('IDBDatabase.deleteObjectStore')
396 @DocsEditable() 426 @DocsEditable()
397 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete ObjectStore_Callback_1_(unwrap_jso(this), name); 427 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete ObjectStore_Callback_1_(this, name);
398 428
399 /// Stream of `abort` events handled by this [Database]. 429 /// Stream of `abort` events handled by this [Database].
400 @DomName('IDBDatabase.onabort') 430 @DomName('IDBDatabase.onabort')
401 @DocsEditable() 431 @DocsEditable()
402 Stream<Event> get onAbort => abortEvent.forTarget(this); 432 Stream<Event> get onAbort => abortEvent.forTarget(this);
403 433
404 /// Stream of `close` events handled by this [Database]. 434 /// Stream of `close` events handled by this [Database].
405 @DomName('IDBDatabase.onclose') 435 @DomName('IDBDatabase.onclose')
406 @DocsEditable() 436 @DocsEditable()
407 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22540 437 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22540
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 /** 531 /**
502 * Checks to see if getDatabaseNames is supported by the current platform. 532 * Checks to see if getDatabaseNames is supported by the current platform.
503 */ 533 */
504 bool get supportsDatabaseNames { 534 bool get supportsDatabaseNames {
505 return true; 535 return true;
506 } 536 }
507 537
508 // To suppress missing implicit constructor warnings. 538 // To suppress missing implicit constructor warnings.
509 factory IdbFactory._() { throw new UnsupportedError("Not supported"); } 539 factory IdbFactory._() { throw new UnsupportedError("Not supported"); }
510 540
541
511 @Deprecated("Internal Use Only") 542 @Deprecated("Internal Use Only")
512 static IdbFactory internalCreateIdbFactory() { 543 external static Type get instanceRuntimeType;
513 return new IdbFactory._internalWrap();
514 }
515
516 factory IdbFactory._internalWrap() {
517 return new IdbFactory.internal_();
518 }
519 544
520 @Deprecated("Internal Use Only") 545 @Deprecated("Internal Use Only")
521 IdbFactory.internal_() { } 546 IdbFactory.internal_() { }
522 547
523 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
524 int get hashCode => unwrap_jso(this).hashCode;
525
526 @DomName('IDBFactory.cmp') 548 @DomName('IDBFactory.cmp')
527 @DocsEditable() 549 @DocsEditable()
528 int cmp(Object first, Object second) => _blink.BlinkIDBFactory.instance.cmp_Ca llback_2_(unwrap_jso(this), first, second); 550 int cmp(Object first, Object second) => _blink.BlinkIDBFactory.instance.cmp_Ca llback_2_(this, first, second);
529 551
530 @DomName('IDBFactory.deleteDatabase') 552 @DomName('IDBFactory.deleteDatabase')
531 @DocsEditable() 553 @DocsEditable()
532 OpenDBRequest _deleteDatabase(String name) => wrap_jso(_blink.BlinkIDBFactory. instance.deleteDatabase_Callback_1_(unwrap_jso(this), name)); 554 OpenDBRequest _deleteDatabase(String name) => _blink.BlinkIDBFactory.instance. deleteDatabase_Callback_1_(this, name);
533 555
534 OpenDBRequest _open(String name, [int version]) { 556 OpenDBRequest _open(String name, [int version]) {
535 if (version != null) { 557 if (version != null) {
536 return wrap_jso(_blink.BlinkIDBFactory.instance.open_Callback_2_(unwrap_js o(this), name, version)); 558 return _blink.BlinkIDBFactory.instance.open_Callback_2_(this, name, versio n);
537 } 559 }
538 return wrap_jso(_blink.BlinkIDBFactory.instance.open_Callback_1_(unwrap_jso( this), name)); 560 return _blink.BlinkIDBFactory.instance.open_Callback_1_(this, name);
539 } 561 }
540 562
541 @DomName('IDBFactory.webkitGetDatabaseNames') 563 @DomName('IDBFactory.webkitGetDatabaseNames')
542 @DocsEditable() 564 @DocsEditable()
543 @SupportedBrowser(SupportedBrowser.CHROME) 565 @SupportedBrowser(SupportedBrowser.CHROME)
544 @SupportedBrowser(SupportedBrowser.SAFARI) 566 @SupportedBrowser(SupportedBrowser.SAFARI)
545 @Experimental() 567 @Experimental()
546 Request _webkitGetDatabaseNames() => wrap_jso(_blink.BlinkIDBFactory.instance. webkitGetDatabaseNames_Callback_0_(unwrap_jso(this))); 568 Request _webkitGetDatabaseNames() => _blink.BlinkIDBFactory.instance.webkitGet DatabaseNames_Callback_0_(this);
547 569
548 } 570 }
549 571
550 572
551 /** 573 /**
552 * Ties a request to a completer, so the completer is completed when it succeeds 574 * Ties a request to a completer, so the completer is completed when it succeeds
553 * and errors out when the request errors. 575 * and errors out when the request errors.
554 */ 576 */
555 Future _completeRequest(Request request) { 577 Future _completeRequest(Request request) {
556 var completer = new Completer.sync(); 578 var completer = new Completer.sync();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 request = _openKeyCursor(key_OR_range, "next"); 676 request = _openKeyCursor(key_OR_range, "next");
655 } else { 677 } else {
656 request = _openKeyCursor(key_OR_range, direction); 678 request = _openKeyCursor(key_OR_range, direction);
657 } 679 }
658 return ObjectStore._cursorStreamFromResult(request, autoAdvance); 680 return ObjectStore._cursorStreamFromResult(request, autoAdvance);
659 } 681 }
660 682
661 // To suppress missing implicit constructor warnings. 683 // To suppress missing implicit constructor warnings.
662 factory Index._() { throw new UnsupportedError("Not supported"); } 684 factory Index._() { throw new UnsupportedError("Not supported"); }
663 685
686
664 @Deprecated("Internal Use Only") 687 @Deprecated("Internal Use Only")
665 static Index internalCreateIndex() { 688 external static Type get instanceRuntimeType;
666 return new Index._internalWrap();
667 }
668
669 factory Index._internalWrap() {
670 return new Index.internal_();
671 }
672 689
673 @Deprecated("Internal Use Only") 690 @Deprecated("Internal Use Only")
674 Index.internal_() { } 691 Index.internal_() { }
675 692
676 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
677 int get hashCode => unwrap_jso(this).hashCode;
678
679 @DomName('IDBIndex.keyPath') 693 @DomName('IDBIndex.keyPath')
680 @DocsEditable() 694 @DocsEditable()
681 Object get keyPath => wrap_jso(_blink.BlinkIDBIndex.instance.keyPath_Getter_(u nwrap_jso(this))); 695 Object get keyPath => (_blink.BlinkIDBIndex.instance.keyPath_Getter_(this));
682 696
683 @DomName('IDBIndex.multiEntry') 697 @DomName('IDBIndex.multiEntry')
684 @DocsEditable() 698 @DocsEditable()
685 bool get multiEntry => _blink.BlinkIDBIndex.instance.multiEntry_Getter_(unwrap _jso(this)); 699 bool get multiEntry => _blink.BlinkIDBIndex.instance.multiEntry_Getter_(this);
686 700
687 @DomName('IDBIndex.name') 701 @DomName('IDBIndex.name')
688 @DocsEditable() 702 @DocsEditable()
689 String get name => _blink.BlinkIDBIndex.instance.name_Getter_(unwrap_jso(this) ); 703 String get name => _blink.BlinkIDBIndex.instance.name_Getter_(this);
690 704
691 @DomName('IDBIndex.objectStore') 705 @DomName('IDBIndex.objectStore')
692 @DocsEditable() 706 @DocsEditable()
693 ObjectStore get objectStore => wrap_jso(_blink.BlinkIDBIndex.instance.objectSt ore_Getter_(unwrap_jso(this))); 707 ObjectStore get objectStore => _blink.BlinkIDBIndex.instance.objectStore_Gette r_(this);
694 708
695 @DomName('IDBIndex.unique') 709 @DomName('IDBIndex.unique')
696 @DocsEditable() 710 @DocsEditable()
697 bool get unique => _blink.BlinkIDBIndex.instance.unique_Getter_(unwrap_jso(thi s)); 711 bool get unique => _blink.BlinkIDBIndex.instance.unique_Getter_(this);
698 712
699 @DomName('IDBIndex.count') 713 @DomName('IDBIndex.count')
700 @DocsEditable() 714 @DocsEditable()
701 Request _count(Object key) => wrap_jso(_blink.BlinkIDBIndex.instance.count_Cal lback_1_(unwrap_jso(this), key)); 715 Request _count(Object key) => _blink.BlinkIDBIndex.instance.count_Callback_1_( this, key);
702 716
703 @DomName('IDBIndex.get') 717 @DomName('IDBIndex.get')
704 @DocsEditable() 718 @DocsEditable()
705 Request _get(Object key) => wrap_jso(_blink.BlinkIDBIndex.instance.get_Callbac k_1_(unwrap_jso(this), key)); 719 Request _get(Object key) => _blink.BlinkIDBIndex.instance.get_Callback_1_(this , key);
706 720
707 Request getAll(Object range, [int maxCount]) { 721 Request getAll(Object range, [int maxCount]) {
708 if (maxCount != null) { 722 if (maxCount != null) {
709 return wrap_jso(_blink.BlinkIDBIndex.instance.getAll_Callback_2_(unwrap_js o(this), range, maxCount)); 723 return _blink.BlinkIDBIndex.instance.getAll_Callback_2_(this, range, maxCo unt);
710 } 724 }
711 return wrap_jso(_blink.BlinkIDBIndex.instance.getAll_Callback_1_(unwrap_jso( this), range)); 725 return _blink.BlinkIDBIndex.instance.getAll_Callback_1_(this, range);
712 } 726 }
713 727
714 Request getAllKeys(Object range, [int maxCount]) { 728 Request getAllKeys(Object range, [int maxCount]) {
715 if (maxCount != null) { 729 if (maxCount != null) {
716 return wrap_jso(_blink.BlinkIDBIndex.instance.getAllKeys_Callback_2_(unwra p_jso(this), range, maxCount)); 730 return _blink.BlinkIDBIndex.instance.getAllKeys_Callback_2_(this, range, m axCount);
717 } 731 }
718 return wrap_jso(_blink.BlinkIDBIndex.instance.getAllKeys_Callback_1_(unwrap_ jso(this), range)); 732 return _blink.BlinkIDBIndex.instance.getAllKeys_Callback_1_(this, range);
719 } 733 }
720 734
721 @DomName('IDBIndex.getKey') 735 @DomName('IDBIndex.getKey')
722 @DocsEditable() 736 @DocsEditable()
723 Request _getKey(Object key) => wrap_jso(_blink.BlinkIDBIndex.instance.getKey_C allback_1_(unwrap_jso(this), key)); 737 Request _getKey(Object key) => _blink.BlinkIDBIndex.instance.getKey_Callback_1 _(this, key);
724 738
725 Request _openCursor(Object range, [String direction]) { 739 Request _openCursor(Object range, [String direction]) {
726 if (direction != null) { 740 if (direction != null) {
727 return wrap_jso(_blink.BlinkIDBIndex.instance.openCursor_Callback_2_(unwra p_jso(this), range, direction)); 741 return _blink.BlinkIDBIndex.instance.openCursor_Callback_2_(this, range, d irection);
728 } 742 }
729 return wrap_jso(_blink.BlinkIDBIndex.instance.openCursor_Callback_1_(unwrap_ jso(this), range)); 743 return _blink.BlinkIDBIndex.instance.openCursor_Callback_1_(this, range);
730 } 744 }
731 745
732 Request _openKeyCursor(Object range, [String direction]) { 746 Request _openKeyCursor(Object range, [String direction]) {
733 if (direction != null) { 747 if (direction != null) {
734 return wrap_jso(_blink.BlinkIDBIndex.instance.openKeyCursor_Callback_2_(un wrap_jso(this), range, direction)); 748 return _blink.BlinkIDBIndex.instance.openKeyCursor_Callback_2_(this, range , direction);
735 } 749 }
736 return wrap_jso(_blink.BlinkIDBIndex.instance.openKeyCursor_Callback_1_(unwr ap_jso(this), range)); 750 return _blink.BlinkIDBIndex.instance.openKeyCursor_Callback_1_(this, range);
737 } 751 }
738 752
739 } 753 }
740 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 754 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
741 // for details. All rights reserved. Use of this source code is governed by a 755 // for details. All rights reserved. Use of this source code is governed by a
742 // BSD-style license that can be found in the LICENSE file. 756 // BSD-style license that can be found in the LICENSE file.
743 757
744 758
745 @DomName('IDBKeyRange') 759 @DomName('IDBKeyRange')
746 @Unstable() 760 @Unstable()
(...skipping 12 matching lines...) Expand all
759 773
760 @DomName('KeyRange.bound') 774 @DomName('KeyRange.bound')
761 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, 775 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper,
762 [bool lowerOpen = false, bool upperOpen = false]) => 776 [bool lowerOpen = false, bool upperOpen = false]) =>
763 _KeyRangeFactoryProvider.createKeyRange_bound( 777 _KeyRangeFactoryProvider.createKeyRange_bound(
764 lower, upper, lowerOpen, upperOpen); 778 lower, upper, lowerOpen, upperOpen);
765 779
766 // To suppress missing implicit constructor warnings. 780 // To suppress missing implicit constructor warnings.
767 factory KeyRange._() { throw new UnsupportedError("Not supported"); } 781 factory KeyRange._() { throw new UnsupportedError("Not supported"); }
768 782
783
769 @Deprecated("Internal Use Only") 784 @Deprecated("Internal Use Only")
770 static KeyRange internalCreateKeyRange() { 785 external static Type get instanceRuntimeType;
771 return new KeyRange._internalWrap();
772 }
773
774 factory KeyRange._internalWrap() {
775 return new KeyRange.internal_();
776 }
777 786
778 @Deprecated("Internal Use Only") 787 @Deprecated("Internal Use Only")
779 KeyRange.internal_() { } 788 KeyRange.internal_() { }
780 789
781 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
782 int get hashCode => unwrap_jso(this).hashCode;
783
784 @DomName('IDBKeyRange.lower') 790 @DomName('IDBKeyRange.lower')
785 @DocsEditable() 791 @DocsEditable()
786 Object get lower => wrap_jso(_blink.BlinkIDBKeyRange.instance.lower_Getter_(un wrap_jso(this))); 792 Object get lower => (_blink.BlinkIDBKeyRange.instance.lower_Getter_(this));
787 793
788 @DomName('IDBKeyRange.lowerOpen') 794 @DomName('IDBKeyRange.lowerOpen')
789 @DocsEditable() 795 @DocsEditable()
790 bool get lowerOpen => _blink.BlinkIDBKeyRange.instance.lowerOpen_Getter_(unwra p_jso(this)); 796 bool get lowerOpen => _blink.BlinkIDBKeyRange.instance.lowerOpen_Getter_(this) ;
791 797
792 @DomName('IDBKeyRange.upper') 798 @DomName('IDBKeyRange.upper')
793 @DocsEditable() 799 @DocsEditable()
794 Object get upper => wrap_jso(_blink.BlinkIDBKeyRange.instance.upper_Getter_(un wrap_jso(this))); 800 Object get upper => (_blink.BlinkIDBKeyRange.instance.upper_Getter_(this));
795 801
796 @DomName('IDBKeyRange.upperOpen') 802 @DomName('IDBKeyRange.upperOpen')
797 @DocsEditable() 803 @DocsEditable()
798 bool get upperOpen => _blink.BlinkIDBKeyRange.instance.upperOpen_Getter_(unwra p_jso(this)); 804 bool get upperOpen => _blink.BlinkIDBKeyRange.instance.upperOpen_Getter_(this) ;
799 805
800 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]) {
801 if (upperOpen != null) { 807 if (upperOpen != null) {
802 return wrap_jso(_blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower, upper, lowerOpen, upperOpen)); 808 return _blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower, upper, lo werOpen, upperOpen);
803 } 809 }
804 if (lowerOpen != null) { 810 if (lowerOpen != null) {
805 return wrap_jso(_blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower, upper, lowerOpen)); 811 return _blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower, upper, lo werOpen);
806 } 812 }
807 return wrap_jso(_blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, up per)); 813 return _blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, upper);
808 } 814 }
809 815
810 static KeyRange lowerBound_(Object bound, [bool open]) { 816 static KeyRange lowerBound_(Object bound, [bool open]) {
811 if (open != null) { 817 if (open != null) {
812 return wrap_jso(_blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bo und, open)); 818 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bound, open );
813 } 819 }
814 return wrap_jso(_blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(boun d)); 820 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(bound);
815 } 821 }
816 822
817 @DomName('IDBKeyRange.only_') 823 @DomName('IDBKeyRange.only_')
818 @DocsEditable() 824 @DocsEditable()
819 @Experimental() // non-standard 825 @Experimental() // non-standard
820 static KeyRange only_(Object value) => wrap_jso(_blink.BlinkIDBKeyRange.instan ce.only_Callback_1_(value)); 826 static KeyRange only_(Object value) => _blink.BlinkIDBKeyRange.instance.only_C allback_1_(value);
821 827
822 static KeyRange upperBound_(Object bound, [bool open]) { 828 static KeyRange upperBound_(Object bound, [bool open]) {
823 if (open != null) { 829 if (open != null) {
824 return wrap_jso(_blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bo und, open)); 830 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bound, open );
825 } 831 }
826 return wrap_jso(_blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(boun d)); 832 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(bound);
827 } 833 }
828 834
829 } 835 }
830 // 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
831 // 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
832 // BSD-style license that can be found in the LICENSE file. 838 // BSD-style license that can be found in the LICENSE file.
833 839
834 840
835 @DomName('IDBObjectStore') 841 @DomName('IDBObjectStore')
836 @Unstable() 842 @Unstable()
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 if (multiEntry != null) { 964 if (multiEntry != null) {
959 options['multiEntry'] = multiEntry; 965 options['multiEntry'] = multiEntry;
960 } 966 }
961 967
962 return _createIndex(name, keyPath, options); 968 return _createIndex(name, keyPath, options);
963 } 969 }
964 970
965 // To suppress missing implicit constructor warnings. 971 // To suppress missing implicit constructor warnings.
966 factory ObjectStore._() { throw new UnsupportedError("Not supported"); } 972 factory ObjectStore._() { throw new UnsupportedError("Not supported"); }
967 973
974
968 @Deprecated("Internal Use Only") 975 @Deprecated("Internal Use Only")
969 static ObjectStore internalCreateObjectStore() { 976 external static Type get instanceRuntimeType;
970 return new ObjectStore._internalWrap();
971 }
972
973 factory ObjectStore._internalWrap() {
974 return new ObjectStore.internal_();
975 }
976 977
977 @Deprecated("Internal Use Only") 978 @Deprecated("Internal Use Only")
978 ObjectStore.internal_() { } 979 ObjectStore.internal_() { }
979 980
980 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
981 int get hashCode => unwrap_jso(this).hashCode;
982
983 @DomName('IDBObjectStore.autoIncrement') 981 @DomName('IDBObjectStore.autoIncrement')
984 @DocsEditable() 982 @DocsEditable()
985 bool get autoIncrement => _blink.BlinkIDBObjectStore.instance.autoIncrement_Ge tter_(unwrap_jso(this)); 983 bool get autoIncrement => _blink.BlinkIDBObjectStore.instance.autoIncrement_Ge tter_(this);
986 984
987 @DomName('IDBObjectStore.indexNames') 985 @DomName('IDBObjectStore.indexNames')
988 @DocsEditable() 986 @DocsEditable()
989 List<String> get indexNames => wrap_jso(_blink.BlinkIDBObjectStore.instance.in dexNames_Getter_(unwrap_jso(this))); 987 List<String> get indexNames => _blink.BlinkIDBObjectStore.instance.indexNames_ Getter_(this);
990 988
991 @DomName('IDBObjectStore.keyPath') 989 @DomName('IDBObjectStore.keyPath')
992 @DocsEditable() 990 @DocsEditable()
993 Object get keyPath => wrap_jso(_blink.BlinkIDBObjectStore.instance.keyPath_Get ter_(unwrap_jso(this))); 991 Object get keyPath => (_blink.BlinkIDBObjectStore.instance.keyPath_Getter_(thi s));
994 992
995 @DomName('IDBObjectStore.name') 993 @DomName('IDBObjectStore.name')
996 @DocsEditable() 994 @DocsEditable()
997 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(unwrap_jso (this)); 995 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(this);
998 996
999 @DomName('IDBObjectStore.transaction') 997 @DomName('IDBObjectStore.transaction')
1000 @DocsEditable() 998 @DocsEditable()
1001 Transaction get transaction => wrap_jso(_blink.BlinkIDBObjectStore.instance.tr ansaction_Getter_(unwrap_jso(this))); 999 Transaction get transaction => _blink.BlinkIDBObjectStore.instance.transaction _Getter_(this);
1002 1000
1003 Request _add(Object value, [Object key]) { 1001 Request _add(Object value, [Object key]) {
1004 if (key != null) { 1002 if (key != null) {
1005 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_2_(unwrap _jso(this), convertDartToNative_SerializedScriptValue(value), convertDartToNativ e_SerializedScriptValue(key))); 1003 return _blink.BlinkIDBObjectStore.instance.add_Callback_2_(this, convertDa rtToNative_SerializedScriptValue(value), convertDartToNative_SerializedScriptVal ue(key));
1006 } 1004 }
1007 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_1_(unwrap_j so(this), convertDartToNative_SerializedScriptValue(value))); 1005 return _blink.BlinkIDBObjectStore.instance.add_Callback_1_(this, convertDart ToNative_SerializedScriptValue(value));
1008 } 1006 }
1009 1007
1010 @DomName('IDBObjectStore.clear') 1008 @DomName('IDBObjectStore.clear')
1011 @DocsEditable() 1009 @DocsEditable()
1012 Request _clear() => wrap_jso(_blink.BlinkIDBObjectStore.instance.clear_Callbac k_0_(unwrap_jso(this))); 1010 Request _clear() => _blink.BlinkIDBObjectStore.instance.clear_Callback_0_(this );
1013 1011
1014 @DomName('IDBObjectStore.count') 1012 @DomName('IDBObjectStore.count')
1015 @DocsEditable() 1013 @DocsEditable()
1016 Request _count(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.cou nt_Callback_1_(unwrap_jso(this), key)); 1014 Request _count(Object key) => _blink.BlinkIDBObjectStore.instance.count_Callba ck_1_(this, key);
1017 1015
1018 Index _createIndex(String name, Object keyPath, [Map options]) { 1016 Index _createIndex(String name, Object keyPath, [Map options]) {
1019 if (options != null) { 1017 if (options != null) {
1020 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_3 _(unwrap_jso(this), name, keyPath, convertDartToNative_Dictionary(options))); 1018 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(this, n ame, keyPath, convertDartToNative_Dictionary(options));
1021 } 1019 }
1022 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_( unwrap_jso(this), name, keyPath)); 1020 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(this, nam e, keyPath);
1023 } 1021 }
1024 1022
1025 @DomName('IDBObjectStore.delete') 1023 @DomName('IDBObjectStore.delete')
1026 @DocsEditable() 1024 @DocsEditable()
1027 Request _delete(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.de lete_Callback_1_(unwrap_jso(this), key)); 1025 Request _delete(Object key) => _blink.BlinkIDBObjectStore.instance.delete_Call back_1_(this, key);
1028 1026
1029 @DomName('IDBObjectStore.deleteIndex') 1027 @DomName('IDBObjectStore.deleteIndex')
1030 @DocsEditable() 1028 @DocsEditable()
1031 void deleteIndex(String name) => _blink.BlinkIDBObjectStore.instance.deleteInd ex_Callback_1_(unwrap_jso(this), name); 1029 void deleteIndex(String name) => _blink.BlinkIDBObjectStore.instance.deleteInd ex_Callback_1_(this, name);
1032 1030
1033 @DomName('IDBObjectStore.get') 1031 @DomName('IDBObjectStore.get')
1034 @DocsEditable() 1032 @DocsEditable()
1035 Request _get(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.get_C allback_1_(unwrap_jso(this), key)); 1033 Request _get(Object key) => _blink.BlinkIDBObjectStore.instance.get_Callback_1 _(this, key);
1036 1034
1037 Request getAll(Object range, [int maxCount]) { 1035 Request getAll(Object range, [int maxCount]) {
1038 if (maxCount != null) { 1036 if (maxCount != null) {
1039 return wrap_jso(_blink.BlinkIDBObjectStore.instance.getAll_Callback_2_(unw rap_jso(this), range, maxCount)); 1037 return _blink.BlinkIDBObjectStore.instance.getAll_Callback_2_(this, range, maxCount);
1040 } 1038 }
1041 return wrap_jso(_blink.BlinkIDBObjectStore.instance.getAll_Callback_1_(unwra p_jso(this), range)); 1039 return _blink.BlinkIDBObjectStore.instance.getAll_Callback_1_(this, range);
1042 } 1040 }
1043 1041
1044 Request getAllKeys(Object range, [int maxCount]) { 1042 Request getAllKeys(Object range, [int maxCount]) {
1045 if (maxCount != null) { 1043 if (maxCount != null) {
1046 return wrap_jso(_blink.BlinkIDBObjectStore.instance.getAllKeys_Callback_2_ (unwrap_jso(this), range, maxCount)); 1044 return _blink.BlinkIDBObjectStore.instance.getAllKeys_Callback_2_(this, ra nge, maxCount);
1047 } 1045 }
1048 return wrap_jso(_blink.BlinkIDBObjectStore.instance.getAllKeys_Callback_1_(u nwrap_jso(this), range)); 1046 return _blink.BlinkIDBObjectStore.instance.getAllKeys_Callback_1_(this, rang e);
1049 } 1047 }
1050 1048
1051 @DomName('IDBObjectStore.index') 1049 @DomName('IDBObjectStore.index')
1052 @DocsEditable() 1050 @DocsEditable()
1053 Index index(String name) => wrap_jso(_blink.BlinkIDBObjectStore.instance.index _Callback_1_(unwrap_jso(this), name)); 1051 Index index(String name) => _blink.BlinkIDBObjectStore.instance.index_Callback _1_(this, name);
1054 1052
1055 Request _openCursor(Object range, [String direction]) { 1053 Request _openCursor(Object range, [String direction]) {
1056 if (direction != null) { 1054 if (direction != null) {
1057 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_2_ (unwrap_jso(this), range, direction)); 1055 return _blink.BlinkIDBObjectStore.instance.openCursor_Callback_2_(this, ra nge, direction);
1058 } 1056 }
1059 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_1_(u nwrap_jso(this), range)); 1057 return _blink.BlinkIDBObjectStore.instance.openCursor_Callback_1_(this, rang e);
1060 } 1058 }
1061 1059
1062 Request openKeyCursor(Object range, [String direction]) { 1060 Request openKeyCursor(Object range, [String direction]) {
1063 if (direction != null) { 1061 if (direction != null) {
1064 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback _2_(unwrap_jso(this), range, direction)); 1062 return _blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_2_(this, range, direction);
1065 } 1063 }
1066 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_1 _(unwrap_jso(this), range)); 1064 return _blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_1_(this, r ange);
1067 } 1065 }
1068 1066
1069 Request _put(Object value, [Object key]) { 1067 Request _put(Object value, [Object key]) {
1070 if (key != null) { 1068 if (key != null) {
1071 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_2_(unwrap _jso(this), convertDartToNative_SerializedScriptValue(value), convertDartToNativ e_SerializedScriptValue(key))); 1069 return _blink.BlinkIDBObjectStore.instance.put_Callback_2_(this, convertDa rtToNative_SerializedScriptValue(value), convertDartToNative_SerializedScriptVal ue(key));
1072 } 1070 }
1073 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_1_(unwrap_j so(this), convertDartToNative_SerializedScriptValue(value))); 1071 return _blink.BlinkIDBObjectStore.instance.put_Callback_1_(this, convertDart ToNative_SerializedScriptValue(value));
1074 } 1072 }
1075 1073
1076 1074
1077 /** 1075 /**
1078 * Helper for iterating over cursors in a request. 1076 * Helper for iterating over cursors in a request.
1079 */ 1077 */
1080 static Stream<Cursor> _cursorStreamFromResult(Request request, 1078 static Stream<Cursor> _cursorStreamFromResult(Request request,
1081 bool autoAdvance) { 1079 bool autoAdvance) {
1082 // TODO: need to guarantee that the controller provides the values 1080 // TODO: need to guarantee that the controller provides the values
1083 // immediately as waiting until the next tick will cause the transaction to 1081 // immediately as waiting until the next tick will cause the transaction to
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 * handlers that are not necessarily instances of [OpenDBRequest]. 1128 * handlers that are not necessarily instances of [OpenDBRequest].
1131 * 1129 *
1132 * See [EventStreamProvider] for usage information. 1130 * See [EventStreamProvider] for usage information.
1133 */ 1131 */
1134 @DomName('IDBOpenDBRequest.upgradeneededEvent') 1132 @DomName('IDBOpenDBRequest.upgradeneededEvent')
1135 @DocsEditable() 1133 @DocsEditable()
1136 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); 1134 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons t EventStreamProvider<VersionChangeEvent>('upgradeneeded');
1137 1135
1138 1136
1139 @Deprecated("Internal Use Only") 1137 @Deprecated("Internal Use Only")
1140 static OpenDBRequest internalCreateOpenDBRequest() { 1138 external static Type get instanceRuntimeType;
1141 return new OpenDBRequest._internalWrap();
1142 }
1143
1144 external factory OpenDBRequest._internalWrap();
1145 1139
1146 @Deprecated("Internal Use Only") 1140 @Deprecated("Internal Use Only")
1147 OpenDBRequest.internal_() : super.internal_(); 1141 OpenDBRequest.internal_() : super.internal_();
1148 1142
1149 1143
1150 /// Stream of `blocked` events handled by this [OpenDBRequest]. 1144 /// Stream of `blocked` events handled by this [OpenDBRequest].
1151 @DomName('IDBOpenDBRequest.onblocked') 1145 @DomName('IDBOpenDBRequest.onblocked')
1152 @DocsEditable() 1146 @DocsEditable()
1153 Stream<Event> get onBlocked => blockedEvent.forTarget(this); 1147 Stream<Event> get onBlocked => blockedEvent.forTarget(this);
1154 1148
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 * handlers that are not necessarily instances of [Request]. 1181 * handlers that are not necessarily instances of [Request].
1188 * 1182 *
1189 * See [EventStreamProvider] for usage information. 1183 * See [EventStreamProvider] for usage information.
1190 */ 1184 */
1191 @DomName('IDBRequest.successEvent') 1185 @DomName('IDBRequest.successEvent')
1192 @DocsEditable() 1186 @DocsEditable()
1193 static const EventStreamProvider<Event> successEvent = const EventStreamProvid er<Event>('success'); 1187 static const EventStreamProvider<Event> successEvent = const EventStreamProvid er<Event>('success');
1194 1188
1195 1189
1196 @Deprecated("Internal Use Only") 1190 @Deprecated("Internal Use Only")
1197 static Request internalCreateRequest() { 1191 external static Type get instanceRuntimeType;
1198 return new Request._internalWrap();
1199 }
1200
1201 external factory Request._internalWrap();
1202 1192
1203 @Deprecated("Internal Use Only") 1193 @Deprecated("Internal Use Only")
1204 Request.internal_() : super.internal_(); 1194 Request.internal_() : super.internal_();
1205 1195
1206 1196
1207 @DomName('IDBRequest.error') 1197 @DomName('IDBRequest.error')
1208 @DocsEditable() 1198 @DocsEditable()
1209 DomError get error => wrap_jso(_blink.BlinkIDBRequest.instance.error_Getter_(u nwrap_jso(this))); 1199 DomError get error => _blink.BlinkIDBRequest.instance.error_Getter_(this);
1210 1200
1211 @DomName('IDBRequest.readyState') 1201 @DomName('IDBRequest.readyState')
1212 @DocsEditable() 1202 @DocsEditable()
1213 String get readyState => _blink.BlinkIDBRequest.instance.readyState_Getter_(un wrap_jso(this)); 1203 String get readyState => _blink.BlinkIDBRequest.instance.readyState_Getter_(th is);
1214 1204
1215 @DomName('IDBRequest.result') 1205 @DomName('IDBRequest.result')
1216 @DocsEditable() 1206 @DocsEditable()
1217 Object get result => wrap_jso(_blink.BlinkIDBRequest.instance.result_Getter_(u nwrap_jso(this))); 1207 Object get result => _convertNativeToDart_IDBAny(_blink.BlinkIDBRequest.instan ce.result_Getter_(this));
1218 1208
1219 @DomName('IDBRequest.source') 1209 @DomName('IDBRequest.source')
1220 @DocsEditable() 1210 @DocsEditable()
1221 Object get source => wrap_jso(_blink.BlinkIDBRequest.instance.source_Getter_(u nwrap_jso(this))); 1211 Object get source => (_blink.BlinkIDBRequest.instance.source_Getter_(this));
1222 1212
1223 @DomName('IDBRequest.transaction') 1213 @DomName('IDBRequest.transaction')
1224 @DocsEditable() 1214 @DocsEditable()
1225 Transaction get transaction => wrap_jso(_blink.BlinkIDBRequest.instance.transa ction_Getter_(unwrap_jso(this))); 1215 Transaction get transaction => _blink.BlinkIDBRequest.instance.transaction_Get ter_(this);
1226 1216
1227 /// Stream of `error` events handled by this [Request]. 1217 /// Stream of `error` events handled by this [Request].
1228 @DomName('IDBRequest.onerror') 1218 @DomName('IDBRequest.onerror')
1229 @DocsEditable() 1219 @DocsEditable()
1230 Stream<Event> get onError => errorEvent.forTarget(this); 1220 Stream<Event> get onError => errorEvent.forTarget(this);
1231 1221
1232 /// Stream of `success` events handled by this [Request]. 1222 /// Stream of `success` events handled by this [Request].
1233 @DomName('IDBRequest.onsuccess') 1223 @DomName('IDBRequest.onsuccess')
1234 @DocsEditable() 1224 @DocsEditable()
1235 Stream<Event> get onSuccess => successEvent.forTarget(this); 1225 Stream<Event> get onSuccess => successEvent.forTarget(this);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 * handlers that are not necessarily instances of [Transaction]. 1290 * handlers that are not necessarily instances of [Transaction].
1301 * 1291 *
1302 * See [EventStreamProvider] for usage information. 1292 * See [EventStreamProvider] for usage information.
1303 */ 1293 */
1304 @DomName('IDBTransaction.errorEvent') 1294 @DomName('IDBTransaction.errorEvent')
1305 @DocsEditable() 1295 @DocsEditable()
1306 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error'); 1296 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
1307 1297
1308 1298
1309 @Deprecated("Internal Use Only") 1299 @Deprecated("Internal Use Only")
1310 static Transaction internalCreateTransaction() { 1300 external static Type get instanceRuntimeType;
1311 return new Transaction._internalWrap();
1312 }
1313
1314 external factory Transaction._internalWrap();
1315 1301
1316 @Deprecated("Internal Use Only") 1302 @Deprecated("Internal Use Only")
1317 Transaction.internal_() : super.internal_(); 1303 Transaction.internal_() : super.internal_();
1318 1304
1319 1305
1320 @DomName('IDBTransaction.db') 1306 @DomName('IDBTransaction.db')
1321 @DocsEditable() 1307 @DocsEditable()
1322 Database get db => wrap_jso(_blink.BlinkIDBTransaction.instance.db_Getter_(unw rap_jso(this))); 1308 Database get db => _blink.BlinkIDBTransaction.instance.db_Getter_(this);
1323 1309
1324 @DomName('IDBTransaction.error') 1310 @DomName('IDBTransaction.error')
1325 @DocsEditable() 1311 @DocsEditable()
1326 DomError get error => wrap_jso(_blink.BlinkIDBTransaction.instance.error_Gette r_(unwrap_jso(this))); 1312 DomError get error => _blink.BlinkIDBTransaction.instance.error_Getter_(this);
1327 1313
1328 @DomName('IDBTransaction.mode') 1314 @DomName('IDBTransaction.mode')
1329 @DocsEditable() 1315 @DocsEditable()
1330 String get mode => _blink.BlinkIDBTransaction.instance.mode_Getter_(unwrap_jso (this)); 1316 String get mode => _blink.BlinkIDBTransaction.instance.mode_Getter_(this);
1331 1317
1332 @DomName('IDBTransaction.objectStoreNames') 1318 @DomName('IDBTransaction.objectStoreNames')
1333 @DocsEditable() 1319 @DocsEditable()
1334 @Experimental() // untriaged 1320 @Experimental() // untriaged
1335 List<String> get objectStoreNames => wrap_jso(_blink.BlinkIDBTransaction.insta nce.objectStoreNames_Getter_(unwrap_jso(this))); 1321 List<String> get objectStoreNames => _blink.BlinkIDBTransaction.instance.objec tStoreNames_Getter_(this);
1336 1322
1337 @DomName('IDBTransaction.abort') 1323 @DomName('IDBTransaction.abort')
1338 @DocsEditable() 1324 @DocsEditable()
1339 void abort() => _blink.BlinkIDBTransaction.instance.abort_Callback_0_(unwrap_j so(this)); 1325 void abort() => _blink.BlinkIDBTransaction.instance.abort_Callback_0_(this);
1340 1326
1341 @DomName('IDBTransaction.objectStore') 1327 @DomName('IDBTransaction.objectStore')
1342 @DocsEditable() 1328 @DocsEditable()
1343 ObjectStore objectStore(String name) => wrap_jso(_blink.BlinkIDBTransaction.in stance.objectStore_Callback_1_(unwrap_jso(this), name)); 1329 ObjectStore objectStore(String name) => _blink.BlinkIDBTransaction.instance.ob jectStore_Callback_1_(this, name);
1344 1330
1345 /// Stream of `abort` events handled by this [Transaction]. 1331 /// Stream of `abort` events handled by this [Transaction].
1346 @DomName('IDBTransaction.onabort') 1332 @DomName('IDBTransaction.onabort')
1347 @DocsEditable() 1333 @DocsEditable()
1348 Stream<Event> get onAbort => abortEvent.forTarget(this); 1334 Stream<Event> get onAbort => abortEvent.forTarget(this);
1349 1335
1350 /// Stream of `complete` events handled by this [Transaction]. 1336 /// Stream of `complete` events handled by this [Transaction].
1351 @DomName('IDBTransaction.oncomplete') 1337 @DomName('IDBTransaction.oncomplete')
1352 @DocsEditable() 1338 @DocsEditable()
1353 Stream<Event> get onComplete => completeEvent.forTarget(this); 1339 Stream<Event> get onComplete => completeEvent.forTarget(this);
(...skipping 16 matching lines...) Expand all
1370 @Unstable() 1356 @Unstable()
1371 class VersionChangeEvent extends Event { 1357 class VersionChangeEvent extends Event {
1372 // To suppress missing implicit constructor warnings. 1358 // To suppress missing implicit constructor warnings.
1373 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); } 1359 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); }
1374 1360
1375 @DomName('IDBVersionChangeEvent.IDBVersionChangeEvent') 1361 @DomName('IDBVersionChangeEvent.IDBVersionChangeEvent')
1376 @DocsEditable() 1362 @DocsEditable()
1377 factory VersionChangeEvent(String type, [Map eventInitDict]) { 1363 factory VersionChangeEvent(String type, [Map eventInitDict]) {
1378 if (eventInitDict != null) { 1364 if (eventInitDict != null) {
1379 var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict); 1365 var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
1380 return wrap_jso(_blink.BlinkIDBVersionChangeEvent.instance.constructorCall back_2_(type, eventInitDict_1)); 1366 return _blink.BlinkIDBVersionChangeEvent.instance.constructorCallback_2_(t ype, eventInitDict_1);
1381 } 1367 }
1382 return wrap_jso(_blink.BlinkIDBVersionChangeEvent.instance.constructorCallba ck_1_(type)); 1368 return _blink.BlinkIDBVersionChangeEvent.instance.constructorCallback_1_(typ e);
1383 } 1369 }
1384 1370
1385 1371
1386 @Deprecated("Internal Use Only") 1372 @Deprecated("Internal Use Only")
1387 static VersionChangeEvent internalCreateVersionChangeEvent() { 1373 external static Type get instanceRuntimeType;
1388 return new VersionChangeEvent._internalWrap();
1389 }
1390
1391 external factory VersionChangeEvent._internalWrap();
1392 1374
1393 @Deprecated("Internal Use Only") 1375 @Deprecated("Internal Use Only")
1394 VersionChangeEvent.internal_() : super.internal_(); 1376 VersionChangeEvent.internal_() : super.internal_();
1395 1377
1396 1378
1397 @DomName('IDBVersionChangeEvent.dataLoss') 1379 @DomName('IDBVersionChangeEvent.dataLoss')
1398 @DocsEditable() 1380 @DocsEditable()
1399 @Experimental() // untriaged 1381 @Experimental() // untriaged
1400 String get dataLoss => _blink.BlinkIDBVersionChangeEvent.instance.dataLoss_Get ter_(unwrap_jso(this)); 1382 String get dataLoss => _blink.BlinkIDBVersionChangeEvent.instance.dataLoss_Get ter_(this);
1401 1383
1402 @DomName('IDBVersionChangeEvent.dataLossMessage') 1384 @DomName('IDBVersionChangeEvent.dataLossMessage')
1403 @DocsEditable() 1385 @DocsEditable()
1404 @Experimental() // untriaged 1386 @Experimental() // untriaged
1405 String get dataLossMessage => _blink.BlinkIDBVersionChangeEvent.instance.dataL ossMessage_Getter_(unwrap_jso(this)); 1387 String get dataLossMessage => _blink.BlinkIDBVersionChangeEvent.instance.dataL ossMessage_Getter_(this);
1406 1388
1407 @DomName('IDBVersionChangeEvent.newVersion') 1389 @DomName('IDBVersionChangeEvent.newVersion')
1408 @DocsEditable() 1390 @DocsEditable()
1409 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge tter_(unwrap_jso(this)); 1391 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge tter_(this);
1410 1392
1411 @DomName('IDBVersionChangeEvent.oldVersion') 1393 @DomName('IDBVersionChangeEvent.oldVersion')
1412 @DocsEditable() 1394 @DocsEditable()
1413 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge tter_(unwrap_jso(this)); 1395 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge tter_(this);
1414 1396
1415 } 1397 }
OLDNEW
« no previous file with comments | « sdk/lib/html/html_common/conversions_dartium.dart ('k') | sdk/lib/js/dartium/cached_patches.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698