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

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: Revert accidental removal 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
OLDNEW
1 library dart.dom.indexed_db; 1 library dart.dom.indexed_db;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:html'; 4 import 'dart:html';
5 import 'dart:html_common'; 5 import 'dart:html_common';
6 import 'dart:nativewrappers'; 6 import 'dart:nativewrappers';
7 import 'dart:_blink' as _blink; 7 import 'dart:_blink' as _blink;
8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9 // for details. All rights reserved. Use of this source code is governed by a 9 // for details. All rights reserved. Use of this source code is governed by a
10 // BSD-style license that can be found in the LICENSE file. 10 // BSD-style license that can be found in the LICENSE file.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 'IDBFactory': () => IdbFactory, 42 'IDBFactory': () => IdbFactory,
43 'IDBIndex': () => Index, 43 'IDBIndex': () => Index,
44 'IDBKeyRange': () => KeyRange, 44 'IDBKeyRange': () => KeyRange,
45 'IDBObjectStore': () => ObjectStore, 45 'IDBObjectStore': () => ObjectStore,
46 'IDBOpenDBRequest': () => OpenDBRequest, 46 'IDBOpenDBRequest': () => OpenDBRequest,
47 'IDBRequest': () => Request, 47 'IDBRequest': () => Request,
48 'IDBTransaction': () => Transaction, 48 'IDBTransaction': () => Transaction,
49 'IDBVersionChangeEvent': () => VersionChangeEvent, 49 'IDBVersionChangeEvent': () => VersionChangeEvent,
50 50
51 }; 51 };
52
52 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 53 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
53 // for details. All rights reserved. Use of this source code is governed by a 54 // for details. All rights reserved. Use of this source code is governed by a
54 // BSD-style license that can be found in the LICENSE file. 55 // BSD-style license that can be found in the LICENSE file.
55 56
56 57
57 @DomName('IDBCursor') 58 @DomName('IDBCursor')
58 @Unstable() 59 @Unstable()
59 class Cursor extends NativeFieldWrapperClass2 { 60 class Cursor extends NativeFieldWrapperClass2 {
60 @DomName('IDBCursor.delete') 61 @DomName('IDBCursor.delete')
61 Future delete() { 62 Future delete() {
62 try { 63 try {
63 return _completeRequest(_delete()); 64 return _completeRequest(_delete());
64 } catch (e, stacktrace) { 65 } catch (e, stacktrace) {
65 return new Future.error(e, stacktrace); 66 return new Future.error(e, stacktrace);
66 } 67 }
67 } 68 }
68 69
69 @DomName('IDBCursor.value') 70 @DomName('IDBCursor.value')
70 Future update(value) { 71 Future update(value) {
71 try { 72 try {
72 return _completeRequest(_update(value)); 73 return _completeRequest(_update(value));
73 } catch (e, stacktrace) { 74 } catch (e, stacktrace) {
74 return new Future.error(e, stacktrace); 75 return new Future.error(e, stacktrace);
75 } 76 }
76 } 77 }
77 78
78 // To suppress missing implicit constructor warnings. 79 // To suppress missing implicit constructor warnings.
79 factory Cursor._() { throw new UnsupportedError("Not supported"); } 80 factory Cursor._() { throw new UnsupportedError("Not supported"); }
80 81
82 static Cursor internalCreateCursor() {
83 return new Cursor._internalWrap();
84 }
85
86 JsObject blink_jsObject = null;
87
88 factory Cursor._internalWrap() {
89 return new Cursor._internal();
90 }
91
92 Cursor._internal() { }
93
94 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
vsm 2015/07/08 20:01:58 Where are wrap_jso and unwrap_jso defined?
terry 2015/07/13 16:31:22 There is dart:html (emitted from the html_dartium.
95
81 @DomName('IDBCursor.direction') 96 @DomName('IDBCursor.direction')
82 @DocsEditable() 97 @DocsEditable()
83 String get direction => _blink.BlinkIDBCursor.instance.direction_Getter_(this) ; 98 String get direction => _blink.BlinkIDBCursor.instance.direction_Getter_(unwra p_jso(this));
84 99
85 @DomName('IDBCursor.key') 100 @DomName('IDBCursor.key')
86 @DocsEditable() 101 @DocsEditable()
87 Object get key => _blink.BlinkIDBCursor.instance.key_Getter_(this); 102 Object get key => _blink.BlinkIDBCursor.instance.key_Getter_(unwrap_jso(this)) ;
88 103
89 @DomName('IDBCursor.primaryKey') 104 @DomName('IDBCursor.primaryKey')
90 @DocsEditable() 105 @DocsEditable()
91 Object get primaryKey => _blink.BlinkIDBCursor.instance.primaryKey_Getter_(thi s); 106 Object get primaryKey => _blink.BlinkIDBCursor.instance.primaryKey_Getter_(unw rap_jso(this));
92 107
93 @DomName('IDBCursor.source') 108 @DomName('IDBCursor.source')
94 @DocsEditable() 109 @DocsEditable()
95 Object get source => _blink.BlinkIDBCursor.instance.source_Getter_(this); 110 Object get source => _blink.BlinkIDBCursor.instance.source_Getter_(unwrap_jso( this));
96 111
97 @DomName('IDBCursor.advance') 112 @DomName('IDBCursor.advance')
98 @DocsEditable() 113 @DocsEditable()
99 void advance(int count) => _blink.BlinkIDBCursor.instance.advance_Callback_1_( this, count); 114 void advance(int count) => _blink.BlinkIDBCursor.instance.advance_Callback_1_( unwrap_jso(this), count);
100 115
101 @DomName('IDBCursor.continuePrimaryKey') 116 @DomName('IDBCursor.continuePrimaryKey')
102 @DocsEditable() 117 @DocsEditable()
103 @Experimental() // untriaged 118 @Experimental() // untriaged
104 void continuePrimaryKey(Object key, Object primaryKey) => _blink.BlinkIDBCurso r.instance.continuePrimaryKey_Callback_2_(this, key, primaryKey); 119 void continuePrimaryKey(Object key, Object primaryKey) => _blink.BlinkIDBCurso r.instance.continuePrimaryKey_Callback_2_(unwrap_jso(this), key, primaryKey);
105 120
106 @DomName('IDBCursor.delete') 121 @DomName('IDBCursor.delete')
107 @DocsEditable() 122 @DocsEditable()
108 Request _delete() => _blink.BlinkIDBCursor.instance.delete_Callback_0_(this); 123 Request _delete() => wrap_jso(_blink.BlinkIDBCursor.instance.delete_Callback_0 _(unwrap_jso(this)));
109 124
110 void next([Object key]) { 125 void next([Object key]) {
111 if (key != null) { 126 if (key != null) {
112 _blink.BlinkIDBCursor.instance.continue_Callback_1_(this, key); 127 _blink.BlinkIDBCursor.instance.continue_Callback_1_(unwrap_jso(this), key) ;
113 return; 128 return;
114 } 129 }
115 _blink.BlinkIDBCursor.instance.continue_Callback_0_(this); 130 _blink.BlinkIDBCursor.instance.continue_Callback_0_(unwrap_jso(this));
116 return; 131 return;
117 } 132 }
118 133
119 @DomName('IDBCursor.update') 134 @DomName('IDBCursor.update')
120 @DocsEditable() 135 @DocsEditable()
121 Request _update(Object value) => _blink.BlinkIDBCursor.instance.update_Callbac k_1_(this, value); 136 Request _update(Object value) => wrap_jso(_blink.BlinkIDBCursor.instance.updat e_Callback_1_(unwrap_jso(this), value));
122 137
123 } 138 }
124 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 139 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
125 // for details. All rights reserved. Use of this source code is governed by a 140 // 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. 141 // BSD-style license that can be found in the LICENSE file.
127 142
128 // WARNING: Do not edit - generated code. 143 // WARNING: Do not edit - generated code.
129 144
130 145
131 @DocsEditable() 146 @DocsEditable()
132 @DomName('IDBCursorWithValue') 147 @DomName('IDBCursorWithValue')
133 @Unstable() 148 @Unstable()
134 class CursorWithValue extends Cursor { 149 class CursorWithValue extends Cursor {
135 // To suppress missing implicit constructor warnings. 150 // To suppress missing implicit constructor warnings.
136 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); } 151 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); }
137 152
153
154 static CursorWithValue internalCreateCursorWithValue() {
155 return new CursorWithValue._internalWrap();
156 }
157
158 factory CursorWithValue._internalWrap() {
159 return new CursorWithValue._internal();
160 }
161
162 CursorWithValue._internal() : super._internal();
163
164
138 @DomName('IDBCursorWithValue.value') 165 @DomName('IDBCursorWithValue.value')
139 @DocsEditable() 166 @DocsEditable()
140 Object get value => _blink.BlinkIDBCursorWithValue.instance.value_Getter_(this ); 167 Object get value => _blink.BlinkIDBCursorWithValue.instance.value_Getter_(unwr ap_jso(this));
141 168
142 } 169 }
143 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 170 // 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 171 // 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. 172 // BSD-style license that can be found in the LICENSE file.
146 173
147 174
148 @DocsEditable() 175 @DocsEditable()
149 /** 176 /**
150 * An indexed database object for storing client-side data 177 * An indexed database object for storing client-side data
151 * in web apps. 178 * in web apps.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 /** 238 /**
212 * Static factory designed to expose `versionchange` events to event 239 * Static factory designed to expose `versionchange` events to event
213 * handlers that are not necessarily instances of [Database]. 240 * handlers that are not necessarily instances of [Database].
214 * 241 *
215 * See [EventStreamProvider] for usage information. 242 * See [EventStreamProvider] for usage information.
216 */ 243 */
217 @DomName('IDBDatabase.versionchangeEvent') 244 @DomName('IDBDatabase.versionchangeEvent')
218 @DocsEditable() 245 @DocsEditable()
219 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons t EventStreamProvider<VersionChangeEvent>('versionchange'); 246 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons t EventStreamProvider<VersionChangeEvent>('versionchange');
220 247
248
249 static Database internalCreateDatabase() {
250 return new Database._internalWrap();
251 }
252
253 factory Database._internalWrap() {
254 return new Database._internal();
255 }
256
257 Database._internal() : super._internal();
258
259
221 @DomName('IDBDatabase.name') 260 @DomName('IDBDatabase.name')
222 @DocsEditable() 261 @DocsEditable()
223 String get name => _blink.BlinkIDBDatabase.instance.name_Getter_(this); 262 String get name => _blink.BlinkIDBDatabase.instance.name_Getter_(unwrap_jso(th is));
224 263
225 @DomName('IDBDatabase.objectStoreNames') 264 @DomName('IDBDatabase.objectStoreNames')
226 @DocsEditable() 265 @DocsEditable()
227 List<String> get objectStoreNames => _blink.BlinkIDBDatabase.instance.objectSt oreNames_Getter_(this); 266 List<String> get objectStoreNames => _blink.BlinkIDBDatabase.instance.objectSt oreNames_Getter_(unwrap_jso(this));
228 267
229 @DomName('IDBDatabase.version') 268 @DomName('IDBDatabase.version')
230 @DocsEditable() 269 @DocsEditable()
231 Object get version => _blink.BlinkIDBDatabase.instance.version_Getter_(this); 270 Object get version => _blink.BlinkIDBDatabase.instance.version_Getter_(unwrap_ jso(this));
232 271
233 @DomName('IDBDatabase.close') 272 @DomName('IDBDatabase.close')
234 @DocsEditable() 273 @DocsEditable()
235 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(this); 274 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(unwrap_jso( this));
236 275
237 ObjectStore _createObjectStore(String name, [Map options]) { 276 ObjectStore _createObjectStore(String name, [Map options]) {
238 if (options != null) { 277 if (options != null) {
239 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_2_(this , name, options); 278 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_2_(unwr ap_jso(this), name, options != null ? new js.JsObject.jsify(options) : options);
240 } 279 }
241 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_1_(this, name); 280 return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_1_(unwrap _jso(this), name);
242 } 281 }
243 282
244 @DomName('IDBDatabase.deleteObjectStore') 283 @DomName('IDBDatabase.deleteObjectStore')
245 @DocsEditable() 284 @DocsEditable()
246 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete ObjectStore_Callback_1_(this, name); 285 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete ObjectStore_Callback_1_(unwrap_jso(this), name);
247 286
248 Transaction transaction(storeName_OR_storeNames, [String mode]) { 287 Transaction transaction(storeName_OR_storeNames, [String mode]) {
249 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) & & mode == null) { 288 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) & & mode == null) {
250 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, stor eName_OR_storeNames); 289 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames));
251 } 290 }
252 if ((mode is String || mode == null) && (storeName_OR_storeNames is String | | storeName_OR_storeNames == null)) { 291 if ((mode is String || mode == null) && (storeName_OR_storeNames is String | | storeName_OR_storeNames == null)) {
253 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eName_OR_storeNames, mode); 292 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames), mode);
254 } 293 }
255 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n ull) && mode == null) { 294 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n ull) && mode == null) {
256 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, stor eName_OR_storeNames); 295 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames));
257 } 296 }
258 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str ing> || storeName_OR_storeNames == null)) { 297 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str ing> || storeName_OR_storeNames == null)) {
259 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eName_OR_storeNames, mode); 298 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames), mode);
260 } 299 }
261 if ((storeName_OR_storeNames is DomStringList || storeName_OR_storeNames == null) && mode == null) { 300 if ((storeName_OR_storeNames is DomStringList || storeName_OR_storeNames == null) && mode == null) {
262 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, stor eName_OR_storeNames); 301 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames));
263 } 302 }
264 if ((mode is String || mode == null) && (storeName_OR_storeNames is DomStrin gList || storeName_OR_storeNames == null)) { 303 if ((mode is String || mode == null) && (storeName_OR_storeNames is DomStrin gList || storeName_OR_storeNames == null)) {
265 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eName_OR_storeNames, mode); 304 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), unwrap_jso(storeName_OR_storeNames), mode);
266 } 305 }
267 throw new ArgumentError("Incorrect number or type of arguments"); 306 throw new ArgumentError("Incorrect number or type of arguments");
268 } 307 }
269 308
270 Transaction transactionList(List<String> storeNames, [String mode]) { 309 Transaction transactionList(List<String> storeNames, [String mode]) {
271 if (mode != null) { 310 if (mode != null) {
272 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eNames, mode); 311 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), storeNames, mode);
273 } 312 }
274 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, storeN ames); 313 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(t his), storeNames);
275 } 314 }
276 315
277 Transaction transactionStore(String storeName, [String mode]) { 316 Transaction transactionStore(String storeName, [String mode]) {
278 if (mode != null) { 317 if (mode != null) {
279 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eName, mode); 318 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), storeName, mode);
280 } 319 }
281 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, storeN ame); 320 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(t his), storeName);
282 } 321 }
283 322
284 Transaction transactionStores(List<String> storeNames, [String mode]) { 323 Transaction transactionStores(List<String> storeNames, [String mode]) {
285 if (mode != null) { 324 if (mode != null) {
286 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(this, stor eNames, mode); 325 return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso (this), unwrap_jso(storeNames), mode);
287 } 326 }
288 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(this, storeN ames); 327 return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(t his), unwrap_jso(storeNames));
289 } 328 }
290 329
291 /// Stream of `abort` events handled by this [Database]. 330 /// Stream of `abort` events handled by this [Database].
292 @DomName('IDBDatabase.onabort') 331 @DomName('IDBDatabase.onabort')
293 @DocsEditable() 332 @DocsEditable()
294 Stream<Event> get onAbort => abortEvent.forTarget(this); 333 Stream<Event> get onAbort => abortEvent.forTarget(this);
295 334
296 /// Stream of `close` events handled by this [Database]. 335 /// Stream of `close` events handled by this [Database].
297 @DomName('IDBDatabase.onclose') 336 @DomName('IDBDatabase.onclose')
298 @DocsEditable() 337 @DocsEditable()
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 /** 432 /**
394 * Checks to see if getDatabaseNames is supported by the current platform. 433 * Checks to see if getDatabaseNames is supported by the current platform.
395 */ 434 */
396 bool get supportsDatabaseNames { 435 bool get supportsDatabaseNames {
397 return true; 436 return true;
398 } 437 }
399 438
400 // To suppress missing implicit constructor warnings. 439 // To suppress missing implicit constructor warnings.
401 factory IdbFactory._() { throw new UnsupportedError("Not supported"); } 440 factory IdbFactory._() { throw new UnsupportedError("Not supported"); }
402 441
442 static IdbFactory internalCreateIdbFactory() {
443 return new IdbFactory._internalWrap();
444 }
445
446 JsObject blink_jsObject = null;
447
448 factory IdbFactory._internalWrap() {
449 return new IdbFactory._internal();
450 }
451
452 IdbFactory._internal() { }
453
454 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
455
403 @DomName('IDBFactory.cmp') 456 @DomName('IDBFactory.cmp')
404 @DocsEditable() 457 @DocsEditable()
405 int cmp(Object first, Object second) => _blink.BlinkIDBFactory.instance.cmp_Ca llback_2_(this, first, second); 458 int cmp(Object first, Object second) => _blink.BlinkIDBFactory.instance.cmp_Ca llback_2_(unwrap_jso(this), first, second);
406 459
407 @DomName('IDBFactory.deleteDatabase') 460 @DomName('IDBFactory.deleteDatabase')
408 @DocsEditable() 461 @DocsEditable()
409 OpenDBRequest _deleteDatabase(String name) => _blink.BlinkIDBFactory.instance. deleteDatabase_Callback_1_(this, name); 462 OpenDBRequest _deleteDatabase(String name) => _blink.BlinkIDBFactory.instance. deleteDatabase_Callback_1_(unwrap_jso(this), name);
410 463
411 OpenDBRequest _open(String name, [int version]) { 464 OpenDBRequest _open(String name, [int version]) {
412 if (version != null) { 465 if (version != null) {
413 return _blink.BlinkIDBFactory.instance.open_Callback_2_(this, name, versio n); 466 return _blink.BlinkIDBFactory.instance.open_Callback_2_(unwrap_jso(this), name, version);
414 } 467 }
415 return _blink.BlinkIDBFactory.instance.open_Callback_1_(this, name); 468 return _blink.BlinkIDBFactory.instance.open_Callback_1_(unwrap_jso(this), na me);
416 } 469 }
417 470
418 @DomName('IDBFactory.webkitGetDatabaseNames') 471 @DomName('IDBFactory.webkitGetDatabaseNames')
419 @DocsEditable() 472 @DocsEditable()
420 @SupportedBrowser(SupportedBrowser.CHROME) 473 @SupportedBrowser(SupportedBrowser.CHROME)
421 @SupportedBrowser(SupportedBrowser.SAFARI) 474 @SupportedBrowser(SupportedBrowser.SAFARI)
422 @Experimental() 475 @Experimental()
423 Request _webkitGetDatabaseNames() => _blink.BlinkIDBFactory.instance.webkitGet DatabaseNames_Callback_0_(this); 476 Request _webkitGetDatabaseNames() => wrap_jso(_blink.BlinkIDBFactory.instance. webkitGetDatabaseNames_Callback_0_(unwrap_jso(this)));
424 477
425 } 478 }
426 479
427 480
428 /** 481 /**
429 * Ties a request to a completer, so the completer is completed when it succeeds 482 * Ties a request to a completer, so the completer is completed when it succeeds
430 * and errors out when the request errors. 483 * and errors out when the request errors.
431 */ 484 */
432 Future _completeRequest(Request request) { 485 Future _completeRequest(Request request) {
433 var completer = new Completer.sync(); 486 var completer = new Completer.sync();
434 // TODO: make sure that completer.complete is synchronous as transactions 487 // TODO: make sure that completer.complete is synchronous as transactions
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 request = _openKeyCursor(key_OR_range, "next"); 584 request = _openKeyCursor(key_OR_range, "next");
532 } else { 585 } else {
533 request = _openKeyCursor(key_OR_range, direction); 586 request = _openKeyCursor(key_OR_range, direction);
534 } 587 }
535 return ObjectStore._cursorStreamFromResult(request, autoAdvance); 588 return ObjectStore._cursorStreamFromResult(request, autoAdvance);
536 } 589 }
537 590
538 // To suppress missing implicit constructor warnings. 591 // To suppress missing implicit constructor warnings.
539 factory Index._() { throw new UnsupportedError("Not supported"); } 592 factory Index._() { throw new UnsupportedError("Not supported"); }
540 593
594 static Index internalCreateIndex() {
595 return new Index._internalWrap();
596 }
597
598 JsObject blink_jsObject = null;
599
600 factory Index._internalWrap() {
601 return new Index._internal();
602 }
603
604 Index._internal() { }
605
606 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
607
541 @DomName('IDBIndex.keyPath') 608 @DomName('IDBIndex.keyPath')
542 @DocsEditable() 609 @DocsEditable()
543 Object get keyPath => _blink.BlinkIDBIndex.instance.keyPath_Getter_(this); 610 Object get keyPath => _blink.BlinkIDBIndex.instance.keyPath_Getter_(unwrap_jso (this));
544 611
545 @DomName('IDBIndex.multiEntry') 612 @DomName('IDBIndex.multiEntry')
546 @DocsEditable() 613 @DocsEditable()
547 bool get multiEntry => _blink.BlinkIDBIndex.instance.multiEntry_Getter_(this); 614 bool get multiEntry => _blink.BlinkIDBIndex.instance.multiEntry_Getter_(unwrap _jso(this));
548 615
549 @DomName('IDBIndex.name') 616 @DomName('IDBIndex.name')
550 @DocsEditable() 617 @DocsEditable()
551 String get name => _blink.BlinkIDBIndex.instance.name_Getter_(this); 618 String get name => _blink.BlinkIDBIndex.instance.name_Getter_(unwrap_jso(this) );
552 619
553 @DomName('IDBIndex.objectStore') 620 @DomName('IDBIndex.objectStore')
554 @DocsEditable() 621 @DocsEditable()
555 ObjectStore get objectStore => _blink.BlinkIDBIndex.instance.objectStore_Gette r_(this); 622 ObjectStore get objectStore => wrap_jso(_blink.BlinkIDBIndex.instance.objectSt ore_Getter_(unwrap_jso(this)));
556 623
557 @DomName('IDBIndex.unique') 624 @DomName('IDBIndex.unique')
558 @DocsEditable() 625 @DocsEditable()
559 bool get unique => _blink.BlinkIDBIndex.instance.unique_Getter_(this); 626 bool get unique => _blink.BlinkIDBIndex.instance.unique_Getter_(unwrap_jso(thi s));
560 627
561 @DomName('IDBIndex.count') 628 @DomName('IDBIndex.count')
562 @DocsEditable() 629 @DocsEditable()
563 Request _count(Object key) => _blink.BlinkIDBIndex.instance.count_Callback_1_( this, key); 630 Request _count(Object key) => wrap_jso(_blink.BlinkIDBIndex.instance.count_Cal lback_1_(unwrap_jso(this), key));
564 631
565 @DomName('IDBIndex.get') 632 @DomName('IDBIndex.get')
566 @DocsEditable() 633 @DocsEditable()
567 Request _get(Object key) => _blink.BlinkIDBIndex.instance.get_Callback_1_(this , key); 634 Request _get(Object key) => wrap_jso(_blink.BlinkIDBIndex.instance.get_Callbac k_1_(unwrap_jso(this), key));
568 635
569 @DomName('IDBIndex.getKey') 636 @DomName('IDBIndex.getKey')
570 @DocsEditable() 637 @DocsEditable()
571 Request _getKey(Object key) => _blink.BlinkIDBIndex.instance.getKey_Callback_1 _(this, key); 638 Request _getKey(Object key) => wrap_jso(_blink.BlinkIDBIndex.instance.getKey_C allback_1_(unwrap_jso(this), key));
572 639
573 Request _openCursor(Object range, [String direction]) { 640 Request _openCursor(Object range, [String direction]) {
574 if (direction != null) { 641 if (direction != null) {
575 return _blink.BlinkIDBIndex.instance.openCursor_Callback_2_(this, range, d irection); 642 return wrap_jso(_blink.BlinkIDBIndex.instance.openCursor_Callback_2_(unwra p_jso(this), range, direction));
576 } 643 }
577 return _blink.BlinkIDBIndex.instance.openCursor_Callback_1_(this, range); 644 return wrap_jso(_blink.BlinkIDBIndex.instance.openCursor_Callback_1_(unwrap_ jso(this), range));
578 } 645 }
579 646
580 Request _openKeyCursor(Object range, [String direction]) { 647 Request _openKeyCursor(Object range, [String direction]) {
581 if (direction != null) { 648 if (direction != null) {
582 return _blink.BlinkIDBIndex.instance.openKeyCursor_Callback_2_(this, range , direction); 649 return wrap_jso(_blink.BlinkIDBIndex.instance.openKeyCursor_Callback_2_(un wrap_jso(this), range, direction));
583 } 650 }
584 return _blink.BlinkIDBIndex.instance.openKeyCursor_Callback_1_(this, range); 651 return wrap_jso(_blink.BlinkIDBIndex.instance.openKeyCursor_Callback_1_(unwr ap_jso(this), range));
585 } 652 }
586 653
587 } 654 }
588 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 655 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
589 // for details. All rights reserved. Use of this source code is governed by a 656 // for details. All rights reserved. Use of this source code is governed by a
590 // BSD-style license that can be found in the LICENSE file. 657 // BSD-style license that can be found in the LICENSE file.
591 658
592 659
593 @DomName('IDBKeyRange') 660 @DomName('IDBKeyRange')
594 @Unstable() 661 @Unstable()
(...skipping 12 matching lines...) Expand all
607 674
608 @DomName('KeyRange.bound') 675 @DomName('KeyRange.bound')
609 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, 676 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper,
610 [bool lowerOpen = false, bool upperOpen = false]) => 677 [bool lowerOpen = false, bool upperOpen = false]) =>
611 _KeyRangeFactoryProvider.createKeyRange_bound( 678 _KeyRangeFactoryProvider.createKeyRange_bound(
612 lower, upper, lowerOpen, upperOpen); 679 lower, upper, lowerOpen, upperOpen);
613 680
614 // To suppress missing implicit constructor warnings. 681 // To suppress missing implicit constructor warnings.
615 factory KeyRange._() { throw new UnsupportedError("Not supported"); } 682 factory KeyRange._() { throw new UnsupportedError("Not supported"); }
616 683
684 static KeyRange internalCreateKeyRange() {
685 return new KeyRange._internalWrap();
686 }
687
688 JsObject blink_jsObject = null;
689
690 factory KeyRange._internalWrap() {
691 return new KeyRange._internal();
692 }
693
694 KeyRange._internal() { }
695
696 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
697
617 @DomName('IDBKeyRange.lower') 698 @DomName('IDBKeyRange.lower')
618 @DocsEditable() 699 @DocsEditable()
619 Object get lower => _blink.BlinkIDBKeyRange.instance.lower_Getter_(this); 700 Object get lower => _blink.BlinkIDBKeyRange.instance.lower_Getter_(unwrap_jso( this));
620 701
621 @DomName('IDBKeyRange.lowerOpen') 702 @DomName('IDBKeyRange.lowerOpen')
622 @DocsEditable() 703 @DocsEditable()
623 bool get lowerOpen => _blink.BlinkIDBKeyRange.instance.lowerOpen_Getter_(this) ; 704 bool get lowerOpen => _blink.BlinkIDBKeyRange.instance.lowerOpen_Getter_(unwra p_jso(this));
624 705
625 @DomName('IDBKeyRange.upper') 706 @DomName('IDBKeyRange.upper')
626 @DocsEditable() 707 @DocsEditable()
627 Object get upper => _blink.BlinkIDBKeyRange.instance.upper_Getter_(this); 708 Object get upper => _blink.BlinkIDBKeyRange.instance.upper_Getter_(unwrap_jso( this));
628 709
629 @DomName('IDBKeyRange.upperOpen') 710 @DomName('IDBKeyRange.upperOpen')
630 @DocsEditable() 711 @DocsEditable()
631 bool get upperOpen => _blink.BlinkIDBKeyRange.instance.upperOpen_Getter_(this) ; 712 bool get upperOpen => _blink.BlinkIDBKeyRange.instance.upperOpen_Getter_(unwra p_jso(this));
632 713
633 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper Open]) { 714 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper Open]) {
634 if (upperOpen != null) { 715 if (upperOpen != null) {
635 return _blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower, upper, lo werOpen, upperOpen); 716 return _blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower, upper, lo werOpen, upperOpen);
636 } 717 }
637 if (lowerOpen != null) { 718 if (lowerOpen != null) {
638 return _blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower, upper, lo werOpen); 719 return _blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower, upper, lo werOpen);
639 } 720 }
640 return _blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, upper); 721 return _blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, upper);
641 } 722 }
642 723
643 static KeyRange lowerBound_(Object bound, [bool open]) { 724 static KeyRange lowerBound_(Object bound, [bool open]) {
644 if (open != null) { 725 if (open != null) {
645 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bound, open ); 726 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bound, open );
646 } 727 }
647 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(bound); 728 return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(bound);
648 } 729 }
649 730
650 @DomName('IDBKeyRange.only_') 731 @DomName('IDBKeyRange.only_')
651 @DocsEditable() 732 @DocsEditable()
652 @Experimental() // non-standard 733 @Experimental() // non-standard
653 static KeyRange only_(Object value) => _blink.BlinkIDBKeyRange.instance.only_C allback_1_(value); 734 static KeyRange only_(Object value) => _blink.BlinkIDBKeyRange.instance.only_C allback_1_(value);
654 735
655 static KeyRange upperBound_(Object bound, [bool open]) { 736 static KeyRange upperBound_(Object bound, [bool open]) {
656 if (open != null) { 737 if (open != null) {
657 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bound, open ); 738 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bound, open );
658 } 739 }
659 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(bound); 740 return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(bound);
660 } 741 }
661 742
662 } 743 }
663 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 744 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
664 // for details. All rights reserved. Use of this source code is governed by a 745 // 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
791 if (multiEntry != null) { 872 if (multiEntry != null) {
792 options['multiEntry'] = multiEntry; 873 options['multiEntry'] = multiEntry;
793 } 874 }
794 875
795 return _createIndex(name, keyPath, options); 876 return _createIndex(name, keyPath, options);
796 } 877 }
797 878
798 // To suppress missing implicit constructor warnings. 879 // To suppress missing implicit constructor warnings.
799 factory ObjectStore._() { throw new UnsupportedError("Not supported"); } 880 factory ObjectStore._() { throw new UnsupportedError("Not supported"); }
800 881
882 static ObjectStore internalCreateObjectStore() {
883 return new ObjectStore._internalWrap();
884 }
885
886 JsObject blink_jsObject = null;
887
888 factory ObjectStore._internalWrap() {
889 return new ObjectStore._internal();
890 }
891
892 ObjectStore._internal() { }
893
894 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
895
801 @DomName('IDBObjectStore.autoIncrement') 896 @DomName('IDBObjectStore.autoIncrement')
802 @DocsEditable() 897 @DocsEditable()
803 bool get autoIncrement => _blink.BlinkIDBObjectStore.instance.autoIncrement_Ge tter_(this); 898 bool get autoIncrement => _blink.BlinkIDBObjectStore.instance.autoIncrement_Ge tter_(unwrap_jso(this));
804 899
805 @DomName('IDBObjectStore.indexNames') 900 @DomName('IDBObjectStore.indexNames')
806 @DocsEditable() 901 @DocsEditable()
807 List<String> get indexNames => _blink.BlinkIDBObjectStore.instance.indexNames_ Getter_(this); 902 List<String> get indexNames => _blink.BlinkIDBObjectStore.instance.indexNames_ Getter_(unwrap_jso(this));
808 903
809 @DomName('IDBObjectStore.keyPath') 904 @DomName('IDBObjectStore.keyPath')
810 @DocsEditable() 905 @DocsEditable()
811 Object get keyPath => _blink.BlinkIDBObjectStore.instance.keyPath_Getter_(this ); 906 Object get keyPath => _blink.BlinkIDBObjectStore.instance.keyPath_Getter_(unwr ap_jso(this));
812 907
813 @DomName('IDBObjectStore.name') 908 @DomName('IDBObjectStore.name')
814 @DocsEditable() 909 @DocsEditable()
815 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(this); 910 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(unwrap_jso (this));
816 911
817 @DomName('IDBObjectStore.transaction') 912 @DomName('IDBObjectStore.transaction')
818 @DocsEditable() 913 @DocsEditable()
819 Transaction get transaction => _blink.BlinkIDBObjectStore.instance.transaction _Getter_(this); 914 Transaction get transaction => wrap_jso(_blink.BlinkIDBObjectStore.instance.tr ansaction_Getter_(unwrap_jso(this)));
820 915
821 Request _add(Object value, [Object key]) { 916 Request _add(Object value, [Object key]) {
822 if (key != null) { 917 if (key != null) {
823 return _blink.BlinkIDBObjectStore.instance.add_Callback_2_(this, value, ke y); 918 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_2_(unwrap _jso(this), value, key));
824 } 919 }
825 return _blink.BlinkIDBObjectStore.instance.add_Callback_1_(this, value); 920 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_1_(unwrap_j so(this), value));
826 } 921 }
827 922
828 @DomName('IDBObjectStore.clear') 923 @DomName('IDBObjectStore.clear')
829 @DocsEditable() 924 @DocsEditable()
830 Request _clear() => _blink.BlinkIDBObjectStore.instance.clear_Callback_0_(this ); 925 Request _clear() => wrap_jso(_blink.BlinkIDBObjectStore.instance.clear_Callbac k_0_(unwrap_jso(this)));
831 926
832 @DomName('IDBObjectStore.count') 927 @DomName('IDBObjectStore.count')
833 @DocsEditable() 928 @DocsEditable()
834 Request _count(Object key) => _blink.BlinkIDBObjectStore.instance.count_Callba ck_1_(this, key); 929 Request _count(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.cou nt_Callback_1_(unwrap_jso(this), key));
835 930
836 Index _createIndex(String name, keyPath, [Map options]) { 931 Index _createIndex(String name, keyPath, [Map options]) {
837 if ((keyPath is String || keyPath == null) && (name is String || name == nul l) && options == null) { 932 if ((keyPath is String || keyPath == null) && (name is String || name == nul l) && options == null) {
838 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(this, n ame, keyPath); 933 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_ jso(this), name, unwrap_jso(keyPath));
839 } 934 }
840 if ((options is Map || options == null) && (keyPath is String || keyPath == null) && (name is String || name == null)) { 935 if ((options is Map || options == null) && (keyPath is String || keyPath == null) && (name is String || name == null)) {
841 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(this, n ame, keyPath, options); 936 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_ jso(this), name, unwrap_jso(keyPath), options != null ? new js.JsObject.jsify(op tions) : options);
842 } 937 }
843 if ((keyPath is List<String> || keyPath == null) && (name is String || name == null) && options == null) { 938 if ((keyPath is List<String> || keyPath == null) && (name is String || name == null) && options == null) {
844 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(this, n ame, keyPath); 939 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_ jso(this), name, unwrap_jso(keyPath));
845 } 940 }
846 if ((options is Map || options == null) && (keyPath is List<String> || keyPa th == null) && (name is String || name == null)) { 941 if ((options is Map || options == null) && (keyPath is List<String> || keyPa th == null) && (name is String || name == null)) {
847 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(this, n ame, keyPath, options); 942 return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_ jso(this), name, unwrap_jso(keyPath), options != null ? new js.JsObject.jsify(op tions) : options);
848 } 943 }
849 throw new ArgumentError("Incorrect number or type of arguments"); 944 throw new ArgumentError("Incorrect number or type of arguments");
850 } 945 }
851 946
852 @DomName('IDBObjectStore.delete') 947 @DomName('IDBObjectStore.delete')
853 @DocsEditable() 948 @DocsEditable()
854 Request _delete(Object key) => _blink.BlinkIDBObjectStore.instance.delete_Call back_1_(this, key); 949 Request _delete(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.de lete_Callback_1_(unwrap_jso(this), key));
855 950
856 @DomName('IDBObjectStore.deleteIndex') 951 @DomName('IDBObjectStore.deleteIndex')
857 @DocsEditable() 952 @DocsEditable()
858 void deleteIndex(String name) => _blink.BlinkIDBObjectStore.instance.deleteInd ex_Callback_1_(this, name); 953 void deleteIndex(String name) => _blink.BlinkIDBObjectStore.instance.deleteInd ex_Callback_1_(unwrap_jso(this), name);
859 954
860 @DomName('IDBObjectStore.get') 955 @DomName('IDBObjectStore.get')
861 @DocsEditable() 956 @DocsEditable()
862 Request _get(Object key) => _blink.BlinkIDBObjectStore.instance.get_Callback_1 _(this, key); 957 Request _get(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.get_C allback_1_(unwrap_jso(this), key));
863 958
864 @DomName('IDBObjectStore.index') 959 @DomName('IDBObjectStore.index')
865 @DocsEditable() 960 @DocsEditable()
866 Index index(String name) => _blink.BlinkIDBObjectStore.instance.index_Callback _1_(this, name); 961 Index index(String name) => _blink.BlinkIDBObjectStore.instance.index_Callback _1_(unwrap_jso(this), name);
867 962
868 Request _openCursor(Object range, [String direction]) { 963 Request _openCursor(Object range, [String direction]) {
869 if (direction != null) { 964 if (direction != null) {
870 return _blink.BlinkIDBObjectStore.instance.openCursor_Callback_2_(this, ra nge, direction); 965 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_2_ (unwrap_jso(this), range, direction));
871 } 966 }
872 return _blink.BlinkIDBObjectStore.instance.openCursor_Callback_1_(this, rang e); 967 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openCursor_Callback_1_(u nwrap_jso(this), range));
873 } 968 }
874 969
875 Request openKeyCursor(Object range, [String direction]) { 970 Request openKeyCursor(Object range, [String direction]) {
876 if (direction != null) { 971 if (direction != null) {
877 return _blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_2_(this, range, direction); 972 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback _2_(unwrap_jso(this), range, direction));
878 } 973 }
879 return _blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_1_(this, r ange); 974 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_1 _(unwrap_jso(this), range));
880 } 975 }
881 976
882 Request _put(Object value, [Object key]) { 977 Request _put(Object value, [Object key]) {
883 if (key != null) { 978 if (key != null) {
884 return _blink.BlinkIDBObjectStore.instance.put_Callback_2_(this, value, ke y); 979 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_2_(unwrap _jso(this), value, key));
885 } 980 }
886 return _blink.BlinkIDBObjectStore.instance.put_Callback_1_(this, value); 981 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_1_(unwrap_j so(this), value));
887 } 982 }
888 983
889 984
890 /** 985 /**
891 * Helper for iterating over cursors in a request. 986 * Helper for iterating over cursors in a request.
892 */ 987 */
893 static Stream<Cursor> _cursorStreamFromResult(Request request, 988 static Stream<Cursor> _cursorStreamFromResult(Request request,
894 bool autoAdvance) { 989 bool autoAdvance) {
895 // TODO: need to guarantee that the controller provides the values 990 // TODO: need to guarantee that the controller provides the values
896 // immediately as waiting until the next tick will cause the transaction to 991 // immediately as waiting until the next tick will cause the transaction to
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 /** 1036 /**
942 * Static factory designed to expose `upgradeneeded` events to event 1037 * Static factory designed to expose `upgradeneeded` events to event
943 * handlers that are not necessarily instances of [OpenDBRequest]. 1038 * handlers that are not necessarily instances of [OpenDBRequest].
944 * 1039 *
945 * See [EventStreamProvider] for usage information. 1040 * See [EventStreamProvider] for usage information.
946 */ 1041 */
947 @DomName('IDBOpenDBRequest.upgradeneededEvent') 1042 @DomName('IDBOpenDBRequest.upgradeneededEvent')
948 @DocsEditable() 1043 @DocsEditable()
949 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); 1044 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons t EventStreamProvider<VersionChangeEvent>('upgradeneeded');
950 1045
1046
1047 static OpenDBRequest internalCreateOpenDBRequest() {
1048 return new OpenDBRequest._internalWrap();
1049 }
1050
1051 factory OpenDBRequest._internalWrap() {
1052 return new OpenDBRequest._internal();
1053 }
1054
1055 OpenDBRequest._internal() : super._internal();
1056
1057
951 /// Stream of `blocked` events handled by this [OpenDBRequest]. 1058 /// Stream of `blocked` events handled by this [OpenDBRequest].
952 @DomName('IDBOpenDBRequest.onblocked') 1059 @DomName('IDBOpenDBRequest.onblocked')
953 @DocsEditable() 1060 @DocsEditable()
954 Stream<Event> get onBlocked => blockedEvent.forTarget(this); 1061 Stream<Event> get onBlocked => blockedEvent.forTarget(this);
955 1062
956 /// Stream of `upgradeneeded` events handled by this [OpenDBRequest]. 1063 /// Stream of `upgradeneeded` events handled by this [OpenDBRequest].
957 @DomName('IDBOpenDBRequest.onupgradeneeded') 1064 @DomName('IDBOpenDBRequest.onupgradeneeded')
958 @DocsEditable() 1065 @DocsEditable()
959 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget (this); 1066 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget (this);
960 1067
(...skipping 25 matching lines...) Expand all
986 /** 1093 /**
987 * Static factory designed to expose `success` events to event 1094 * Static factory designed to expose `success` events to event
988 * handlers that are not necessarily instances of [Request]. 1095 * handlers that are not necessarily instances of [Request].
989 * 1096 *
990 * See [EventStreamProvider] for usage information. 1097 * See [EventStreamProvider] for usage information.
991 */ 1098 */
992 @DomName('IDBRequest.successEvent') 1099 @DomName('IDBRequest.successEvent')
993 @DocsEditable() 1100 @DocsEditable()
994 static const EventStreamProvider<Event> successEvent = const EventStreamProvid er<Event>('success'); 1101 static const EventStreamProvider<Event> successEvent = const EventStreamProvid er<Event>('success');
995 1102
1103
1104 static Request internalCreateRequest() {
1105 return new Request._internalWrap();
1106 }
1107
1108 factory Request._internalWrap() {
1109 return new Request._internal();
1110 }
1111
1112 Request._internal() : super._internal();
1113
1114
996 @DomName('IDBRequest.error') 1115 @DomName('IDBRequest.error')
997 @DocsEditable() 1116 @DocsEditable()
998 DomError get error => _blink.BlinkIDBRequest.instance.error_Getter_(this); 1117 DomError get error => wrap_jso(_blink.BlinkIDBRequest.instance.error_Getter_(u nwrap_jso(this)));
999 1118
1000 @DomName('IDBRequest.readyState') 1119 @DomName('IDBRequest.readyState')
1001 @DocsEditable() 1120 @DocsEditable()
1002 String get readyState => _blink.BlinkIDBRequest.instance.readyState_Getter_(th is); 1121 String get readyState => _blink.BlinkIDBRequest.instance.readyState_Getter_(un wrap_jso(this));
1003 1122
1004 @DomName('IDBRequest.result') 1123 @DomName('IDBRequest.result')
1005 @DocsEditable() 1124 @DocsEditable()
1006 Object get result => _blink.BlinkIDBRequest.instance.result_Getter_(this); 1125 Object get result => _blink.BlinkIDBRequest.instance.result_Getter_(unwrap_jso (this));
1007 1126
1008 @DomName('IDBRequest.source') 1127 @DomName('IDBRequest.source')
1009 @DocsEditable() 1128 @DocsEditable()
1010 Object get source => _blink.BlinkIDBRequest.instance.source_Getter_(this); 1129 Object get source => _blink.BlinkIDBRequest.instance.source_Getter_(unwrap_jso (this));
1011 1130
1012 @DomName('IDBRequest.transaction') 1131 @DomName('IDBRequest.transaction')
1013 @DocsEditable() 1132 @DocsEditable()
1014 Transaction get transaction => _blink.BlinkIDBRequest.instance.transaction_Get ter_(this); 1133 Transaction get transaction => wrap_jso(_blink.BlinkIDBRequest.instance.transa ction_Getter_(unwrap_jso(this)));
1015 1134
1016 /// Stream of `error` events handled by this [Request]. 1135 /// Stream of `error` events handled by this [Request].
1017 @DomName('IDBRequest.onerror') 1136 @DomName('IDBRequest.onerror')
1018 @DocsEditable() 1137 @DocsEditable()
1019 Stream<Event> get onError => errorEvent.forTarget(this); 1138 Stream<Event> get onError => errorEvent.forTarget(this);
1020 1139
1021 /// Stream of `success` events handled by this [Request]. 1140 /// Stream of `success` events handled by this [Request].
1022 @DomName('IDBRequest.onsuccess') 1141 @DomName('IDBRequest.onsuccess')
1023 @DocsEditable() 1142 @DocsEditable()
1024 Stream<Event> get onSuccess => successEvent.forTarget(this); 1143 Stream<Event> get onSuccess => successEvent.forTarget(this);
1025 1144
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 /** 1206 /**
1088 * Static factory designed to expose `error` events to event 1207 * Static factory designed to expose `error` events to event
1089 * handlers that are not necessarily instances of [Transaction]. 1208 * handlers that are not necessarily instances of [Transaction].
1090 * 1209 *
1091 * See [EventStreamProvider] for usage information. 1210 * See [EventStreamProvider] for usage information.
1092 */ 1211 */
1093 @DomName('IDBTransaction.errorEvent') 1212 @DomName('IDBTransaction.errorEvent')
1094 @DocsEditable() 1213 @DocsEditable()
1095 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error'); 1214 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
1096 1215
1216
1217 static Transaction internalCreateTransaction() {
1218 return new Transaction._internalWrap();
1219 }
1220
1221 factory Transaction._internalWrap() {
1222 return new Transaction._internal();
1223 }
1224
1225 Transaction._internal() : super._internal();
1226
1227
1097 @DomName('IDBTransaction.db') 1228 @DomName('IDBTransaction.db')
1098 @DocsEditable() 1229 @DocsEditable()
1099 Database get db => _blink.BlinkIDBTransaction.instance.db_Getter_(this); 1230 Database get db => wrap_jso(_blink.BlinkIDBTransaction.instance.db_Getter_(unw rap_jso(this)));
1100 1231
1101 @DomName('IDBTransaction.error') 1232 @DomName('IDBTransaction.error')
1102 @DocsEditable() 1233 @DocsEditable()
1103 DomError get error => _blink.BlinkIDBTransaction.instance.error_Getter_(this); 1234 DomError get error => wrap_jso(_blink.BlinkIDBTransaction.instance.error_Gette r_(unwrap_jso(this)));
1104 1235
1105 @DomName('IDBTransaction.mode') 1236 @DomName('IDBTransaction.mode')
1106 @DocsEditable() 1237 @DocsEditable()
1107 String get mode => _blink.BlinkIDBTransaction.instance.mode_Getter_(this); 1238 String get mode => _blink.BlinkIDBTransaction.instance.mode_Getter_(unwrap_jso (this));
1108 1239
1109 @DomName('IDBTransaction.abort') 1240 @DomName('IDBTransaction.abort')
1110 @DocsEditable() 1241 @DocsEditable()
1111 void abort() => _blink.BlinkIDBTransaction.instance.abort_Callback_0_(this); 1242 void abort() => _blink.BlinkIDBTransaction.instance.abort_Callback_0_(unwrap_j so(this));
1112 1243
1113 @DomName('IDBTransaction.objectStore') 1244 @DomName('IDBTransaction.objectStore')
1114 @DocsEditable() 1245 @DocsEditable()
1115 ObjectStore objectStore(String name) => _blink.BlinkIDBTransaction.instance.ob jectStore_Callback_1_(this, name); 1246 ObjectStore objectStore(String name) => _blink.BlinkIDBTransaction.instance.ob jectStore_Callback_1_(unwrap_jso(this), name);
1116 1247
1117 /// Stream of `abort` events handled by this [Transaction]. 1248 /// Stream of `abort` events handled by this [Transaction].
1118 @DomName('IDBTransaction.onabort') 1249 @DomName('IDBTransaction.onabort')
1119 @DocsEditable() 1250 @DocsEditable()
1120 Stream<Event> get onAbort => abortEvent.forTarget(this); 1251 Stream<Event> get onAbort => abortEvent.forTarget(this);
1121 1252
1122 /// Stream of `complete` events handled by this [Transaction]. 1253 /// Stream of `complete` events handled by this [Transaction].
1123 @DomName('IDBTransaction.oncomplete') 1254 @DomName('IDBTransaction.oncomplete')
1124 @DocsEditable() 1255 @DocsEditable()
1125 Stream<Event> get onComplete => completeEvent.forTarget(this); 1256 Stream<Event> get onComplete => completeEvent.forTarget(this);
1126 1257
(...skipping 10 matching lines...) Expand all
1137 // WARNING: Do not edit - generated code. 1268 // WARNING: Do not edit - generated code.
1138 1269
1139 1270
1140 @DocsEditable() 1271 @DocsEditable()
1141 @DomName('IDBVersionChangeEvent') 1272 @DomName('IDBVersionChangeEvent')
1142 @Unstable() 1273 @Unstable()
1143 class VersionChangeEvent extends Event { 1274 class VersionChangeEvent extends Event {
1144 // To suppress missing implicit constructor warnings. 1275 // To suppress missing implicit constructor warnings.
1145 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); } 1276 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); }
1146 1277
1278
1279 static VersionChangeEvent internalCreateVersionChangeEvent() {
1280 return new VersionChangeEvent._internalWrap();
1281 }
1282
1283 factory VersionChangeEvent._internalWrap() {
1284 return new VersionChangeEvent._internal();
1285 }
1286
1287 VersionChangeEvent._internal() : super._internal();
1288
1289
1147 @DomName('IDBVersionChangeEvent.dataLoss') 1290 @DomName('IDBVersionChangeEvent.dataLoss')
1148 @DocsEditable() 1291 @DocsEditable()
1149 @Experimental() // untriaged 1292 @Experimental() // untriaged
1150 String get dataLoss => _blink.BlinkIDBVersionChangeEvent.instance.dataLoss_Get ter_(this); 1293 String get dataLoss => _blink.BlinkIDBVersionChangeEvent.instance.dataLoss_Get ter_(unwrap_jso(this));
1151 1294
1152 @DomName('IDBVersionChangeEvent.dataLossMessage') 1295 @DomName('IDBVersionChangeEvent.dataLossMessage')
1153 @DocsEditable() 1296 @DocsEditable()
1154 @Experimental() // untriaged 1297 @Experimental() // untriaged
1155 String get dataLossMessage => _blink.BlinkIDBVersionChangeEvent.instance.dataL ossMessage_Getter_(this); 1298 String get dataLossMessage => _blink.BlinkIDBVersionChangeEvent.instance.dataL ossMessage_Getter_(unwrap_jso(this));
1156 1299
1157 @DomName('IDBVersionChangeEvent.newVersion') 1300 @DomName('IDBVersionChangeEvent.newVersion')
1158 @DocsEditable() 1301 @DocsEditable()
1159 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge tter_(this); 1302 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge tter_(unwrap_jso(this));
1160 1303
1161 @DomName('IDBVersionChangeEvent.oldVersion') 1304 @DomName('IDBVersionChangeEvent.oldVersion')
1162 @DocsEditable() 1305 @DocsEditable()
1163 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge tter_(this); 1306 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge tter_(unwrap_jso(this));
1164 1307
1165 } 1308 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698