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

Side by Side Diff: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart

Issue 18182010: Make html metadata follow the spec. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed DocsEditable, Experimental, Unstable Created 7 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 | Annotate | Revision Log
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:typed_data'; 6 import 'dart:typed_data';
7 import 'dart:_js_helper' show Creates, Returns, JSName, Null; 7 import 'dart:_js_helper' show Creates, Returns, JSName, Null;
8 import 'dart:_foreign_helper' show JS; 8 import 'dart:_foreign_helper' show JS;
9 import 'dart:_interceptors' show Interceptor, JSExtendableArray; 9 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // TODO(sra): Add DateTime. 132 // TODO(sra): Add DateTime.
133 const String _idbKey = 'JSExtendableArray|=Object|num|String'; 133 const String _idbKey = 'JSExtendableArray|=Object|num|String';
134 const _annotation_Creates_IDBKey = const Creates(_idbKey); 134 const _annotation_Creates_IDBKey = const Creates(_idbKey);
135 const _annotation_Returns_IDBKey = const Returns(_idbKey); 135 const _annotation_Returns_IDBKey = const Returns(_idbKey);
136 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 136 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
137 // for details. All rights reserved. Use of this source code is governed by a 137 // for details. All rights reserved. Use of this source code is governed by a
138 // BSD-style license that can be found in the LICENSE file. 138 // BSD-style license that can be found in the LICENSE file.
139 139
140 140
141 @DomName('IDBCursor') 141 @DomName('IDBCursor')
142 @Unstable 142 @Unstable()
143 class Cursor extends Interceptor native "IDBCursor" { 143 class Cursor extends Interceptor native "IDBCursor" {
144 @DomName('IDBCursor.delete') 144 @DomName('IDBCursor.delete')
145 Future delete() { 145 Future delete() {
146 try { 146 try {
147 return _completeRequest($dom_delete()); 147 return _completeRequest($dom_delete());
148 } catch (e, stacktrace) { 148 } catch (e, stacktrace) {
149 return new Future.error(e, stacktrace); 149 return new Future.error(e, stacktrace);
150 } 150 }
151 } 151 }
152 152
153 @DomName('IDBCursor.value') 153 @DomName('IDBCursor.value')
154 Future update(value) { 154 Future update(value) {
155 try { 155 try {
156 return _completeRequest($dom_update(value)); 156 return _completeRequest($dom_update(value));
157 } catch (e, stacktrace) { 157 } catch (e, stacktrace) {
158 return new Future.error(e, stacktrace); 158 return new Future.error(e, stacktrace);
159 } 159 }
160 } 160 }
161 161
162 162
163 @DomName('IDBCursor.direction') 163 @DomName('IDBCursor.direction')
164 @DocsEditable 164 @DocsEditable()
165 final String direction; 165 final String direction;
166 166
167 @DomName('IDBCursor.key') 167 @DomName('IDBCursor.key')
168 @DocsEditable 168 @DocsEditable()
169 @_annotation_Creates_IDBKey 169 @_annotation_Creates_IDBKey
170 @_annotation_Returns_IDBKey 170 @_annotation_Returns_IDBKey
171 final Object key; 171 final Object key;
172 172
173 @DomName('IDBCursor.primaryKey') 173 @DomName('IDBCursor.primaryKey')
174 @DocsEditable 174 @DocsEditable()
175 @_annotation_Creates_IDBKey 175 @_annotation_Creates_IDBKey
176 @_annotation_Returns_IDBKey 176 @_annotation_Returns_IDBKey
177 final Object primaryKey; 177 final Object primaryKey;
178 178
179 @DomName('IDBCursor.source') 179 @DomName('IDBCursor.source')
180 @DocsEditable 180 @DocsEditable()
181 @Creates('Null') 181 @Creates('Null')
182 @Returns('ObjectStore|Index|Null') 182 @Returns('ObjectStore|Index|Null')
183 final dynamic source; 183 final dynamic source;
184 184
185 @DomName('IDBCursor.advance') 185 @DomName('IDBCursor.advance')
186 @DocsEditable 186 @DocsEditable()
187 void advance(int count) native; 187 void advance(int count) native;
188 188
189 @JSName('delete') 189 @JSName('delete')
190 @DomName('IDBCursor.delete') 190 @DomName('IDBCursor.delete')
191 @DocsEditable 191 @DocsEditable()
192 Request $dom_delete() native; 192 Request $dom_delete() native;
193 193
194 @JSName('continue') 194 @JSName('continue')
195 @DomName('IDBCursor.continue') 195 @DomName('IDBCursor.continue')
196 @DocsEditable 196 @DocsEditable()
197 void next([Object key]) native; 197 void next([Object key]) native;
198 198
199 @DomName('IDBCursor.update') 199 @DomName('IDBCursor.update')
200 @DocsEditable 200 @DocsEditable()
201 Request $dom_update(/*any*/ value) { 201 Request $dom_update(/*any*/ value) {
202 var value_1 = convertDartToNative_SerializedScriptValue(value); 202 var value_1 = convertDartToNative_SerializedScriptValue(value);
203 return _$dom_update_1(value_1); 203 return _$dom_update_1(value_1);
204 } 204 }
205 @JSName('update') 205 @JSName('update')
206 @DomName('IDBCursor.update') 206 @DomName('IDBCursor.update')
207 @DocsEditable 207 @DocsEditable()
208 Request _$dom_update_1(value) native; 208 Request _$dom_update_1(value) native;
209 209
210 } 210 }
211 // 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
212 // 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
213 // BSD-style license that can be found in the LICENSE file. 213 // BSD-style license that can be found in the LICENSE file.
214 214
215 215
216 @DocsEditable 216 @DocsEditable()
217 @DomName('IDBCursorWithValue') 217 @DomName('IDBCursorWithValue')
218 @Unstable 218 @Unstable()
219 class CursorWithValue extends Cursor native "IDBCursorWithValue" { 219 class CursorWithValue extends Cursor native "IDBCursorWithValue" {
220 // To suppress missing implicit constructor warnings. 220 // To suppress missing implicit constructor warnings.
221 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); } 221 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); }
222 222
223 dynamic get value => _convertNativeToDart_IDBAny(this._get_value); 223 dynamic get value => _convertNativeToDart_IDBAny(this._get_value);
224 @JSName('value') 224 @JSName('value')
225 @DomName('IDBCursorWithValue.value') 225 @DomName('IDBCursorWithValue.value')
226 @DocsEditable 226 @DocsEditable()
227 @annotation_Creates_SerializedScriptValue 227 @annotation_Creates_SerializedScriptValue
228 @annotation_Returns_SerializedScriptValue 228 @annotation_Returns_SerializedScriptValue
229 final dynamic _get_value; 229 final dynamic _get_value;
230 } 230 }
231 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 231 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
232 // for details. All rights reserved. Use of this source code is governed by a 232 // for details. All rights reserved. Use of this source code is governed by a
233 // BSD-style license that can be found in the LICENSE file. 233 // BSD-style license that can be found in the LICENSE file.
234 234
235 235
236 @DocsEditable 236 @DocsEditable()
237 @DomName('IDBDatabase') 237 @DomName('IDBDatabase')
238 @SupportedBrowser(SupportedBrowser.CHROME) 238 @SupportedBrowser(SupportedBrowser.CHROME)
239 @SupportedBrowser(SupportedBrowser.FIREFOX, '15') 239 @SupportedBrowser(SupportedBrowser.FIREFOX, '15')
240 @SupportedBrowser(SupportedBrowser.IE, '10') 240 @SupportedBrowser(SupportedBrowser.IE, '10')
241 @Experimental 241 @Experimental()
242 @Unstable 242 @Unstable()
243 class Database extends EventTarget native "IDBDatabase" { 243 class Database extends EventTarget native "IDBDatabase" {
244 @DomName('IDBDatabase.createObjectStore') 244 @DomName('IDBDatabase.createObjectStore')
245 @DocsEditable 245 @DocsEditable()
246 ObjectStore createObjectStore(String name, 246 ObjectStore createObjectStore(String name,
247 {String keyPath, bool autoIncrement}) { 247 {String keyPath, bool autoIncrement}) {
248 var options = {}; 248 var options = {};
249 if (keyPath != null) { 249 if (keyPath != null) {
250 options['keyPath'] = keyPath; 250 options['keyPath'] = keyPath;
251 } 251 }
252 if (autoIncrement != null) { 252 if (autoIncrement != null) {
253 options['autoIncrement'] = autoIncrement; 253 options['autoIncrement'] = autoIncrement;
254 } 254 }
255 255
(...skipping 14 matching lines...) Expand all
270 return _transaction(storeName_OR_storeNames, mode); 270 return _transaction(storeName_OR_storeNames, mode);
271 } 271 }
272 272
273 @JSName('transaction') 273 @JSName('transaction')
274 Transaction _transaction(stores, mode) native; 274 Transaction _transaction(stores, mode) native;
275 275
276 // To suppress missing implicit constructor warnings. 276 // To suppress missing implicit constructor warnings.
277 factory Database._() { throw new UnsupportedError("Not supported"); } 277 factory Database._() { throw new UnsupportedError("Not supported"); }
278 278
279 @DomName('IDBDatabase.abortEvent') 279 @DomName('IDBDatabase.abortEvent')
280 @DocsEditable 280 @DocsEditable()
281 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort'); 281 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort');
282 282
283 @DomName('IDBDatabase.errorEvent') 283 @DomName('IDBDatabase.errorEvent')
284 @DocsEditable 284 @DocsEditable()
285 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error'); 285 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
286 286
287 @DomName('IDBDatabase.versionchangeEvent') 287 @DomName('IDBDatabase.versionchangeEvent')
288 @DocsEditable 288 @DocsEditable()
289 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons t EventStreamProvider<VersionChangeEvent>('versionchange'); 289 static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = cons t EventStreamProvider<VersionChangeEvent>('versionchange');
290 290
291 @DomName('IDBDatabase.name') 291 @DomName('IDBDatabase.name')
292 @DocsEditable 292 @DocsEditable()
293 final String name; 293 final String name;
294 294
295 @DomName('IDBDatabase.objectStoreNames') 295 @DomName('IDBDatabase.objectStoreNames')
296 @DocsEditable 296 @DocsEditable()
297 @Returns('DomStringList') 297 @Returns('DomStringList')
298 @Creates('DomStringList') 298 @Creates('DomStringList')
299 final List<String> objectStoreNames; 299 final List<String> objectStoreNames;
300 300
301 @DomName('IDBDatabase.version') 301 @DomName('IDBDatabase.version')
302 @DocsEditable 302 @DocsEditable()
303 @Creates('int|String|Null') 303 @Creates('int|String|Null')
304 @Returns('int|String|Null') 304 @Returns('int|String|Null')
305 final dynamic version; 305 final dynamic version;
306 306
307 @JSName('addEventListener') 307 @JSName('addEventListener')
308 @DomName('IDBDatabase.addEventListener') 308 @DomName('IDBDatabase.addEventListener')
309 @DocsEditable 309 @DocsEditable()
310 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 310 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
311 311
312 @DomName('IDBDatabase.close') 312 @DomName('IDBDatabase.close')
313 @DocsEditable 313 @DocsEditable()
314 void close() native; 314 void close() native;
315 315
316 @DomName('IDBDatabase.createObjectStore') 316 @DomName('IDBDatabase.createObjectStore')
317 @DocsEditable 317 @DocsEditable()
318 ObjectStore $dom_createObjectStore(String name, [Map options]) { 318 ObjectStore $dom_createObjectStore(String name, [Map options]) {
319 if (options != null) { 319 if (options != null) {
320 var options_1 = convertDartToNative_Dictionary(options); 320 var options_1 = convertDartToNative_Dictionary(options);
321 return _$dom_createObjectStore_1(name, options_1); 321 return _$dom_createObjectStore_1(name, options_1);
322 } 322 }
323 return _$dom_createObjectStore_2(name); 323 return _$dom_createObjectStore_2(name);
324 } 324 }
325 @JSName('createObjectStore') 325 @JSName('createObjectStore')
326 @DomName('IDBDatabase.createObjectStore') 326 @DomName('IDBDatabase.createObjectStore')
327 @DocsEditable 327 @DocsEditable()
328 ObjectStore _$dom_createObjectStore_1(name, options) native; 328 ObjectStore _$dom_createObjectStore_1(name, options) native;
329 @JSName('createObjectStore') 329 @JSName('createObjectStore')
330 @DomName('IDBDatabase.createObjectStore') 330 @DomName('IDBDatabase.createObjectStore')
331 @DocsEditable 331 @DocsEditable()
332 ObjectStore _$dom_createObjectStore_2(name) native; 332 ObjectStore _$dom_createObjectStore_2(name) native;
333 333
334 @DomName('IDBDatabase.deleteObjectStore') 334 @DomName('IDBDatabase.deleteObjectStore')
335 @DocsEditable 335 @DocsEditable()
336 void deleteObjectStore(String name) native; 336 void deleteObjectStore(String name) native;
337 337
338 @DomName('IDBDatabase.dispatchEvent') 338 @DomName('IDBDatabase.dispatchEvent')
339 @DocsEditable 339 @DocsEditable()
340 bool dispatchEvent(Event evt) native; 340 bool dispatchEvent(Event evt) native;
341 341
342 @JSName('removeEventListener') 342 @JSName('removeEventListener')
343 @DomName('IDBDatabase.removeEventListener') 343 @DomName('IDBDatabase.removeEventListener')
344 @DocsEditable 344 @DocsEditable()
345 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 345 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
346 346
347 @DomName('IDBDatabase.onabort') 347 @DomName('IDBDatabase.onabort')
348 @DocsEditable 348 @DocsEditable()
349 Stream<Event> get onAbort => abortEvent.forTarget(this); 349 Stream<Event> get onAbort => abortEvent.forTarget(this);
350 350
351 @DomName('IDBDatabase.onerror') 351 @DomName('IDBDatabase.onerror')
352 @DocsEditable 352 @DocsEditable()
353 Stream<Event> get onError => errorEvent.forTarget(this); 353 Stream<Event> get onError => errorEvent.forTarget(this);
354 354
355 @DomName('IDBDatabase.onversionchange') 355 @DomName('IDBDatabase.onversionchange')
356 @DocsEditable 356 @DocsEditable()
357 Stream<VersionChangeEvent> get onVersionChange => versionChangeEvent.forTarget (this); 357 Stream<VersionChangeEvent> get onVersionChange => versionChangeEvent.forTarget (this);
358 } 358 }
359 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 359 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
360 // for details. All rights reserved. Use of this source code is governed by a 360 // for details. All rights reserved. Use of this source code is governed by a
361 // BSD-style license that can be found in the LICENSE file. 361 // BSD-style license that can be found in the LICENSE file.
362 362
363 363
364 @DomName('IDBFactory') 364 @DomName('IDBFactory')
365 @SupportedBrowser(SupportedBrowser.CHROME) 365 @SupportedBrowser(SupportedBrowser.CHROME)
366 @SupportedBrowser(SupportedBrowser.FIREFOX, '15') 366 @SupportedBrowser(SupportedBrowser.FIREFOX, '15')
367 @SupportedBrowser(SupportedBrowser.IE, '10') 367 @SupportedBrowser(SupportedBrowser.IE, '10')
368 @Experimental 368 @Experimental()
369 @Unstable 369 @Unstable()
370 class IdbFactory extends Interceptor native "IDBFactory" { 370 class IdbFactory extends Interceptor native "IDBFactory" {
371 /** 371 /**
372 * Checks to see if Indexed DB is supported on the current platform. 372 * Checks to see if Indexed DB is supported on the current platform.
373 */ 373 */
374 static bool get supported { 374 static bool get supported {
375 return JS('bool', 375 return JS('bool',
376 '!!(window.indexedDB || ' 376 '!!(window.indexedDB || '
377 'window.webkitIndexedDB || ' 377 'window.webkitIndexedDB || '
378 'window.mozIndexedDB)'); 378 'window.mozIndexedDB)');
379 } 379 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 completer.completeError(e); 423 completer.completeError(e);
424 }); 424 });
425 return completer.future; 425 return completer.future;
426 } catch (e, stacktrace) { 426 } catch (e, stacktrace) {
427 return new Future.error(e, stacktrace); 427 return new Future.error(e, stacktrace);
428 } 428 }
429 } 429 }
430 430
431 @DomName('IDBFactory.getDatabaseNames') 431 @DomName('IDBFactory.getDatabaseNames')
432 @SupportedBrowser(SupportedBrowser.CHROME) 432 @SupportedBrowser(SupportedBrowser.CHROME)
433 @Experimental 433 @Experimental()
434 Future<List<String>> getDatabaseNames() { 434 Future<List<String>> getDatabaseNames() {
435 try { 435 try {
436 var request = $dom_webkitGetDatabaseNames(); 436 var request = $dom_webkitGetDatabaseNames();
437 437
438 return _completeRequest(request); 438 return _completeRequest(request);
439 } catch (e, stacktrace) { 439 } catch (e, stacktrace) {
440 return new Future.error(e, stacktrace); 440 return new Future.error(e, stacktrace);
441 } 441 }
442 } 442 }
443 443
444 /** 444 /**
445 * Checks to see if getDatabaseNames is supported by the current platform. 445 * Checks to see if getDatabaseNames is supported by the current platform.
446 */ 446 */
447 bool get supportsDatabaseNames { 447 bool get supportsDatabaseNames {
448 return supported && JS('bool', 448 return supported && JS('bool',
449 '!!(#.getDatabaseNames || #.webkitGetDatabaseNames)', this, this); 449 '!!(#.getDatabaseNames || #.webkitGetDatabaseNames)', this, this);
450 } 450 }
451 451
452 452
453 @DomName('IDBFactory.cmp') 453 @DomName('IDBFactory.cmp')
454 @DocsEditable 454 @DocsEditable()
455 int cmp(Object first, Object second) native; 455 int cmp(Object first, Object second) native;
456 456
457 @JSName('deleteDatabase') 457 @JSName('deleteDatabase')
458 @DomName('IDBFactory.deleteDatabase') 458 @DomName('IDBFactory.deleteDatabase')
459 @DocsEditable 459 @DocsEditable()
460 OpenDBRequest $dom_deleteDatabase(String name) native; 460 OpenDBRequest $dom_deleteDatabase(String name) native;
461 461
462 @JSName('open') 462 @JSName('open')
463 @DomName('IDBFactory.open') 463 @DomName('IDBFactory.open')
464 @DocsEditable 464 @DocsEditable()
465 @Returns('Request') 465 @Returns('Request')
466 @Creates('Request') 466 @Creates('Request')
467 @Creates('Database') 467 @Creates('Database')
468 OpenDBRequest $dom_open(String name, [int version]) native; 468 OpenDBRequest $dom_open(String name, [int version]) native;
469 469
470 @JSName('webkitGetDatabaseNames') 470 @JSName('webkitGetDatabaseNames')
471 @DomName('IDBFactory.webkitGetDatabaseNames') 471 @DomName('IDBFactory.webkitGetDatabaseNames')
472 @DocsEditable 472 @DocsEditable()
473 @SupportedBrowser(SupportedBrowser.CHROME) 473 @SupportedBrowser(SupportedBrowser.CHROME)
474 @SupportedBrowser(SupportedBrowser.SAFARI) 474 @SupportedBrowser(SupportedBrowser.SAFARI)
475 @Experimental 475 @Experimental()
476 @Returns('Request') 476 @Returns('Request')
477 @Creates('Request') 477 @Creates('Request')
478 @Creates('DomStringList') 478 @Creates('DomStringList')
479 Request $dom_webkitGetDatabaseNames() native; 479 Request $dom_webkitGetDatabaseNames() native;
480 480
481 } 481 }
482 482
483 483
484 /** 484 /**
485 * Ties a request to a completer, so the completer is completed when it succeeds 485 * Ties a request to a completer, so the completer is completed when it succeeds
(...skipping 10 matching lines...) Expand all
496 completer.completeError(e); 496 completer.completeError(e);
497 }); 497 });
498 return completer.future; 498 return completer.future;
499 } 499 }
500 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 500 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
501 // for details. All rights reserved. Use of this source code is governed by a 501 // for details. All rights reserved. Use of this source code is governed by a
502 // BSD-style license that can be found in the LICENSE file. 502 // BSD-style license that can be found in the LICENSE file.
503 503
504 504
505 @DomName('IDBIndex') 505 @DomName('IDBIndex')
506 @Unstable 506 @Unstable()
507 class Index extends Interceptor native "IDBIndex" { 507 class Index extends Interceptor native "IDBIndex" {
508 @DomName('IDBIndex.count') 508 @DomName('IDBIndex.count')
509 Future<int> count([key_OR_range]) { 509 Future<int> count([key_OR_range]) {
510 try { 510 try {
511 var request; 511 var request;
512 if (key_OR_range != null) { 512 if (key_OR_range != null) {
513 request = $dom_count(key_OR_range); 513 request = $dom_count(key_OR_range);
514 } else { 514 } else {
515 request = $dom_count(); 515 request = $dom_count();
516 } 516 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 if (direction == null) { 591 if (direction == null) {
592 request = $dom_openKeyCursor(key_OR_range); 592 request = $dom_openKeyCursor(key_OR_range);
593 } else { 593 } else {
594 request = $dom_openKeyCursor(key_OR_range, direction); 594 request = $dom_openKeyCursor(key_OR_range, direction);
595 } 595 }
596 return ObjectStore._cursorStreamFromResult(request, autoAdvance); 596 return ObjectStore._cursorStreamFromResult(request, autoAdvance);
597 } 597 }
598 598
599 599
600 @DomName('IDBIndex.keyPath') 600 @DomName('IDBIndex.keyPath')
601 @DocsEditable 601 @DocsEditable()
602 @annotation_Creates_SerializedScriptValue 602 @annotation_Creates_SerializedScriptValue
603 final dynamic keyPath; 603 final dynamic keyPath;
604 604
605 @DomName('IDBIndex.multiEntry') 605 @DomName('IDBIndex.multiEntry')
606 @DocsEditable 606 @DocsEditable()
607 final bool multiEntry; 607 final bool multiEntry;
608 608
609 @DomName('IDBIndex.name') 609 @DomName('IDBIndex.name')
610 @DocsEditable 610 @DocsEditable()
611 final String name; 611 final String name;
612 612
613 @DomName('IDBIndex.objectStore') 613 @DomName('IDBIndex.objectStore')
614 @DocsEditable 614 @DocsEditable()
615 final ObjectStore objectStore; 615 final ObjectStore objectStore;
616 616
617 @DomName('IDBIndex.unique') 617 @DomName('IDBIndex.unique')
618 @DocsEditable 618 @DocsEditable()
619 final bool unique; 619 final bool unique;
620 620
621 @JSName('count') 621 @JSName('count')
622 @DomName('IDBIndex.count') 622 @DomName('IDBIndex.count')
623 @DocsEditable 623 @DocsEditable()
624 Request $dom_count([key_OR_range]) native; 624 Request $dom_count([key_OR_range]) native;
625 625
626 @JSName('get') 626 @JSName('get')
627 @DomName('IDBIndex.get') 627 @DomName('IDBIndex.get')
628 @DocsEditable 628 @DocsEditable()
629 @Returns('Request') 629 @Returns('Request')
630 @Creates('Request') 630 @Creates('Request')
631 @annotation_Creates_SerializedScriptValue 631 @annotation_Creates_SerializedScriptValue
632 Request $dom_get(key) native; 632 Request $dom_get(key) native;
633 633
634 @JSName('getKey') 634 @JSName('getKey')
635 @DomName('IDBIndex.getKey') 635 @DomName('IDBIndex.getKey')
636 @DocsEditable 636 @DocsEditable()
637 @Returns('Request') 637 @Returns('Request')
638 @Creates('Request') 638 @Creates('Request')
639 @annotation_Creates_SerializedScriptValue 639 @annotation_Creates_SerializedScriptValue
640 @Creates('ObjectStore') 640 @Creates('ObjectStore')
641 Request $dom_getKey(key) native; 641 Request $dom_getKey(key) native;
642 642
643 @JSName('openCursor') 643 @JSName('openCursor')
644 @DomName('IDBIndex.openCursor') 644 @DomName('IDBIndex.openCursor')
645 @DocsEditable 645 @DocsEditable()
646 @Returns('Request') 646 @Returns('Request')
647 @Creates('Request') 647 @Creates('Request')
648 @Creates('Cursor') 648 @Creates('Cursor')
649 Request $dom_openCursor([key_OR_range, String direction]) native; 649 Request $dom_openCursor([key_OR_range, String direction]) native;
650 650
651 @JSName('openKeyCursor') 651 @JSName('openKeyCursor')
652 @DomName('IDBIndex.openKeyCursor') 652 @DomName('IDBIndex.openKeyCursor')
653 @DocsEditable 653 @DocsEditable()
654 @Returns('Request') 654 @Returns('Request')
655 @Creates('Request') 655 @Creates('Request')
656 @Creates('Cursor') 656 @Creates('Cursor')
657 Request $dom_openKeyCursor([key_OR_range, String direction]) native; 657 Request $dom_openKeyCursor([key_OR_range, String direction]) native;
658 658
659 } 659 }
660 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 660 // 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 661 // 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. 662 // BSD-style license that can be found in the LICENSE file.
663 663
664 664
665 @DomName('IDBKeyRange') 665 @DomName('IDBKeyRange')
666 @Unstable 666 @Unstable()
667 class KeyRange extends Interceptor native "IDBKeyRange" { 667 class KeyRange extends Interceptor native "IDBKeyRange" {
668 @DomName('IDBKeyRange.only') 668 @DomName('IDBKeyRange.only')
669 factory KeyRange.only(/*Key*/ value) => 669 factory KeyRange.only(/*Key*/ value) =>
670 _KeyRangeFactoryProvider.createKeyRange_only(value); 670 _KeyRangeFactoryProvider.createKeyRange_only(value);
671 671
672 @DomName('IDBKeyRange.lowerBound') 672 @DomName('IDBKeyRange.lowerBound')
673 factory KeyRange.lowerBound(/*Key*/ bound, [bool open = false]) => 673 factory KeyRange.lowerBound(/*Key*/ bound, [bool open = false]) =>
674 _KeyRangeFactoryProvider.createKeyRange_lowerBound(bound, open); 674 _KeyRangeFactoryProvider.createKeyRange_lowerBound(bound, open);
675 675
676 @DomName('IDBKeyRange.upperBound') 676 @DomName('IDBKeyRange.upperBound')
677 factory KeyRange.upperBound(/*Key*/ bound, [bool open = false]) => 677 factory KeyRange.upperBound(/*Key*/ bound, [bool open = false]) =>
678 _KeyRangeFactoryProvider.createKeyRange_upperBound(bound, open); 678 _KeyRangeFactoryProvider.createKeyRange_upperBound(bound, open);
679 679
680 @DomName('KeyRange.bound') 680 @DomName('KeyRange.bound')
681 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, 681 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper,
682 [bool lowerOpen = false, bool upperOpen = false]) => 682 [bool lowerOpen = false, bool upperOpen = false]) =>
683 _KeyRangeFactoryProvider.createKeyRange_bound( 683 _KeyRangeFactoryProvider.createKeyRange_bound(
684 lower, upper, lowerOpen, upperOpen); 684 lower, upper, lowerOpen, upperOpen);
685 685
686 686
687 @DomName('IDBKeyRange.lower') 687 @DomName('IDBKeyRange.lower')
688 @DocsEditable 688 @DocsEditable()
689 @annotation_Creates_SerializedScriptValue 689 @annotation_Creates_SerializedScriptValue
690 final Object lower; 690 final Object lower;
691 691
692 @DomName('IDBKeyRange.lowerOpen') 692 @DomName('IDBKeyRange.lowerOpen')
693 @DocsEditable 693 @DocsEditable()
694 final bool lowerOpen; 694 final bool lowerOpen;
695 695
696 @DomName('IDBKeyRange.upper') 696 @DomName('IDBKeyRange.upper')
697 @DocsEditable 697 @DocsEditable()
698 @annotation_Creates_SerializedScriptValue 698 @annotation_Creates_SerializedScriptValue
699 final Object upper; 699 final Object upper;
700 700
701 @DomName('IDBKeyRange.upperOpen') 701 @DomName('IDBKeyRange.upperOpen')
702 @DocsEditable 702 @DocsEditable()
703 final bool upperOpen; 703 final bool upperOpen;
704 704
705 @JSName('bound') 705 @JSName('bound')
706 @DomName('IDBKeyRange.bound') 706 @DomName('IDBKeyRange.bound')
707 @DocsEditable 707 @DocsEditable()
708 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper Open]) native; 708 static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upper Open]) native;
709 709
710 @JSName('lowerBound') 710 @JSName('lowerBound')
711 @DomName('IDBKeyRange.lowerBound') 711 @DomName('IDBKeyRange.lowerBound')
712 @DocsEditable 712 @DocsEditable()
713 static KeyRange lowerBound_(Object bound, [bool open]) native; 713 static KeyRange lowerBound_(Object bound, [bool open]) native;
714 714
715 @JSName('only') 715 @JSName('only')
716 @DomName('IDBKeyRange.only') 716 @DomName('IDBKeyRange.only')
717 @DocsEditable 717 @DocsEditable()
718 static KeyRange only_(Object value) native; 718 static KeyRange only_(Object value) native;
719 719
720 @JSName('upperBound') 720 @JSName('upperBound')
721 @DomName('IDBKeyRange.upperBound') 721 @DomName('IDBKeyRange.upperBound')
722 @DocsEditable 722 @DocsEditable()
723 static KeyRange upperBound_(Object bound, [bool open]) native; 723 static KeyRange upperBound_(Object bound, [bool open]) native;
724 724
725 } 725 }
726 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 726 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
727 // for details. All rights reserved. Use of this source code is governed by a 727 // for details. All rights reserved. Use of this source code is governed by a
728 // BSD-style license that can be found in the LICENSE file. 728 // BSD-style license that can be found in the LICENSE file.
729 729
730 730
731 @DomName('IDBObjectStore') 731 @DomName('IDBObjectStore')
732 @Unstable 732 @Unstable()
733 class ObjectStore extends Interceptor native "IDBObjectStore" { 733 class ObjectStore extends Interceptor native "IDBObjectStore" {
734 734
735 @DomName('IDBObjectStore.add') 735 @DomName('IDBObjectStore.add')
736 Future add(value, [key]) { 736 Future add(value, [key]) {
737 try { 737 try {
738 var request; 738 var request;
739 if (key != null) { 739 if (key != null) {
740 request = $dom_add(value, key); 740 request = $dom_add(value, key);
741 } else { 741 } else {
742 request = $dom_add(value); 742 request = $dom_add(value);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 } 858 }
859 if (multiEntry != null) { 859 if (multiEntry != null) {
860 options['multiEntry'] = multiEntry; 860 options['multiEntry'] = multiEntry;
861 } 861 }
862 862
863 return $dom_createIndex(name, keyPath, options); 863 return $dom_createIndex(name, keyPath, options);
864 } 864 }
865 865
866 866
867 @DomName('IDBObjectStore.autoIncrement') 867 @DomName('IDBObjectStore.autoIncrement')
868 @DocsEditable 868 @DocsEditable()
869 final bool autoIncrement; 869 final bool autoIncrement;
870 870
871 @DomName('IDBObjectStore.indexNames') 871 @DomName('IDBObjectStore.indexNames')
872 @DocsEditable 872 @DocsEditable()
873 @Returns('DomStringList') 873 @Returns('DomStringList')
874 @Creates('DomStringList') 874 @Creates('DomStringList')
875 final List<String> indexNames; 875 final List<String> indexNames;
876 876
877 @DomName('IDBObjectStore.keyPath') 877 @DomName('IDBObjectStore.keyPath')
878 @DocsEditable 878 @DocsEditable()
879 @annotation_Creates_SerializedScriptValue 879 @annotation_Creates_SerializedScriptValue
880 final dynamic keyPath; 880 final dynamic keyPath;
881 881
882 @DomName('IDBObjectStore.name') 882 @DomName('IDBObjectStore.name')
883 @DocsEditable 883 @DocsEditable()
884 final String name; 884 final String name;
885 885
886 @DomName('IDBObjectStore.transaction') 886 @DomName('IDBObjectStore.transaction')
887 @DocsEditable 887 @DocsEditable()
888 final Transaction transaction; 888 final Transaction transaction;
889 889
890 @DomName('IDBObjectStore.add') 890 @DomName('IDBObjectStore.add')
891 @DocsEditable 891 @DocsEditable()
892 @Returns('Request') 892 @Returns('Request')
893 @Creates('Request') 893 @Creates('Request')
894 @_annotation_Creates_IDBKey 894 @_annotation_Creates_IDBKey
895 Request $dom_add(/*any*/ value, [/*any*/ key]) { 895 Request $dom_add(/*any*/ value, [/*any*/ key]) {
896 if (key != null) { 896 if (key != null) {
897 var value_1 = convertDartToNative_SerializedScriptValue(value); 897 var value_1 = convertDartToNative_SerializedScriptValue(value);
898 var key_2 = convertDartToNative_SerializedScriptValue(key); 898 var key_2 = convertDartToNative_SerializedScriptValue(key);
899 return _$dom_add_1(value_1, key_2); 899 return _$dom_add_1(value_1, key_2);
900 } 900 }
901 var value_3 = convertDartToNative_SerializedScriptValue(value); 901 var value_3 = convertDartToNative_SerializedScriptValue(value);
902 return _$dom_add_2(value_3); 902 return _$dom_add_2(value_3);
903 } 903 }
904 @JSName('add') 904 @JSName('add')
905 @DomName('IDBObjectStore.add') 905 @DomName('IDBObjectStore.add')
906 @DocsEditable 906 @DocsEditable()
907 @Returns('Request') 907 @Returns('Request')
908 @Creates('Request') 908 @Creates('Request')
909 @_annotation_Creates_IDBKey 909 @_annotation_Creates_IDBKey
910 Request _$dom_add_1(value, key) native; 910 Request _$dom_add_1(value, key) native;
911 @JSName('add') 911 @JSName('add')
912 @DomName('IDBObjectStore.add') 912 @DomName('IDBObjectStore.add')
913 @DocsEditable 913 @DocsEditable()
914 @Returns('Request') 914 @Returns('Request')
915 @Creates('Request') 915 @Creates('Request')
916 @_annotation_Creates_IDBKey 916 @_annotation_Creates_IDBKey
917 Request _$dom_add_2(value) native; 917 Request _$dom_add_2(value) native;
918 918
919 @JSName('clear') 919 @JSName('clear')
920 @DomName('IDBObjectStore.clear') 920 @DomName('IDBObjectStore.clear')
921 @DocsEditable 921 @DocsEditable()
922 Request $dom_clear() native; 922 Request $dom_clear() native;
923 923
924 @JSName('count') 924 @JSName('count')
925 @DomName('IDBObjectStore.count') 925 @DomName('IDBObjectStore.count')
926 @DocsEditable 926 @DocsEditable()
927 Request $dom_count([key_OR_range]) native; 927 Request $dom_count([key_OR_range]) native;
928 928
929 @DomName('IDBObjectStore.createIndex') 929 @DomName('IDBObjectStore.createIndex')
930 @DocsEditable 930 @DocsEditable()
931 Index $dom_createIndex(String name, keyPath, [Map options]) { 931 Index $dom_createIndex(String name, keyPath, [Map options]) {
932 if ((keyPath is List<String> || keyPath == null) && options == null) { 932 if ((keyPath is List<String> || keyPath == null) && options == null) {
933 List keyPath_1 = convertDartToNative_StringArray(keyPath); 933 List keyPath_1 = convertDartToNative_StringArray(keyPath);
934 return _$dom_createIndex_1(name, keyPath_1); 934 return _$dom_createIndex_1(name, keyPath_1);
935 } 935 }
936 if (options != null && (keyPath is List<String> || keyPath == null)) { 936 if (options != null && (keyPath is List<String> || keyPath == null)) {
937 List keyPath_2 = convertDartToNative_StringArray(keyPath); 937 List keyPath_2 = convertDartToNative_StringArray(keyPath);
938 var options_3 = convertDartToNative_Dictionary(options); 938 var options_3 = convertDartToNative_Dictionary(options);
939 return _$dom_createIndex_2(name, keyPath_2, options_3); 939 return _$dom_createIndex_2(name, keyPath_2, options_3);
940 } 940 }
941 if ((keyPath is String || keyPath == null) && options == null) { 941 if ((keyPath is String || keyPath == null) && options == null) {
942 return _$dom_createIndex_3(name, keyPath); 942 return _$dom_createIndex_3(name, keyPath);
943 } 943 }
944 if (options != null && (keyPath is String || keyPath == null)) { 944 if (options != null && (keyPath is String || keyPath == null)) {
945 var options_4 = convertDartToNative_Dictionary(options); 945 var options_4 = convertDartToNative_Dictionary(options);
946 return _$dom_createIndex_4(name, keyPath, options_4); 946 return _$dom_createIndex_4(name, keyPath, options_4);
947 } 947 }
948 throw new ArgumentError("Incorrect number or type of arguments"); 948 throw new ArgumentError("Incorrect number or type of arguments");
949 } 949 }
950 @JSName('createIndex') 950 @JSName('createIndex')
951 @DomName('IDBObjectStore.createIndex') 951 @DomName('IDBObjectStore.createIndex')
952 @DocsEditable 952 @DocsEditable()
953 Index _$dom_createIndex_1(name, List keyPath) native; 953 Index _$dom_createIndex_1(name, List keyPath) native;
954 @JSName('createIndex') 954 @JSName('createIndex')
955 @DomName('IDBObjectStore.createIndex') 955 @DomName('IDBObjectStore.createIndex')
956 @DocsEditable 956 @DocsEditable()
957 Index _$dom_createIndex_2(name, List keyPath, options) native; 957 Index _$dom_createIndex_2(name, List keyPath, options) native;
958 @JSName('createIndex') 958 @JSName('createIndex')
959 @DomName('IDBObjectStore.createIndex') 959 @DomName('IDBObjectStore.createIndex')
960 @DocsEditable 960 @DocsEditable()
961 Index _$dom_createIndex_3(name, String keyPath) native; 961 Index _$dom_createIndex_3(name, String keyPath) native;
962 @JSName('createIndex') 962 @JSName('createIndex')
963 @DomName('IDBObjectStore.createIndex') 963 @DomName('IDBObjectStore.createIndex')
964 @DocsEditable 964 @DocsEditable()
965 Index _$dom_createIndex_4(name, String keyPath, options) native; 965 Index _$dom_createIndex_4(name, String keyPath, options) native;
966 966
967 @JSName('delete') 967 @JSName('delete')
968 @DomName('IDBObjectStore.delete') 968 @DomName('IDBObjectStore.delete')
969 @DocsEditable 969 @DocsEditable()
970 Request $dom_delete(key_OR_keyRange) native; 970 Request $dom_delete(key_OR_keyRange) native;
971 971
972 @DomName('IDBObjectStore.deleteIndex') 972 @DomName('IDBObjectStore.deleteIndex')
973 @DocsEditable 973 @DocsEditable()
974 void deleteIndex(String name) native; 974 void deleteIndex(String name) native;
975 975
976 @JSName('get') 976 @JSName('get')
977 @DomName('IDBObjectStore.get') 977 @DomName('IDBObjectStore.get')
978 @DocsEditable 978 @DocsEditable()
979 @Returns('Request') 979 @Returns('Request')
980 @Creates('Request') 980 @Creates('Request')
981 @annotation_Creates_SerializedScriptValue 981 @annotation_Creates_SerializedScriptValue
982 Request $dom_get(key) native; 982 Request $dom_get(key) native;
983 983
984 @DomName('IDBObjectStore.index') 984 @DomName('IDBObjectStore.index')
985 @DocsEditable 985 @DocsEditable()
986 Index index(String name) native; 986 Index index(String name) native;
987 987
988 @JSName('openCursor') 988 @JSName('openCursor')
989 @DomName('IDBObjectStore.openCursor') 989 @DomName('IDBObjectStore.openCursor')
990 @DocsEditable 990 @DocsEditable()
991 @Returns('Request') 991 @Returns('Request')
992 @Creates('Request') 992 @Creates('Request')
993 @Creates('Cursor') 993 @Creates('Cursor')
994 Request $dom_openCursor([key_OR_range, String direction]) native; 994 Request $dom_openCursor([key_OR_range, String direction]) native;
995 995
996 @DomName('IDBObjectStore.put') 996 @DomName('IDBObjectStore.put')
997 @DocsEditable 997 @DocsEditable()
998 @Returns('Request') 998 @Returns('Request')
999 @Creates('Request') 999 @Creates('Request')
1000 @_annotation_Creates_IDBKey 1000 @_annotation_Creates_IDBKey
1001 Request $dom_put(/*any*/ value, [/*any*/ key]) { 1001 Request $dom_put(/*any*/ value, [/*any*/ key]) {
1002 if (key != null) { 1002 if (key != null) {
1003 var value_1 = convertDartToNative_SerializedScriptValue(value); 1003 var value_1 = convertDartToNative_SerializedScriptValue(value);
1004 var key_2 = convertDartToNative_SerializedScriptValue(key); 1004 var key_2 = convertDartToNative_SerializedScriptValue(key);
1005 return _$dom_put_1(value_1, key_2); 1005 return _$dom_put_1(value_1, key_2);
1006 } 1006 }
1007 var value_3 = convertDartToNative_SerializedScriptValue(value); 1007 var value_3 = convertDartToNative_SerializedScriptValue(value);
1008 return _$dom_put_2(value_3); 1008 return _$dom_put_2(value_3);
1009 } 1009 }
1010 @JSName('put') 1010 @JSName('put')
1011 @DomName('IDBObjectStore.put') 1011 @DomName('IDBObjectStore.put')
1012 @DocsEditable 1012 @DocsEditable()
1013 @Returns('Request') 1013 @Returns('Request')
1014 @Creates('Request') 1014 @Creates('Request')
1015 @_annotation_Creates_IDBKey 1015 @_annotation_Creates_IDBKey
1016 Request _$dom_put_1(value, key) native; 1016 Request _$dom_put_1(value, key) native;
1017 @JSName('put') 1017 @JSName('put')
1018 @DomName('IDBObjectStore.put') 1018 @DomName('IDBObjectStore.put')
1019 @DocsEditable 1019 @DocsEditable()
1020 @Returns('Request') 1020 @Returns('Request')
1021 @Creates('Request') 1021 @Creates('Request')
1022 @_annotation_Creates_IDBKey 1022 @_annotation_Creates_IDBKey
1023 Request _$dom_put_2(value) native; 1023 Request _$dom_put_2(value) native;
1024 1024
1025 1025
1026 /** 1026 /**
1027 * Helper for iterating over cursors in a request. 1027 * Helper for iterating over cursors in a request.
1028 */ 1028 */
1029 static Stream<Cursor> _cursorStreamFromResult(Request request, 1029 static Stream<Cursor> _cursorStreamFromResult(Request request,
(...skipping 20 matching lines...) Expand all
1050 } 1050 }
1051 }); 1051 });
1052 return controller.stream; 1052 return controller.stream;
1053 } 1053 }
1054 } 1054 }
1055 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1055 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1056 // for details. All rights reserved. Use of this source code is governed by a 1056 // for details. All rights reserved. Use of this source code is governed by a
1057 // BSD-style license that can be found in the LICENSE file. 1057 // BSD-style license that can be found in the LICENSE file.
1058 1058
1059 1059
1060 @DocsEditable 1060 @DocsEditable()
1061 @DomName('IDBOpenDBRequest') 1061 @DomName('IDBOpenDBRequest')
1062 @Unstable 1062 @Unstable()
1063 class OpenDBRequest extends Request implements EventTarget native "IDBOpenDBRequ est,IDBVersionChangeRequest" { 1063 class OpenDBRequest extends Request implements EventTarget native "IDBOpenDBRequ est,IDBVersionChangeRequest" {
1064 // To suppress missing implicit constructor warnings. 1064 // To suppress missing implicit constructor warnings.
1065 factory OpenDBRequest._() { throw new UnsupportedError("Not supported"); } 1065 factory OpenDBRequest._() { throw new UnsupportedError("Not supported"); }
1066 1066
1067 @DomName('IDBOpenDBRequest.blockedEvent') 1067 @DomName('IDBOpenDBRequest.blockedEvent')
1068 @DocsEditable 1068 @DocsEditable()
1069 static const EventStreamProvider<Event> blockedEvent = const EventStreamProvid er<Event>('blocked'); 1069 static const EventStreamProvider<Event> blockedEvent = const EventStreamProvid er<Event>('blocked');
1070 1070
1071 @DomName('IDBOpenDBRequest.upgradeneededEvent') 1071 @DomName('IDBOpenDBRequest.upgradeneededEvent')
1072 @DocsEditable 1072 @DocsEditable()
1073 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); 1073 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons t EventStreamProvider<VersionChangeEvent>('upgradeneeded');
1074 1074
1075 @DomName('IDBOpenDBRequest.onblocked') 1075 @DomName('IDBOpenDBRequest.onblocked')
1076 @DocsEditable 1076 @DocsEditable()
1077 Stream<Event> get onBlocked => blockedEvent.forTarget(this); 1077 Stream<Event> get onBlocked => blockedEvent.forTarget(this);
1078 1078
1079 @DomName('IDBOpenDBRequest.onupgradeneeded') 1079 @DomName('IDBOpenDBRequest.onupgradeneeded')
1080 @DocsEditable 1080 @DocsEditable()
1081 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget (this); 1081 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget (this);
1082 } 1082 }
1083 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1083 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1084 // for details. All rights reserved. Use of this source code is governed by a 1084 // for details. All rights reserved. Use of this source code is governed by a
1085 // BSD-style license that can be found in the LICENSE file. 1085 // BSD-style license that can be found in the LICENSE file.
1086 1086
1087 1087
1088 @DocsEditable 1088 @DocsEditable()
1089 @DomName('IDBRequest') 1089 @DomName('IDBRequest')
1090 @Unstable 1090 @Unstable()
1091 class Request extends EventTarget native "IDBRequest" { 1091 class Request extends EventTarget native "IDBRequest" {
1092 // To suppress missing implicit constructor warnings. 1092 // To suppress missing implicit constructor warnings.
1093 factory Request._() { throw new UnsupportedError("Not supported"); } 1093 factory Request._() { throw new UnsupportedError("Not supported"); }
1094 1094
1095 @DomName('IDBRequest.errorEvent') 1095 @DomName('IDBRequest.errorEvent')
1096 @DocsEditable 1096 @DocsEditable()
1097 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error'); 1097 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
1098 1098
1099 @DomName('IDBRequest.successEvent') 1099 @DomName('IDBRequest.successEvent')
1100 @DocsEditable 1100 @DocsEditable()
1101 static const EventStreamProvider<Event> successEvent = const EventStreamProvid er<Event>('success'); 1101 static const EventStreamProvider<Event> successEvent = const EventStreamProvid er<Event>('success');
1102 1102
1103 @DomName('IDBRequest.error') 1103 @DomName('IDBRequest.error')
1104 @DocsEditable 1104 @DocsEditable()
1105 final DomError error; 1105 final DomError error;
1106 1106
1107 @DomName('IDBRequest.readyState') 1107 @DomName('IDBRequest.readyState')
1108 @DocsEditable 1108 @DocsEditable()
1109 final String readyState; 1109 final String readyState;
1110 1110
1111 dynamic get result => _convertNativeToDart_IDBAny(this._get_result); 1111 dynamic get result => _convertNativeToDart_IDBAny(this._get_result);
1112 @JSName('result') 1112 @JSName('result')
1113 @DomName('IDBRequest.result') 1113 @DomName('IDBRequest.result')
1114 @DocsEditable 1114 @DocsEditable()
1115 @Creates('Null') 1115 @Creates('Null')
1116 final dynamic _get_result; 1116 final dynamic _get_result;
1117 1117
1118 @DomName('IDBRequest.source') 1118 @DomName('IDBRequest.source')
1119 @DocsEditable 1119 @DocsEditable()
1120 @Creates('Null') 1120 @Creates('Null')
1121 final dynamic source; 1121 final dynamic source;
1122 1122
1123 @DomName('IDBRequest.transaction') 1123 @DomName('IDBRequest.transaction')
1124 @DocsEditable 1124 @DocsEditable()
1125 final Transaction transaction; 1125 final Transaction transaction;
1126 1126
1127 @JSName('webkitErrorMessage') 1127 @JSName('webkitErrorMessage')
1128 @DomName('IDBRequest.webkitErrorMessage') 1128 @DomName('IDBRequest.webkitErrorMessage')
1129 @DocsEditable 1129 @DocsEditable()
1130 @SupportedBrowser(SupportedBrowser.CHROME) 1130 @SupportedBrowser(SupportedBrowser.CHROME)
1131 @SupportedBrowser(SupportedBrowser.SAFARI) 1131 @SupportedBrowser(SupportedBrowser.SAFARI)
1132 @Experimental 1132 @Experimental()
1133 final String errorMessage; 1133 final String errorMessage;
1134 1134
1135 @JSName('addEventListener') 1135 @JSName('addEventListener')
1136 @DomName('IDBRequest.addEventListener') 1136 @DomName('IDBRequest.addEventListener')
1137 @DocsEditable 1137 @DocsEditable()
1138 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 1138 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
1139 1139
1140 @DomName('IDBRequest.dispatchEvent') 1140 @DomName('IDBRequest.dispatchEvent')
1141 @DocsEditable 1141 @DocsEditable()
1142 bool dispatchEvent(Event evt) native; 1142 bool dispatchEvent(Event evt) native;
1143 1143
1144 @JSName('removeEventListener') 1144 @JSName('removeEventListener')
1145 @DomName('IDBRequest.removeEventListener') 1145 @DomName('IDBRequest.removeEventListener')
1146 @DocsEditable 1146 @DocsEditable()
1147 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 1147 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
1148 1148
1149 @DomName('IDBRequest.onerror') 1149 @DomName('IDBRequest.onerror')
1150 @DocsEditable 1150 @DocsEditable()
1151 Stream<Event> get onError => errorEvent.forTarget(this); 1151 Stream<Event> get onError => errorEvent.forTarget(this);
1152 1152
1153 @DomName('IDBRequest.onsuccess') 1153 @DomName('IDBRequest.onsuccess')
1154 @DocsEditable 1154 @DocsEditable()
1155 Stream<Event> get onSuccess => successEvent.forTarget(this); 1155 Stream<Event> get onSuccess => successEvent.forTarget(this);
1156 } 1156 }
1157 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1157 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
1158 // for details. All rights reserved. Use of this source code is governed by a 1158 // for details. All rights reserved. Use of this source code is governed by a
1159 // BSD-style license that can be found in the LICENSE file. 1159 // BSD-style license that can be found in the LICENSE file.
1160 1160
1161 1161
1162 @DomName('IDBTransaction') 1162 @DomName('IDBTransaction')
1163 @Unstable 1163 @Unstable()
1164 class Transaction extends EventTarget native "IDBTransaction" { 1164 class Transaction extends EventTarget native "IDBTransaction" {
1165 1165
1166 /** 1166 /**
1167 * Provides a Future which will be completed once the transaction has 1167 * Provides a Future which will be completed once the transaction has
1168 * completed. 1168 * completed.
1169 * 1169 *
1170 * The future will error if an error occurrs on the transaction or if the 1170 * The future will error if an error occurrs on the transaction or if the
1171 * transaction is aborted. 1171 * transaction is aborted.
1172 */ 1172 */
1173 Future<Database> get completed { 1173 Future<Database> get completed {
(...skipping 11 matching lines...) Expand all
1185 completer.completeError(e); 1185 completer.completeError(e);
1186 }); 1186 });
1187 1187
1188 return completer.future; 1188 return completer.future;
1189 } 1189 }
1190 1190
1191 // To suppress missing implicit constructor warnings. 1191 // To suppress missing implicit constructor warnings.
1192 factory Transaction._() { throw new UnsupportedError("Not supported"); } 1192 factory Transaction._() { throw new UnsupportedError("Not supported"); }
1193 1193
1194 @DomName('IDBTransaction.abortEvent') 1194 @DomName('IDBTransaction.abortEvent')
1195 @DocsEditable 1195 @DocsEditable()
1196 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort'); 1196 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort');
1197 1197
1198 @DomName('IDBTransaction.completeEvent') 1198 @DomName('IDBTransaction.completeEvent')
1199 @DocsEditable 1199 @DocsEditable()
1200 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi der<Event>('complete'); 1200 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi der<Event>('complete');
1201 1201
1202 @DomName('IDBTransaction.errorEvent') 1202 @DomName('IDBTransaction.errorEvent')
1203 @DocsEditable 1203 @DocsEditable()
1204 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error'); 1204 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
1205 1205
1206 @DomName('IDBTransaction.db') 1206 @DomName('IDBTransaction.db')
1207 @DocsEditable 1207 @DocsEditable()
1208 final Database db; 1208 final Database db;
1209 1209
1210 @DomName('IDBTransaction.error') 1210 @DomName('IDBTransaction.error')
1211 @DocsEditable 1211 @DocsEditable()
1212 final DomError error; 1212 final DomError error;
1213 1213
1214 @DomName('IDBTransaction.mode') 1214 @DomName('IDBTransaction.mode')
1215 @DocsEditable 1215 @DocsEditable()
1216 final String mode; 1216 final String mode;
1217 1217
1218 @JSName('webkitErrorMessage') 1218 @JSName('webkitErrorMessage')
1219 @DomName('IDBTransaction.webkitErrorMessage') 1219 @DomName('IDBTransaction.webkitErrorMessage')
1220 @DocsEditable 1220 @DocsEditable()
1221 @SupportedBrowser(SupportedBrowser.CHROME) 1221 @SupportedBrowser(SupportedBrowser.CHROME)
1222 @SupportedBrowser(SupportedBrowser.SAFARI) 1222 @SupportedBrowser(SupportedBrowser.SAFARI)
1223 @Experimental 1223 @Experimental()
1224 final String errorMessage; 1224 final String errorMessage;
1225 1225
1226 @DomName('IDBTransaction.abort') 1226 @DomName('IDBTransaction.abort')
1227 @DocsEditable 1227 @DocsEditable()
1228 void abort() native; 1228 void abort() native;
1229 1229
1230 @JSName('addEventListener') 1230 @JSName('addEventListener')
1231 @DomName('IDBTransaction.addEventListener') 1231 @DomName('IDBTransaction.addEventListener')
1232 @DocsEditable 1232 @DocsEditable()
1233 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 1233 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
1234 1234
1235 @DomName('IDBTransaction.dispatchEvent') 1235 @DomName('IDBTransaction.dispatchEvent')
1236 @DocsEditable 1236 @DocsEditable()
1237 bool dispatchEvent(Event evt) native; 1237 bool dispatchEvent(Event evt) native;
1238 1238
1239 @DomName('IDBTransaction.objectStore') 1239 @DomName('IDBTransaction.objectStore')
1240 @DocsEditable 1240 @DocsEditable()
1241 ObjectStore objectStore(String name) native; 1241 ObjectStore objectStore(String name) native;
1242 1242
1243 @JSName('removeEventListener') 1243 @JSName('removeEventListener')
1244 @DomName('IDBTransaction.removeEventListener') 1244 @DomName('IDBTransaction.removeEventListener')
1245 @DocsEditable 1245 @DocsEditable()
1246 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 1246 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
1247 1247
1248 @DomName('IDBTransaction.onabort') 1248 @DomName('IDBTransaction.onabort')
1249 @DocsEditable 1249 @DocsEditable()
1250 Stream<Event> get onAbort => abortEvent.forTarget(this); 1250 Stream<Event> get onAbort => abortEvent.forTarget(this);
1251 1251
1252 @DomName('IDBTransaction.oncomplete') 1252 @DomName('IDBTransaction.oncomplete')
1253 @DocsEditable 1253 @DocsEditable()
1254 Stream<Event> get onComplete => completeEvent.forTarget(this); 1254 Stream<Event> get onComplete => completeEvent.forTarget(this);
1255 1255
1256 @DomName('IDBTransaction.onerror') 1256 @DomName('IDBTransaction.onerror')
1257 @DocsEditable 1257 @DocsEditable()
1258 Stream<Event> get onError => errorEvent.forTarget(this); 1258 Stream<Event> get onError => errorEvent.forTarget(this);
1259 1259
1260 } 1260 }
1261 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1261 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1262 // for details. All rights reserved. Use of this source code is governed by a 1262 // for details. All rights reserved. Use of this source code is governed by a
1263 // BSD-style license that can be found in the LICENSE file. 1263 // BSD-style license that can be found in the LICENSE file.
1264 1264
1265 1265
1266 @DocsEditable 1266 @DocsEditable()
1267 @DomName('IDBVersionChangeEvent') 1267 @DomName('IDBVersionChangeEvent')
1268 @Unstable 1268 @Unstable()
1269 class VersionChangeEvent extends Event native "IDBVersionChangeEvent" { 1269 class VersionChangeEvent extends Event native "IDBVersionChangeEvent" {
1270 // To suppress missing implicit constructor warnings. 1270 // To suppress missing implicit constructor warnings.
1271 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); } 1271 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); }
1272 1272
1273 @DomName('IDBVersionChangeEvent.newVersion') 1273 @DomName('IDBVersionChangeEvent.newVersion')
1274 @DocsEditable 1274 @DocsEditable()
1275 @Creates('int|String|Null') 1275 @Creates('int|String|Null')
1276 @Returns('int|String|Null') 1276 @Returns('int|String|Null')
1277 final dynamic newVersion; 1277 final dynamic newVersion;
1278 1278
1279 @DomName('IDBVersionChangeEvent.oldVersion') 1279 @DomName('IDBVersionChangeEvent.oldVersion')
1280 @DocsEditable 1280 @DocsEditable()
1281 @Creates('int|String|Null') 1281 @Creates('int|String|Null')
1282 @Returns('int|String|Null') 1282 @Returns('int|String|Null')
1283 final dynamic oldVersion; 1283 final dynamic oldVersion;
1284 } 1284 }
1285 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1285 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1286 // for details. All rights reserved. Use of this source code is governed by a 1286 // for details. All rights reserved. Use of this source code is governed by a
1287 // BSD-style license that can be found in the LICENSE file. 1287 // BSD-style license that can be found in the LICENSE file.
1288 1288
1289 1289
1290 @DocsEditable 1290 @DocsEditable()
1291 @DomName('IDBAny') 1291 @DomName('IDBAny')
1292 @deprecated // nonstandard 1292 @deprecated // nonstandard
1293 abstract class _IDBAny extends Interceptor native "IDBAny" { 1293 abstract class _IDBAny extends Interceptor native "IDBAny" {
1294 } 1294 }
OLDNEW
« no previous file with comments | « sdk/lib/html/html_common/metadata.dart ('k') | sdk/lib/indexed_db/dartium/indexed_db_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698