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

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

Issue 1173403004: Changed to use JSInterop (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Re-gen'd somehow diffs stopped showing up in CL Created 5 years, 5 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
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/svg/dartium/svg_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 'IDBFactory': () => IdbFactory, 114 'IDBFactory': () => IdbFactory,
115 'IDBIndex': () => Index, 115 'IDBIndex': () => Index,
116 'IDBKeyRange': () => KeyRange, 116 'IDBKeyRange': () => KeyRange,
117 'IDBObjectStore': () => ObjectStore, 117 'IDBObjectStore': () => ObjectStore,
118 'IDBOpenDBRequest': () => OpenDBRequest, 118 'IDBOpenDBRequest': () => OpenDBRequest,
119 'IDBRequest': () => Request, 119 'IDBRequest': () => Request,
120 'IDBTransaction': () => Transaction, 120 'IDBTransaction': () => Transaction,
121 'IDBVersionChangeEvent': () => VersionChangeEvent, 121 'IDBVersionChangeEvent': () => VersionChangeEvent,
122 122
123 }; 123 };
124
124 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 125 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
125 // for details. All rights reserved. Use of this source code is governed by a 126 // for details. All rights reserved. Use of this source code is governed by a
126 // BSD-style license that can be found in the LICENSE file. 127 // BSD-style license that can be found in the LICENSE file.
127 128
128 129
129 @DomName('IDBCursor') 130 @DomName('IDBCursor')
130 @Unstable() 131 @Unstable()
131 class Cursor extends NativeFieldWrapperClass2 { 132 class Cursor extends NativeFieldWrapperClass2 {
132 @DomName('IDBCursor.delete') 133 @DomName('IDBCursor.delete')
133 Future delete() { 134 Future delete() {
134 try { 135 try {
135 return _completeRequest(_delete()); 136 return _completeRequest(_delete());
136 } catch (e, stacktrace) { 137 } catch (e, stacktrace) {
137 return new Future.error(e, stacktrace); 138 return new Future.error(e, stacktrace);
138 } 139 }
139 } 140 }
140 141
141 @DomName('IDBCursor.value') 142 @DomName('IDBCursor.value')
142 Future update(value) { 143 Future update(value) {
143 try { 144 try {
144 return _completeRequest(_update(value)); 145 return _completeRequest(_update(value));
145 } catch (e, stacktrace) { 146 } catch (e, stacktrace) {
146 return new Future.error(e, stacktrace); 147 return new Future.error(e, stacktrace);
147 } 148 }
148 } 149 }
149 150
150 // To suppress missing implicit constructor warnings. 151 // To suppress missing implicit constructor warnings.
151 factory Cursor._() { throw new UnsupportedError("Not supported"); } 152 factory Cursor._() { throw new UnsupportedError("Not supported"); }
152 153
154 static Cursor internalCreateCursor() {
155 return new Cursor._internalWrap();
156 }
157
158 JsObject blink_jsObject = null;
159
160 factory Cursor._internalWrap() {
161 return new Cursor._internal();
162 }
163
164 Cursor._internal() { }
165
166 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
167
153 @DomName('IDBCursor.direction') 168 @DomName('IDBCursor.direction')
154 @DocsEditable() 169 @DocsEditable()
155 String get direction => _blink.BlinkIDBCursor.instance.direction_Getter_(this) ; 170 String get direction => _blink.BlinkIDBCursor.instance.direction_Getter_(unwra p_jso(this));
156 171
157 @DomName('IDBCursor.key') 172 @DomName('IDBCursor.key')
158 @DocsEditable() 173 @DocsEditable()
159 Object get key => _blink.BlinkIDBCursor.instance.key_Getter_(this); 174 Object get key => _blink.BlinkIDBCursor.instance.key_Getter_(unwrap_jso(this)) ;
160 175
161 @DomName('IDBCursor.primaryKey') 176 @DomName('IDBCursor.primaryKey')
162 @DocsEditable() 177 @DocsEditable()
163 Object get primaryKey => _blink.BlinkIDBCursor.instance.primaryKey_Getter_(thi s); 178 Object get primaryKey => _blink.BlinkIDBCursor.instance.primaryKey_Getter_(unw rap_jso(this));
164 179
165 @DomName('IDBCursor.source') 180 @DomName('IDBCursor.source')
166 @DocsEditable() 181 @DocsEditable()
167 Object get source => _blink.BlinkIDBCursor.instance.source_Getter_(this); 182 Object get source => _blink.BlinkIDBCursor.instance.source_Getter_(unwrap_jso( this));
168 183
169 @DomName('IDBCursor.advance') 184 @DomName('IDBCursor.advance')
170 @DocsEditable() 185 @DocsEditable()
171 void advance(int count) => _blink.BlinkIDBCursor.instance.advance_Callback_1_( this, count); 186 void advance(int count) => _blink.BlinkIDBCursor.instance.advance_Callback_1_( unwrap_jso(this), count);
172 187
173 @DomName('IDBCursor.continuePrimaryKey') 188 @DomName('IDBCursor.continuePrimaryKey')
174 @DocsEditable() 189 @DocsEditable()
175 @Experimental() // untriaged 190 @Experimental() // untriaged
176 void continuePrimaryKey(Object key, Object primaryKey) => _blink.BlinkIDBCurso r.instance.continuePrimaryKey_Callback_2_(this, key, primaryKey); 191 void continuePrimaryKey(Object key, Object primaryKey) => _blink.BlinkIDBCurso r.instance.continuePrimaryKey_Callback_2_(unwrap_jso(this), key, primaryKey);
177 192
178 @DomName('IDBCursor.delete') 193 @DomName('IDBCursor.delete')
179 @DocsEditable() 194 @DocsEditable()
180 Request _delete() => _blink.BlinkIDBCursor.instance.delete_Callback_0_(this); 195 Request _delete() => wrap_jso(_blink.BlinkIDBCursor.instance.delete_Callback_0 _(unwrap_jso(this)));
181 196
182 void next([Object key]) { 197 void next([Object key]) {
183 if (key != null) { 198 if (key != null) {
184 _blink.BlinkIDBCursor.instance.continue_Callback_1_(this, key); 199 _blink.BlinkIDBCursor.instance.continue_Callback_1_(unwrap_jso(this), key) ;
185 return; 200 return;
186 } 201 }
187 _blink.BlinkIDBCursor.instance.continue_Callback_0_(this); 202 _blink.BlinkIDBCursor.instance.continue_Callback_0_(unwrap_jso(this));
188 return; 203 return;
189 } 204 }
190 205
191 @DomName('IDBCursor.update') 206 @DomName('IDBCursor.update')
192 @DocsEditable() 207 @DocsEditable()
193 Request _update(Object value) => _blink.BlinkIDBCursor.instance.update_Callbac k_1_(this, value); 208 Request _update(Object value) => wrap_jso(_blink.BlinkIDBCursor.instance.updat e_Callback_1_(unwrap_jso(this), value));
194 209
195 } 210 }
196 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 211 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
197 // for details. All rights reserved. Use of this source code is governed by a 212 // for details. All rights reserved. Use of this source code is governed by a
198 // BSD-style license that can be found in the LICENSE file. 213 // BSD-style license that can be found in the LICENSE file.
199 214
200 // WARNING: Do not edit - generated code. 215 // WARNING: Do not edit - generated code.
201 216
202 217
203 @DocsEditable() 218 @DocsEditable()
204 @DomName('IDBCursorWithValue') 219 @DomName('IDBCursorWithValue')
205 @Unstable() 220 @Unstable()
206 class CursorWithValue extends Cursor { 221 class CursorWithValue extends Cursor {
207 // To suppress missing implicit constructor warnings. 222 // To suppress missing implicit constructor warnings.
208 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); } 223 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); }
209 224
225
226 static CursorWithValue internalCreateCursorWithValue() {
227 return new CursorWithValue._internalWrap();
228 }
229
230 factory CursorWithValue._internalWrap() {
231 return new CursorWithValue._internal();
232 }
233
234 CursorWithValue._internal() : super._internal();
235
236
210 @DomName('IDBCursorWithValue.value') 237 @DomName('IDBCursorWithValue.value')
211 @DocsEditable() 238 @DocsEditable()
212 Object get value => _blink.BlinkIDBCursorWithValue.instance.value_Getter_(this ); 239 Object get value => _blink.BlinkIDBCursorWithValue.instance.value_Getter_(unwr ap_jso(this));
213 240
214 } 241 }
215 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 242 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
216 // for details. All rights reserved. Use of this source code is governed by a 243 // for details. All rights reserved. Use of this source code is governed by a
217 // BSD-style license that can be found in the LICENSE file. 244 // BSD-style license that can be found in the LICENSE file.
218 245
219 246
220 @DocsEditable() 247 @DocsEditable()
221 /** 248 /**
222 * An indexed database object for storing client-side data 249 * An indexed database object for storing client-side data
223 * in web apps. 250 * in web apps.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 /** 310 /**
284 * Static factory designed to expose `versionchange` events to event 311 * Static factory designed to expose `versionchange` events to event
285 * handlers that are not necessarily instances of [Database]. 312 * handlers that are not necessarily instances of [Database].
286 * 313 *
287 * See [EventStreamProvider] for usage information. 314 * See [EventStreamProvider] for usage information.
288 */ 315 */
289 @DomName('IDBDatabase.versionchangeEvent') 316 @DomName('IDBDatabase.versionchangeEvent')
290 @DocsEditable() 317 @DocsEditable()
291 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons t EventStreamProvider<VersionChangeEvent>('versionchange'); 318 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons t EventStreamProvider<VersionChangeEvent>('versionchange');
292 319
320
321 static Database internalCreateDatabase() {
322 return new Database._internalWrap();
323 }
324
325 factory Database._internalWrap() {
326 return new Database._internal();
327 }
328
329 Database._internal() : super._internal();
330
331
293 @DomName('IDBDatabase.name') 332 @DomName('IDBDatabase.name')
294 @DocsEditable() 333 @DocsEditable()
295 String get name => _blink.BlinkIDBDatabase.instance.name_Getter_(this); 334 String get name => _blink.BlinkIDBDatabase.instance.name_Getter_(unwrap_jso(th is));
296 335
297 @DomName('IDBDatabase.objectStoreNames') 336 @DomName('IDBDatabase.objectStoreNames')
298 @DocsEditable() 337 @DocsEditable()
299 List<String> get objectStoreNames => _blink.BlinkIDBDatabase.instance.objectSt oreNames_Getter_(this); 338 List<String> get objectStoreNames => _blink.BlinkIDBDatabase.instance.objectSt oreNames_Getter_(unwrap_jso(this));
300 339
301 @DomName('IDBDatabase.version') 340 @DomName('IDBDatabase.version')
302 @DocsEditable() 341 @DocsEditable()
303 Object get version => _blink.BlinkIDBDatabase.instance.version_Getter_(this); 342 Object get version => _blink.BlinkIDBDatabase.instance.version_Getter_(unwrap_ jso(this));
304 343
305 @DomName('IDBDatabase.close') 344 @DomName('IDBDatabase.close')
306 @DocsEditable() 345 @DocsEditable()
307 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(this); 346 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(unwrap_jso( this));
308 347
309 ObjectStore _createObjectStore(String name, [Map options]) { 348 ObjectStore _createObjectStore(String name, [Map options]) {
310 if (options != null) { 349 if (options != null) {
311 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_2_(this , name, options); 350 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_2_(unwr ap_jso(this), name, options != null ? new js.JsObject.jsify(options) : options);
312 } 351 }
313 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_1_(this, name); 352 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_1_(unwrap _jso(this), name);
314 } 353 }
315 354
316 @DomName('IDBDatabase.deleteObjectStore') 355 @DomName('IDBDatabase.deleteObjectStore')
317 @DocsEditable() 356 @DocsEditable()
318 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete ObjectStore_Callback_1_(this, name); 357 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete ObjectStore_Callback_1_(unwrap_jso(this), name);
319 358
320 Transaction transaction(storeName_OR_storeNames, [String mode]) { 359 Transaction transaction(storeName_OR_storeNames, [String mode]) {
321 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) & & mode == null) { 360 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) & & mode == null) {
322 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, stor eName_OR_storeNames); 361 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames));
323 } 362 }
324 if ((mode is String || mode == null) && (storeName_OR_storeNames is String | | storeName_OR_storeNames == null)) { 363 if ((mode is String || mode == null) && (storeName_OR_storeNames is String | | storeName_OR_storeNames == null)) {
325 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eName_OR_storeNames, mode); 364 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames), mode);
326 } 365 }
327 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n ull) && mode == null) { 366 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n ull) && mode == null) {
328 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, stor eName_OR_storeNames); 367 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames));
329 } 368 }
330 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str ing> || storeName_OR_storeNames == null)) { 369 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str ing> || storeName_OR_storeNames == null)) {
331 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eName_OR_storeNames, mode); 370 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames), mode);
332 } 371 }
333 if ((storeName_OR_storeNames is DomStringList || storeName_OR_storeNames == null) && mode == null) { 372 if ((storeName_OR_storeNames is DomStringList || storeName_OR_storeNames == null) && mode == null) {
334 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, stor eName_OR_storeNames); 373 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames));
335 } 374 }
336 if ((mode is String || mode == null) && (storeName_OR_storeNames is DomStrin gList || storeName_OR_storeNames == null)) { 375 if ((mode is String || mode == null) && (storeName_OR_storeNames is DomStrin gList || storeName_OR_storeNames == null)) {
337 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eName_OR_storeNames, mode); 376 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames), mode);
338 } 377 }
339 throw new ArgumentError("Incorrect number or type of arguments"); 378 throw new ArgumentError("Incorrect number or type of arguments");
340 } 379 }
341 380
342 Transaction transactionList(List<String> storeNames, [String mode]) { 381 Transaction transactionList(List<String> storeNames, [String mode]) {
343 if (mode != null) { 382 if (mode != null) {
344 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eNames, mode); 383 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), storeNames, mode);
345 } 384 }
346 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, storeN ames); 385 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(t his), storeNames);
347 } 386 }
348 387
349 Transaction transactionStore(String storeName, [String mode]) { 388 Transaction transactionStore(String storeName, [String mode]) {
350 if (mode != null) { 389 if (mode != null) {
351 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eName, mode); 390 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), storeName, mode);
352 } 391 }
353 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, storeN ame); 392 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(t his), storeName);
354 } 393 }
355 394
356 Transaction transactionStores(List<String> storeNames, [String mode]) { 395 Transaction transactionStores(List<String> storeNames, [String mode]) {
357 if (mode != null) { 396 if (mode != null) {
358 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eNames, mode); 397 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), unwrap_jso(storeNames), mode);
359 } 398 }
360 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, storeN ames); 399 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(t his), unwrap_jso(storeNames));
361 } 400 }
362 401
363 /// Stream of `abort` events handled by this [Database]. 402 /// Stream of `abort` events handled by this [Database].
364 @DomName('IDBDatabase.onabort') 403 @DomName('IDBDatabase.onabort')
365 @DocsEditable() 404 @DocsEditable()
366 Stream<Event> get onAbort => abortEvent.forTarget(this); 405 Stream<Event> get onAbort => abortEvent.forTarget(this);
367 406
368 /// Stream of `close` events handled by this [Database]. 407 /// Stream of `close` events handled by this [Database].
369 @DomName('IDBDatabase.onclose') 408 @DomName('IDBDatabase.onclose')
370 @DocsEditable() 409 @DocsEditable()
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 /** 504 /**
466 * Checks to see if getDatabaseNames is supported by the current platform. 505 * Checks to see if getDatabaseNames is supported by the current platform.
467 */ 506 */
468 bool get supportsDatabaseNames { 507 bool get supportsDatabaseNames {
469 return true; 508 return true;
470 } 509 }
471 510
472 // To suppress missing implicit constructor warnings. 511 // To suppress missing implicit constructor warnings.
473 factory IdbFactory._() { throw new UnsupportedError("Not supported"); } 512 factory IdbFactory._() { throw new UnsupportedError("Not supported"); }
474 513
514 static IdbFactory internalCreateIdbFactory() {
515 return new IdbFactory._internalWrap();
516 }
517
518 JsObject blink_jsObject = null;
519
520 factory IdbFactory._internalWrap() {
521 return new IdbFactory._internal();
522 }
523
524 IdbFactory._internal() { }
525
526 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
527
475 @DomName('IDBFactory.cmp') 528 @DomName('IDBFactory.cmp')
476 @DocsEditable() 529 @DocsEditable()
477 int cmp(Object first, Object second) => _blink.BlinkIDBFactory.instance.cmp_Ca llback_2_(this, first, second); 530 int cmp(Object first, Object second) => _blink.BlinkIDBFactory.instance.cmp_Ca llback_2_(unwrap_jso(this), first, second);
478 531
479 @DomName('IDBFactory.deleteDatabase') 532 @DomName('IDBFactory.deleteDatabase')
480 @DocsEditable() 533 @DocsEditable()
481 OpenDBRequest _deleteDatabase(String name) => _blink.BlinkIDBFactory.instance. deleteDatabase_Callback_1_(this, name); 534 OpenDBRequest _deleteDatabase(String name) => _blink.BlinkIDBFactory.instance. deleteDatabase_Callback_1_(unwrap_jso(this), name);
482 535
483 OpenDBRequest _open(String name, [int version]) { 536 OpenDBRequest _open(String name, [int version]) {
484 if (version != null) { 537 if (version != null) {
485 return _blink.BlinkIDBFactory.instance.open_Callback_2_(this, name, versio n); 538 return _blink.BlinkIDBFactory.instance.open_Callback_2_(unwrap_jso(this), name, version);
486 } 539 }
487 return _blink.BlinkIDBFactory.instance.open_Callback_1_(this, name); 540 return _blink.BlinkIDBFactory.instance.open_Callback_1_(unwrap_jso(this), na me);
488 } 541 }
489 542
490 @DomName('IDBFactory.webkitGetDatabaseNames') 543 @DomName('IDBFactory.webkitGetDatabaseNames')
491 @DocsEditable() 544 @DocsEditable()
492 @SupportedBrowser(SupportedBrowser.CHROME) 545 @SupportedBrowser(SupportedBrowser.CHROME)
493 @SupportedBrowser(SupportedBrowser.SAFARI) 546 @SupportedBrowser(SupportedBrowser.SAFARI)
494 @Experimental() 547 @Experimental()
495 Request _webkitGetDatabaseNames() => _blink.BlinkIDBFactory.instance.webkitGet DatabaseNames_Callback_0_(this); 548 Request _webkitGetDatabaseNames() => wrap_jso(_blink.BlinkIDBFactory.instance. webkitGetDatabaseNames_Callback_0_(unwrap_jso(this)));
496 549
497 } 550 }
498 551
499 552
500 /** 553 /**
501 * Ties a request to a completer, so the completer is completed when it succeeds 554 * Ties a request to a completer, so the completer is completed when it succeeds
502 * and errors out when the request errors. 555 * and errors out when the request errors.
503 */ 556 */
504 Future _completeRequest(Request request) { 557 Future _completeRequest(Request request) {
505 var completer = new Completer.sync(); 558 var completer = new Completer.sync();
506 // TODO: make sure that completer.complete is synchronous as transactions 559 // TODO: make sure that completer.complete is synchronous as transactions
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 request = _openKeyCursor(key_OR_range, "next"); 656 request = _openKeyCursor(key_OR_range, "next");
604 } else { 657 } else {
605 request = _openKeyCursor(key_OR_range, direction); 658 request = _openKeyCursor(key_OR_range, direction);
606 } 659 }
607 return ObjectStore._cursorStreamFromResult(request, autoAdvance); 660 return ObjectStore._cursorStreamFromResult(request, autoAdvance);
608 } 661 }
609 662
610 // To suppress missing implicit constructor warnings. 663 // To suppress missing implicit constructor warnings.
611 factory Index._() { throw new UnsupportedError("Not supported"); } 664 factory Index._() { throw new UnsupportedError("Not supported"); }
612 665
666 static Index internalCreateIndex() {
667 return new Index._internalWrap();
668 }
669
670 JsObject blink_jsObject = null;
671
672 factory Index._internalWrap() {
673 return new Index._internal();
674 }
675
676 Index._internal() { }
677
678 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
679
613 @DomName('IDBIndex.keyPath') 680 @DomName('IDBIndex.keyPath')
614 @DocsEditable() 681 @DocsEditable()
615 Object get keyPath => _blink.BlinkIDBIndex.instance.keyPath_Getter_(this); 682 Object get keyPath => _blink.BlinkIDBIndex.instance.keyPath_Getter_(unwrap_jso (this));
616 683
617 @DomName('IDBIndex.multiEntry') 684 @DomName('IDBIndex.multiEntry')
618 @DocsEditable() 685 @DocsEditable()
619 bool get multiEntry => _blink.BlinkIDBIndex.instance.multiEntry_Getter_(this); 686 bool get multiEntry => _blink.BlinkIDBIndex.instance.multiEntry_Getter_(unwrap _jso(this));
620 687
621 @DomName('IDBIndex.name') 688 @DomName('IDBIndex.name')
622 @DocsEditable() 689 @DocsEditable()
623 String get name => _blink.BlinkIDBIndex.instance.name_Getter_(this); 690 String get name => _blink.BlinkIDBIndex.instance.name_Getter_(unwrap_jso(this) );
624 691
625 @DomName('IDBIndex.objectStore') 692 @DomName('IDBIndex.objectStore')
626 @DocsEditable() 693 @DocsEditable()
627 ObjectStore get objectStore => _blink.BlinkIDBIndex.instance.objectStore_Gette r_(this); 694 ObjectStore get objectStore => wrap_jso(_blink.BlinkIDBIndex.instance.objectSt ore_Getter_(unwrap_jso(this)));
628 695
629 @DomName('IDBIndex.unique') 696 @DomName('IDBIndex.unique')
630 @DocsEditable() 697 @DocsEditable()
631 bool get unique => _blink.BlinkIDBIndex.instance.unique_Getter_(this); 698 bool get unique => _blink.BlinkIDBIndex.instance.unique_Getter_(unwrap_jso(thi s));
632 699
633 @DomName('IDBIndex.count') 700 @DomName('IDBIndex.count')
634 @DocsEditable() 701 @DocsEditable()
635 Request _count(Object key) => _blink.BlinkIDBIndex.instance.count_Callback_1_( this, key); 702 Request _count(Object key) => wrap_jso(_blink.BlinkIDBIndex.instance.count_Cal lback_1_(unwrap_jso(this), key));
636 703
637 @DomName('IDBIndex.get') 704 @DomName('IDBIndex.get')
638 @DocsEditable() 705 @DocsEditable()
639 Request _get(Object key) => _blink.BlinkIDBIndex.instance.get_Callback_1_(this , key); 706 Request _get(Object key) => wrap_jso(_blink.BlinkIDBIndex.instance.get_Callbac k_1_(unwrap_jso(this), key));
640 707
641 @DomName('IDBIndex.getKey') 708 @DomName('IDBIndex.getKey')
642 @DocsEditable() 709 @DocsEditable()
643 Request _getKey(Object key) => _blink.BlinkIDBIndex.instance.getKey_Callback_1 _(this, key); 710 Request _getKey(Object key) => wrap_jso(_blink.BlinkIDBIndex.instance.getKey_C allback_1_(unwrap_jso(this), key));
644 711
645 Request _openCursor(Object range, [String direction]) { 712 Request _openCursor(Object range, [String direction]) {
646 if (direction != null) { 713 if (direction != null) {
647 return _blink.BlinkIDBIndex.instance.openCursor_Callback_2_(this, range, d irection); 714 return wrap_jso(_blink.BlinkIDBIndex.instance.openCursor_Callback_2_(unwra p_jso(this), range, direction));
648 } 715 }
649 return _blink.BlinkIDBIndex.instance.openCursor_Callback_1_(this, range); 716 return wrap_jso(_blink.BlinkIDBIndex.instance.openCursor_Callback_1_(unwrap_ jso(this), range));
650 } 717 }
651 718
652 Request _openKeyCursor(Object range, [String direction]) { 719 Request _openKeyCursor(Object range, [String direction]) {
653 if (direction != null) { 720 if (direction != null) {
654 return _blink.BlinkIDBIndex.instance.openKeyCursor_Callback_2_(this, range , direction); 721 return wrap_jso(_blink.BlinkIDBIndex.instance.openKeyCursor_Callback_2_(un wrap_jso(this), range, direction));
655 } 722 }
656 return _blink.BlinkIDBIndex.instance.openKeyCursor_Callback_1_(this, range); 723 return wrap_jso(_blink.BlinkIDBIndex.instance.openKeyCursor_Callback_1_(unwr ap_jso(this), range));
657 } 724 }
658 725
659 } 726 }
660 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 727 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
661 // for details. All rights reserved. Use of this source code is governed by a 728 // for details. All rights reserved. Use of this source code is governed by a
662 // BSD-style license that can be found in the LICENSE file. 729 // BSD-style license that can be found in the LICENSE file.
663 730
664 731
665 @DomName('IDBKeyRange') 732 @DomName('IDBKeyRange')
666 @Unstable() 733 @Unstable()
(...skipping 12 matching lines...) Expand all
679 746
680 @DomName('KeyRange.bound') 747 @DomName('KeyRange.bound')
681 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, 748 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper,
682 [bool lowerOpen = false, bool upperOpen = false]) => 749 [bool lowerOpen = false, bool upperOpen = false]) =>
683 _KeyRangeFactoryProvider.createKeyRange_bound( 750 _KeyRangeFactoryProvider.createKeyRange_bound(
684 lower, upper, lowerOpen, upperOpen); 751 lower, upper, lowerOpen, upperOpen);
685 752
686 // To suppress missing implicit constructor warnings. 753 // To suppress missing implicit constructor warnings.
687 factory KeyRange._() { throw new UnsupportedError("Not supported"); } 754 factory KeyRange._() { throw new UnsupportedError("Not supported"); }
688 755
756 static KeyRange internalCreateKeyRange() {
757 return new KeyRange._internalWrap();
758 }
759
760 JsObject blink_jsObject = null;
761
762 factory KeyRange._internalWrap() {
763 return new KeyRange._internal();
764 }
765
766 KeyRange._internal() { }
767
768 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
769
689 @DomName('IDBKeyRange.lower') 770 @DomName('IDBKeyRange.lower')
690 @DocsEditable() 771 @DocsEditable()
691 Object get lower => _blink.BlinkIDBKeyRange.instance.lower_Getter_(this); 772 Object get lower => _blink.BlinkIDBKeyRange.instance.lower_Getter_(unwrap_jso( this));
692 773
693 @DomName('IDBKeyRange.lowerOpen') 774 @DomName('IDBKeyRange.lowerOpen')
694 @DocsEditable() 775 @DocsEditable()
695 bool get lowerOpen => _blink.BlinkIDBKeyRange.instance.lowerOpen_Getter_(this) ; 776 bool get lowerOpen => _blink.BlinkIDBKeyRange.instance.lowerOpen_Getter_(unwra p_jso(this));
696 777
697 @DomName('IDBKeyRange.upper') 778 @DomName('IDBKeyRange.upper')
698 @DocsEditable() 779 @DocsEditable()
699 Object get upper => _blink.BlinkIDBKeyRange.instance.upper_Getter_(this); 780 Object get upper => _blink.BlinkIDBKeyRange.instance.upper_Getter_(unwrap_jso( this));
700 781
701 @DomName('IDBKeyRange.upperOpen') 782 @DomName('IDBKeyRange.upperOpen')
702 @DocsEditable() 783 @DocsEditable()
703 bool get upperOpen => _blink.BlinkIDBKeyRange.instance.upperOpen_Getter_(this) ; 784 bool get upperOpen => _blink.BlinkIDBKeyRange.instance.upperOpen_Getter_(unwra p_jso(this));
704 785
705 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper Open]) { 786 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper Open]) {
706 if (upperOpen != null) { 787 if (upperOpen != null) {
707 return _blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower, upper, lo werOpen, upperOpen); 788 return _blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower, upper, lo werOpen, upperOpen);
708 } 789 }
709 if (lowerOpen != null) { 790 if (lowerOpen != null) {
710 return _blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower, upper, lo werOpen); 791 return _blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower, upper, lo werOpen);
711 } 792 }
712 return _blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, upper); 793 return _blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, upper);
713 } 794 }
714 795
715 static KeyRange lowerBound_(Object bound, [bool open]) { 796 static KeyRange lowerBound_(Object bound, [bool open]) {
716 if (open != null) { 797 if (open != null) {
717 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bound, open ); 798 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bound, open );
718 } 799 }
719 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(bound); 800 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(bound);
720 } 801 }
721 802
722 @DomName('IDBKeyRange.only_') 803 @DomName('IDBKeyRange.only_')
723 @DocsEditable() 804 @DocsEditable()
724 @Experimental() // non-standard 805 @Experimental() // non-standard
725 static KeyRange only_(Object value) => _blink.BlinkIDBKeyRange.instance.only_C allback_1_(value); 806 static KeyRange only_(Object value) => _blink.BlinkIDBKeyRange.instance.only_C allback_1_(value);
726 807
727 static KeyRange upperBound_(Object bound, [bool open]) { 808 static KeyRange upperBound_(Object bound, [bool open]) {
728 if (open != null) { 809 if (open != null) {
729 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bound, open ); 810 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bound, open );
730 } 811 }
731 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(bound); 812 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(bound);
732 } 813 }
733 814
734 } 815 }
735 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 816 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
736 // for details. All rights reserved. Use of this source code is governed by a 817 // for details. All rights reserved. Use of this source code is governed by a
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 if (multiEntry != null) { 944 if (multiEntry != null) {
864 options['multiEntry'] = multiEntry; 945 options['multiEntry'] = multiEntry;
865 } 946 }
866 947
867 return _createIndex(name, keyPath, options); 948 return _createIndex(name, keyPath, options);
868 } 949 }
869 950
870 // To suppress missing implicit constructor warnings. 951 // To suppress missing implicit constructor warnings.
871 factory ObjectStore._() { throw new UnsupportedError("Not supported"); } 952 factory ObjectStore._() { throw new UnsupportedError("Not supported"); }
872 953
954 static ObjectStore internalCreateObjectStore() {
955 return new ObjectStore._internalWrap();
956 }
957
958 JsObject blink_jsObject = null;
959
960 factory ObjectStore._internalWrap() {
961 return new ObjectStore._internal();
962 }
963
964 ObjectStore._internal() { }
965
966 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
967
873 @DomName('IDBObjectStore.autoIncrement') 968 @DomName('IDBObjectStore.autoIncrement')
874 @DocsEditable() 969 @DocsEditable()
875 bool get autoIncrement => _blink.BlinkIDBObjectStore.instance.autoIncrement_Ge tter_(this); 970 bool get autoIncrement => _blink.BlinkIDBObjectStore.instance.autoIncrement_Ge tter_(unwrap_jso(this));
876 971
877 @DomName('IDBObjectStore.indexNames') 972 @DomName('IDBObjectStore.indexNames')
878 @DocsEditable() 973 @DocsEditable()
879 List<String> get indexNames => _blink.BlinkIDBObjectStore.instance.indexNames_ Getter_(this); 974 List<String> get indexNames => _blink.BlinkIDBObjectStore.instance.indexNames_ Getter_(unwrap_jso(this));
880 975
881 @DomName('IDBObjectStore.keyPath') 976 @DomName('IDBObjectStore.keyPath')
882 @DocsEditable() 977 @DocsEditable()
883 Object get keyPath => _blink.BlinkIDBObjectStore.instance.keyPath_Getter_(this ); 978 Object get keyPath => _blink.BlinkIDBObjectStore.instance.keyPath_Getter_(unwr ap_jso(this));
884 979
885 @DomName('IDBObjectStore.name') 980 @DomName('IDBObjectStore.name')
886 @DocsEditable() 981 @DocsEditable()
887 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(this); 982 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(unwrap_jso (this));
888 983
889 @DomName('IDBObjectStore.transaction') 984 @DomName('IDBObjectStore.transaction')
890 @DocsEditable() 985 @DocsEditable()
891 Transaction get transaction => _blink.BlinkIDBObjectStore.instance.transaction _Getter_(this); 986 Transaction get transaction => wrap_jso(_blink.BlinkIDBObjectStore.instance.tr ansaction_Getter_(unwrap_jso(this)));
892 987
893 Request _add(Object value, [Object key]) { 988 Request _add(Object value, [Object key]) {
894 if (key != null) { 989 if (key != null) {
895 return _blink.BlinkIDBObjectStore.instance.add_Callback_2_(this, value, ke y); 990 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_2_(unwrap _jso(this), value, key));
896 } 991 }
897 return _blink.BlinkIDBObjectStore.instance.add_Callback_1_(this, value); 992 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_1_(unwrap_j so(this), value));
898 } 993 }
899 994
900 @DomName('IDBObjectStore.clear') 995 @DomName('IDBObjectStore.clear')
901 @DocsEditable() 996 @DocsEditable()
902 Request _clear() => _blink.BlinkIDBObjectStore.instance.clear_Callback_0_(this ); 997 Request _clear() => wrap_jso(_blink.BlinkIDBObjectStore.instance.clear_Callbac k_0_(unwrap_jso(this)));
903 998
904 @DomName('IDBObjectStore.count') 999 @DomName('IDBObjectStore.count')
905 @DocsEditable() 1000 @DocsEditable()
906 Request _count(Object key) => _blink.BlinkIDBObjectStore.instance.count_Callba ck_1_(this, key); 1001 Request _count(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.cou nt_Callback_1_(unwrap_jso(this), key));
907 1002
908 Index _createIndex(String name, keyPath, [Map options]) { 1003 Index _createIndex(String name, keyPath, [Map options]) {
909 if ((keyPath is String || keyPath == null) && (name is String || name == nul l) && options == null) { 1004 if ((keyPath is String || keyPath == null) && (name is String || name == nul l) && options == null) {
910 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(this, n ame, keyPath); 1005 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_ jso(this), name, unwrap_jso(keyPath));
911 } 1006 }
912 if ((options is Map || options == null) && (keyPath is String || keyPath == null) && (name is String || name == null)) { 1007 if ((options is Map || options == null) && (keyPath is String || keyPath == null) && (name is String || name == null)) {
913 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(this, n ame, keyPath, options); 1008 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_ jso(this), name, unwrap_jso(keyPath), options != null ? new js.JsObject.jsify(op tions) : options);
914 } 1009 }
915 if ((keyPath is List<String> || keyPath == null) && (name is String || name == null) && options == null) { 1010 if ((keyPath is List<String> || keyPath == null) && (name is String || name == null) && options == null) {
916 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(this, n ame, keyPath); 1011 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_ jso(this), name, unwrap_jso(keyPath));
917 } 1012 }
918 if ((options is Map || options == null) && (keyPath is List<String> || keyPa th == null) && (name is String || name == null)) { 1013 if ((options is Map || options == null) && (keyPath is List<String> || keyPa th == null) && (name is String || name == null)) {
919 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(this, n ame, keyPath, options); 1014 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_ jso(this), name, unwrap_jso(keyPath), options != null ? new js.JsObject.jsify(op tions) : options);
920 } 1015 }
921 throw new ArgumentError("Incorrect number or type of arguments"); 1016 throw new ArgumentError("Incorrect number or type of arguments");
922 } 1017 }
923 1018
924 @DomName('IDBObjectStore.delete') 1019 @DomName('IDBObjectStore.delete')
925 @DocsEditable() 1020 @DocsEditable()
926 Request _delete(Object key) => _blink.BlinkIDBObjectStore.instance.delete_Call back_1_(this, key); 1021 Request _delete(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.de lete_Callback_1_(unwrap_jso(this), key));
927 1022
928 @DomName('IDBObjectStore.deleteIndex') 1023 @DomName('IDBObjectStore.deleteIndex')
929 @DocsEditable() 1024 @DocsEditable()
930 void deleteIndex(String name) => _blink.BlinkIDBObjectStore.instance.deleteInd ex_Callback_1_(this, name); 1025 void deleteIndex(String name) => _blink.BlinkIDBObjectStore.instance.deleteInd ex_Callback_1_(unwrap_jso(this), name);
931 1026
932 @DomName('IDBObjectStore.get') 1027 @DomName('IDBObjectStore.get')
933 @DocsEditable() 1028 @DocsEditable()
934 Request _get(Object key) => _blink.BlinkIDBObjectStore.instance.get_Callback_1 _(this, key); 1029 Request _get(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.get_C allback_1_(unwrap_jso(this), key));
935 1030
936 @DomName('IDBObjectStore.index') 1031 @DomName('IDBObjectStore.index')
937 @DocsEditable() 1032 @DocsEditable()
938 Index index(String name) => _blink.BlinkIDBObjectStore.instance.index_Callback _1_(this, name); 1033 Index index(String name) => _blink.BlinkIDBObjectStore.instance.index_Callback _1_(unwrap_jso(this), name);
939 1034
940 Request _openCursor(Object range, [String direction]) { 1035 Request _openCursor(Object range, [String direction]) {
941 if (direction != null) { 1036 if (direction != null) {
942 return _blink.BlinkIDBObjectStore.instance.openCursor_Callback_2_(this, ra nge, direction); 1037 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_2_ (unwrap_jso(this), range, direction));
943 } 1038 }
944 return _blink.BlinkIDBObjectStore.instance.openCursor_Callback_1_(this, rang e); 1039 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_1_(u nwrap_jso(this), range));
945 } 1040 }
946 1041
947 Request openKeyCursor(Object range, [String direction]) { 1042 Request openKeyCursor(Object range, [String direction]) {
948 if (direction != null) { 1043 if (direction != null) {
949 return _blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_2_(this, range, direction); 1044 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback _2_(unwrap_jso(this), range, direction));
950 } 1045 }
951 return _blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_1_(this, r ange); 1046 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_1 _(unwrap_jso(this), range));
952 } 1047 }
953 1048
954 Request _put(Object value, [Object key]) { 1049 Request _put(Object value, [Object key]) {
955 if (key != null) { 1050 if (key != null) {
956 return _blink.BlinkIDBObjectStore.instance.put_Callback_2_(this, value, ke y); 1051 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_2_(unwrap _jso(this), value, key));
957 } 1052 }
958 return _blink.BlinkIDBObjectStore.instance.put_Callback_1_(this, value); 1053 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_1_(unwrap_j so(this), value));
959 } 1054 }
960 1055
961 1056
962 /** 1057 /**
963 * Helper for iterating over cursors in a request. 1058 * Helper for iterating over cursors in a request.
964 */ 1059 */
965 static Stream<Cursor> _cursorStreamFromResult(Request request, 1060 static Stream<Cursor> _cursorStreamFromResult(Request request,
966 bool autoAdvance) { 1061 bool autoAdvance) {
967 // TODO: need to guarantee that the controller provides the values 1062 // TODO: need to guarantee that the controller provides the values
968 // immediately as waiting until the next tick will cause the transaction to 1063 // immediately as waiting until the next tick will cause the transaction to
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 /** 1108 /**
1014 * Static factory designed to expose `upgradeneeded` events to event 1109 * Static factory designed to expose `upgradeneeded` events to event
1015 * handlers that are not necessarily instances of [OpenDBRequest]. 1110 * handlers that are not necessarily instances of [OpenDBRequest].
1016 * 1111 *
1017 * See [EventStreamProvider] for usage information. 1112 * See [EventStreamProvider] for usage information.
1018 */ 1113 */
1019 @DomName('IDBOpenDBRequest.upgradeneededEvent') 1114 @DomName('IDBOpenDBRequest.upgradeneededEvent')
1020 @DocsEditable() 1115 @DocsEditable()
1021 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); 1116 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons t EventStreamProvider<VersionChangeEvent>('upgradeneeded');
1022 1117
1118
1119 static OpenDBRequest internalCreateOpenDBRequest() {
1120 return new OpenDBRequest._internalWrap();
1121 }
1122
1123 factory OpenDBRequest._internalWrap() {
1124 return new OpenDBRequest._internal();
1125 }
1126
1127 OpenDBRequest._internal() : super._internal();
1128
1129
1023 /// Stream of `blocked` events handled by this [OpenDBRequest]. 1130 /// Stream of `blocked` events handled by this [OpenDBRequest].
1024 @DomName('IDBOpenDBRequest.onblocked') 1131 @DomName('IDBOpenDBRequest.onblocked')
1025 @DocsEditable() 1132 @DocsEditable()
1026 Stream<Event> get onBlocked => blockedEvent.forTarget(this); 1133 Stream<Event> get onBlocked => blockedEvent.forTarget(this);
1027 1134
1028 /// Stream of `upgradeneeded` events handled by this [OpenDBRequest]. 1135 /// Stream of `upgradeneeded` events handled by this [OpenDBRequest].
1029 @DomName('IDBOpenDBRequest.onupgradeneeded') 1136 @DomName('IDBOpenDBRequest.onupgradeneeded')
1030 @DocsEditable() 1137 @DocsEditable()
1031 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget (this); 1138 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget (this);
1032 1139
(...skipping 25 matching lines...) Expand all
1058 /** 1165 /**
1059 * Static factory designed to expose `success` events to event 1166 * Static factory designed to expose `success` events to event
1060 * handlers that are not necessarily instances of [Request]. 1167 * handlers that are not necessarily instances of [Request].
1061 * 1168 *
1062 * See [EventStreamProvider] for usage information. 1169 * See [EventStreamProvider] for usage information.
1063 */ 1170 */
1064 @DomName('IDBRequest.successEvent') 1171 @DomName('IDBRequest.successEvent')
1065 @DocsEditable() 1172 @DocsEditable()
1066 static const EventStreamProvider<Event> successEvent = const EventStreamProvid er<Event>('success'); 1173 static const EventStreamProvider<Event> successEvent = const EventStreamProvid er<Event>('success');
1067 1174
1175
1176 static Request internalCreateRequest() {
1177 return new Request._internalWrap();
1178 }
1179
1180 factory Request._internalWrap() {
1181 return new Request._internal();
1182 }
1183
1184 Request._internal() : super._internal();
1185
1186
1068 @DomName('IDBRequest.error') 1187 @DomName('IDBRequest.error')
1069 @DocsEditable() 1188 @DocsEditable()
1070 DomError get error => _blink.BlinkIDBRequest.instance.error_Getter_(this); 1189 DomError get error => wrap_jso(_blink.BlinkIDBRequest.instance.error_Getter_(u nwrap_jso(this)));
1071 1190
1072 @DomName('IDBRequest.readyState') 1191 @DomName('IDBRequest.readyState')
1073 @DocsEditable() 1192 @DocsEditable()
1074 String get readyState => _blink.BlinkIDBRequest.instance.readyState_Getter_(th is); 1193 String get readyState => _blink.BlinkIDBRequest.instance.readyState_Getter_(un wrap_jso(this));
1075 1194
1076 @DomName('IDBRequest.result') 1195 @DomName('IDBRequest.result')
1077 @DocsEditable() 1196 @DocsEditable()
1078 Object get result => _blink.BlinkIDBRequest.instance.result_Getter_(this); 1197 Object get result => _blink.BlinkIDBRequest.instance.result_Getter_(unwrap_jso (this));
1079 1198
1080 @DomName('IDBRequest.source') 1199 @DomName('IDBRequest.source')
1081 @DocsEditable() 1200 @DocsEditable()
1082 Object get source => _blink.BlinkIDBRequest.instance.source_Getter_(this); 1201 Object get source => _blink.BlinkIDBRequest.instance.source_Getter_(unwrap_jso (this));
1083 1202
1084 @DomName('IDBRequest.transaction') 1203 @DomName('IDBRequest.transaction')
1085 @DocsEditable() 1204 @DocsEditable()
1086 Transaction get transaction => _blink.BlinkIDBRequest.instance.transaction_Get ter_(this); 1205 Transaction get transaction => wrap_jso(_blink.BlinkIDBRequest.instance.transa ction_Getter_(unwrap_jso(this)));
1087 1206
1088 /// Stream of `error` events handled by this [Request]. 1207 /// Stream of `error` events handled by this [Request].
1089 @DomName('IDBRequest.onerror') 1208 @DomName('IDBRequest.onerror')
1090 @DocsEditable() 1209 @DocsEditable()
1091 Stream<Event> get onError => errorEvent.forTarget(this); 1210 Stream<Event> get onError => errorEvent.forTarget(this);
1092 1211
1093 /// Stream of `success` events handled by this [Request]. 1212 /// Stream of `success` events handled by this [Request].
1094 @DomName('IDBRequest.onsuccess') 1213 @DomName('IDBRequest.onsuccess')
1095 @DocsEditable() 1214 @DocsEditable()
1096 Stream<Event> get onSuccess => successEvent.forTarget(this); 1215 Stream<Event> get onSuccess => successEvent.forTarget(this);
1097 1216
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 /** 1278 /**
1160 * Static factory designed to expose `error` events to event 1279 * Static factory designed to expose `error` events to event
1161 * handlers that are not necessarily instances of [Transaction]. 1280 * handlers that are not necessarily instances of [Transaction].
1162 * 1281 *
1163 * See [EventStreamProvider] for usage information. 1282 * See [EventStreamProvider] for usage information.
1164 */ 1283 */
1165 @DomName('IDBTransaction.errorEvent') 1284 @DomName('IDBTransaction.errorEvent')
1166 @DocsEditable() 1285 @DocsEditable()
1167 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error'); 1286 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
1168 1287
1288
1289 static Transaction internalCreateTransaction() {
1290 return new Transaction._internalWrap();
1291 }
1292
1293 factory Transaction._internalWrap() {
1294 return new Transaction._internal();
1295 }
1296
1297 Transaction._internal() : super._internal();
1298
1299
1169 @DomName('IDBTransaction.db') 1300 @DomName('IDBTransaction.db')
1170 @DocsEditable() 1301 @DocsEditable()
1171 Database get db => _blink.BlinkIDBTransaction.instance.db_Getter_(this); 1302 Database get db => wrap_jso(_blink.BlinkIDBTransaction.instance.db_Getter_(unw rap_jso(this)));
1172 1303
1173 @DomName('IDBTransaction.error') 1304 @DomName('IDBTransaction.error')
1174 @DocsEditable() 1305 @DocsEditable()
1175 DomError get error => _blink.BlinkIDBTransaction.instance.error_Getter_(this); 1306 DomError get error => wrap_jso(_blink.BlinkIDBTransaction.instance.error_Gette r_(unwrap_jso(this)));
1176 1307
1177 @DomName('IDBTransaction.mode') 1308 @DomName('IDBTransaction.mode')
1178 @DocsEditable() 1309 @DocsEditable()
1179 String get mode => _blink.BlinkIDBTransaction.instance.mode_Getter_(this); 1310 String get mode => _blink.BlinkIDBTransaction.instance.mode_Getter_(unwrap_jso (this));
1180 1311
1181 @DomName('IDBTransaction.abort') 1312 @DomName('IDBTransaction.abort')
1182 @DocsEditable() 1313 @DocsEditable()
1183 void abort() => _blink.BlinkIDBTransaction.instance.abort_Callback_0_(this); 1314 void abort() => _blink.BlinkIDBTransaction.instance.abort_Callback_0_(unwrap_j so(this));
1184 1315
1185 @DomName('IDBTransaction.objectStore') 1316 @DomName('IDBTransaction.objectStore')
1186 @DocsEditable() 1317 @DocsEditable()
1187 ObjectStore objectStore(String name) => _blink.BlinkIDBTransaction.instance.ob jectStore_Callback_1_(this, name); 1318 ObjectStore objectStore(String name) => _blink.BlinkIDBTransaction.instance.ob jectStore_Callback_1_(unwrap_jso(this), name);
1188 1319
1189 /// Stream of `abort` events handled by this [Transaction]. 1320 /// Stream of `abort` events handled by this [Transaction].
1190 @DomName('IDBTransaction.onabort') 1321 @DomName('IDBTransaction.onabort')
1191 @DocsEditable() 1322 @DocsEditable()
1192 Stream<Event> get onAbort => abortEvent.forTarget(this); 1323 Stream<Event> get onAbort => abortEvent.forTarget(this);
1193 1324
1194 /// Stream of `complete` events handled by this [Transaction]. 1325 /// Stream of `complete` events handled by this [Transaction].
1195 @DomName('IDBTransaction.oncomplete') 1326 @DomName('IDBTransaction.oncomplete')
1196 @DocsEditable() 1327 @DocsEditable()
1197 Stream<Event> get onComplete => completeEvent.forTarget(this); 1328 Stream<Event> get onComplete => completeEvent.forTarget(this);
1198 1329
(...skipping 10 matching lines...) Expand all
1209 // WARNING: Do not edit - generated code. 1340 // WARNING: Do not edit - generated code.
1210 1341
1211 1342
1212 @DocsEditable() 1343 @DocsEditable()
1213 @DomName('IDBVersionChangeEvent') 1344 @DomName('IDBVersionChangeEvent')
1214 @Unstable() 1345 @Unstable()
1215 class VersionChangeEvent extends Event { 1346 class VersionChangeEvent extends Event {
1216 // To suppress missing implicit constructor warnings. 1347 // To suppress missing implicit constructor warnings.
1217 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); } 1348 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); }
1218 1349
1350
1351 static VersionChangeEvent internalCreateVersionChangeEvent() {
1352 return new VersionChangeEvent._internalWrap();
1353 }
1354
1355 factory VersionChangeEvent._internalWrap() {
1356 return new VersionChangeEvent._internal();
1357 }
1358
1359 VersionChangeEvent._internal() : super._internal();
1360
1361
1219 @DomName('IDBVersionChangeEvent.dataLoss') 1362 @DomName('IDBVersionChangeEvent.dataLoss')
1220 @DocsEditable() 1363 @DocsEditable()
1221 @Experimental() // untriaged 1364 @Experimental() // untriaged
1222 String get dataLoss => _blink.BlinkIDBVersionChangeEvent.instance.dataLoss_Get ter_(this); 1365 String get dataLoss => _blink.BlinkIDBVersionChangeEvent.instance.dataLoss_Get ter_(unwrap_jso(this));
1223 1366
1224 @DomName('IDBVersionChangeEvent.dataLossMessage') 1367 @DomName('IDBVersionChangeEvent.dataLossMessage')
1225 @DocsEditable() 1368 @DocsEditable()
1226 @Experimental() // untriaged 1369 @Experimental() // untriaged
1227 String get dataLossMessage => _blink.BlinkIDBVersionChangeEvent.instance.dataL ossMessage_Getter_(this); 1370 String get dataLossMessage => _blink.BlinkIDBVersionChangeEvent.instance.dataL ossMessage_Getter_(unwrap_jso(this));
1228 1371
1229 @DomName('IDBVersionChangeEvent.newVersion') 1372 @DomName('IDBVersionChangeEvent.newVersion')
1230 @DocsEditable() 1373 @DocsEditable()
1231 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge tter_(this); 1374 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge tter_(unwrap_jso(this));
1232 1375
1233 @DomName('IDBVersionChangeEvent.oldVersion') 1376 @DomName('IDBVersionChangeEvent.oldVersion')
1234 @DocsEditable() 1377 @DocsEditable()
1235 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge tter_(this); 1378 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge tter_(unwrap_jso(this));
1236 1379
1237 } 1380 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/svg/dartium/svg_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698