OLD | NEW |
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 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 7 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
8 // for details. All rights reserved. Use of this source code is governed by a | 8 // for details. All rights reserved. Use of this source code is governed by a |
9 // BSD-style license that can be found in the LICENSE file. | 9 // BSD-style license that can be found in the LICENSE file. |
10 | 10 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 186 |
187 @DomName('IDBDatabase.dispatchEvent') | 187 @DomName('IDBDatabase.dispatchEvent') |
188 @DocsEditable | 188 @DocsEditable |
189 bool dispatchEvent(Event evt) native "IDBDatabase_dispatchEvent_Callback"; | 189 bool dispatchEvent(Event evt) native "IDBDatabase_dispatchEvent_Callback"; |
190 | 190 |
191 @DomName('IDBDatabase.removeEventListener') | 191 @DomName('IDBDatabase.removeEventListener') |
192 @DocsEditable | 192 @DocsEditable |
193 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBDatabase_removeEventListener_Callback"; | 193 void $dom_removeEventListener(String type, EventListener listener, [bool useCa
pture]) native "IDBDatabase_removeEventListener_Callback"; |
194 | 194 |
195 Transaction transaction(storeName_OR_storeNames, String mode) { | 195 Transaction transaction(storeName_OR_storeNames, String mode) { |
196 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n
ull) && (mode is String || mode == null)) { | 196 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str
ing> || storeName_OR_storeNames == null)) { |
197 return _transaction_1(storeName_OR_storeNames, mode); | 197 return _transaction_1(storeName_OR_storeNames, mode); |
198 } | 198 } |
199 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n
ull) && (mode is String || mode == null)) { | 199 if ((mode is String || mode == null) && (storeName_OR_storeNames is List<Str
ing> || storeName_OR_storeNames == null)) { |
200 return _transaction_2(storeName_OR_storeNames, mode); | 200 return _transaction_2(storeName_OR_storeNames, mode); |
201 } | 201 } |
202 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) &
& (mode is String || mode == null)) { | 202 if ((mode is String || mode == null) && (storeName_OR_storeNames is String |
| storeName_OR_storeNames == null)) { |
203 return _transaction_3(storeName_OR_storeNames, mode); | 203 return _transaction_3(storeName_OR_storeNames, mode); |
204 } | 204 } |
205 throw new ArgumentError("Incorrect number or type of arguments"); | 205 throw new ArgumentError("Incorrect number or type of arguments"); |
206 } | 206 } |
207 | 207 |
208 Transaction _transaction_1(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_1_Callback"; | 208 Transaction _transaction_1(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_1_Callback"; |
209 | 209 |
210 Transaction _transaction_2(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_2_Callback"; | 210 Transaction _transaction_2(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_2_Callback"; |
211 | 211 |
212 Transaction _transaction_3(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_3_Callback"; | 212 Transaction _transaction_3(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_3_Callback"; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 | 309 |
310 @DomName('IDBFactory.cmp') | 310 @DomName('IDBFactory.cmp') |
311 @DocsEditable | 311 @DocsEditable |
312 int cmp(Object first, Object second) native "IDBFactory_cmp_Callback"; | 312 int cmp(Object first, Object second) native "IDBFactory_cmp_Callback"; |
313 | 313 |
314 @DomName('IDBFactory.deleteDatabase') | 314 @DomName('IDBFactory.deleteDatabase') |
315 @DocsEditable | 315 @DocsEditable |
316 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; | 316 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; |
317 | 317 |
318 OpenDBRequest $dom_open(String name, [int version]) { | 318 OpenDBRequest $dom_open(String name, [int version]) { |
319 if (?version) { | 319 if (version != null) { |
320 return _open_1(name, version); | 320 return _open_1(name, version); |
321 } | 321 } |
322 return _open_2(name); | 322 return _open_2(name); |
323 } | 323 } |
324 | 324 |
325 OpenDBRequest _open_1(name, version) native "IDBFactory__open_1_Callback"; | 325 OpenDBRequest _open_1(name, version) native "IDBFactory__open_1_Callback"; |
326 | 326 |
327 OpenDBRequest _open_2(name) native "IDBFactory__open_2_Callback"; | 327 OpenDBRequest _open_2(name) native "IDBFactory__open_2_Callback"; |
328 | 328 |
329 @DomName('IDBFactory.webkitGetDatabaseNames') | 329 @DomName('IDBFactory.webkitGetDatabaseNames') |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 ObjectStore get objectStore native "IDBIndex_objectStore_Getter"; | 470 ObjectStore get objectStore native "IDBIndex_objectStore_Getter"; |
471 | 471 |
472 @DomName('IDBIndex.unique') | 472 @DomName('IDBIndex.unique') |
473 @DocsEditable | 473 @DocsEditable |
474 bool get unique native "IDBIndex_unique_Getter"; | 474 bool get unique native "IDBIndex_unique_Getter"; |
475 | 475 |
476 Request $dom_count([key_OR_range]) { | 476 Request $dom_count([key_OR_range]) { |
477 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 477 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
478 return _count_1(key_OR_range); | 478 return _count_1(key_OR_range); |
479 } | 479 } |
480 if (?key_OR_range) { | 480 if (key_OR_range != null) { |
481 return _count_2(key_OR_range); | 481 return _count_2(key_OR_range); |
482 } | 482 } |
483 throw new ArgumentError("Incorrect number or type of arguments"); | 483 throw new ArgumentError("Incorrect number or type of arguments"); |
484 } | 484 } |
485 | 485 |
486 Request _count_1(key_OR_range) native "IDBIndex__count_1_Callback"; | 486 Request _count_1(key_OR_range) native "IDBIndex__count_1_Callback"; |
487 | 487 |
488 Request _count_2(key_OR_range) native "IDBIndex__count_2_Callback"; | 488 Request _count_2(key_OR_range) native "IDBIndex__count_2_Callback"; |
489 | 489 |
490 Request $dom_get(key) { | 490 Request $dom_get(key) { |
491 if ((key is KeyRange || key == null)) { | 491 if ((key is KeyRange || key == null)) { |
492 return _get_1(key); | 492 return _get_1(key); |
493 } | 493 } |
494 if (?key) { | 494 if (key != null) { |
495 return _get_2(key); | 495 return _get_2(key); |
496 } | 496 } |
497 throw new ArgumentError("Incorrect number or type of arguments"); | 497 throw new ArgumentError("Incorrect number or type of arguments"); |
498 } | 498 } |
499 | 499 |
500 Request _get_1(key) native "IDBIndex__get_1_Callback"; | 500 Request _get_1(key) native "IDBIndex__get_1_Callback"; |
501 | 501 |
502 Request _get_2(key) native "IDBIndex__get_2_Callback"; | 502 Request _get_2(key) native "IDBIndex__get_2_Callback"; |
503 | 503 |
504 Request $dom_getKey(key) { | 504 Request $dom_getKey(key) { |
505 if ((key is KeyRange || key == null)) { | 505 if ((key is KeyRange || key == null)) { |
506 return _getKey_1(key); | 506 return _getKey_1(key); |
507 } | 507 } |
508 if (?key) { | 508 if (key != null) { |
509 return _getKey_2(key); | 509 return _getKey_2(key); |
510 } | 510 } |
511 throw new ArgumentError("Incorrect number or type of arguments"); | 511 throw new ArgumentError("Incorrect number or type of arguments"); |
512 } | 512 } |
513 | 513 |
514 Request _getKey_1(key) native "IDBIndex__getKey_1_Callback"; | 514 Request _getKey_1(key) native "IDBIndex__getKey_1_Callback"; |
515 | 515 |
516 Request _getKey_2(key) native "IDBIndex__getKey_2_Callback"; | 516 Request _getKey_2(key) native "IDBIndex__getKey_2_Callback"; |
517 | 517 |
518 Request $dom_openCursor([key_OR_range, String direction]) { | 518 Request $dom_openCursor([key_OR_range, String direction]) { |
519 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { | 519 if ((direction is String || direction == null) && (key_OR_range is KeyRange
|| key_OR_range == null)) { |
520 return _openCursor_1(key_OR_range, direction); | 520 return _openCursor_1(key_OR_range, direction); |
521 } | 521 } |
522 if (?key_OR_range && (direction is String || direction == null)) { | 522 if ((direction is String || direction == null) && key_OR_range != null) { |
523 return _openCursor_2(key_OR_range, direction); | 523 return _openCursor_2(key_OR_range, direction); |
524 } | 524 } |
525 throw new ArgumentError("Incorrect number or type of arguments"); | 525 throw new ArgumentError("Incorrect number or type of arguments"); |
526 } | 526 } |
527 | 527 |
528 Request _openCursor_1(key_OR_range, direction) native "IDBIndex__openCursor_1_
Callback"; | 528 Request _openCursor_1(key_OR_range, direction) native "IDBIndex__openCursor_1_
Callback"; |
529 | 529 |
530 Request _openCursor_2(key_OR_range, direction) native "IDBIndex__openCursor_2_
Callback"; | 530 Request _openCursor_2(key_OR_range, direction) native "IDBIndex__openCursor_2_
Callback"; |
531 | 531 |
532 Request $dom_openKeyCursor([key_OR_range, String direction]) { | 532 Request $dom_openKeyCursor([key_OR_range, String direction]) { |
533 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { | 533 if ((direction is String || direction == null) && (key_OR_range is KeyRange
|| key_OR_range == null)) { |
534 return _openKeyCursor_1(key_OR_range, direction); | 534 return _openKeyCursor_1(key_OR_range, direction); |
535 } | 535 } |
536 if (?key_OR_range && (direction is String || direction == null)) { | 536 if ((direction is String || direction == null) && key_OR_range != null) { |
537 return _openKeyCursor_2(key_OR_range, direction); | 537 return _openKeyCursor_2(key_OR_range, direction); |
538 } | 538 } |
539 throw new ArgumentError("Incorrect number or type of arguments"); | 539 throw new ArgumentError("Incorrect number or type of arguments"); |
540 } | 540 } |
541 | 541 |
542 Request _openKeyCursor_1(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_1_Callback"; | 542 Request _openKeyCursor_1(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_1_Callback"; |
543 | 543 |
544 Request _openKeyCursor_2(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_2_Callback"; | 544 Request _openKeyCursor_2(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_2_Callback"; |
545 | 545 |
546 } | 546 } |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 Request $dom_add(Object value, [Object key]) native "IDBObjectStore_add_Callba
ck"; | 776 Request $dom_add(Object value, [Object key]) native "IDBObjectStore_add_Callba
ck"; |
777 | 777 |
778 @DomName('IDBObjectStore.clear') | 778 @DomName('IDBObjectStore.clear') |
779 @DocsEditable | 779 @DocsEditable |
780 Request $dom_clear() native "IDBObjectStore_clear_Callback"; | 780 Request $dom_clear() native "IDBObjectStore_clear_Callback"; |
781 | 781 |
782 Request $dom_count([key_OR_range]) { | 782 Request $dom_count([key_OR_range]) { |
783 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 783 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
784 return _count_1(key_OR_range); | 784 return _count_1(key_OR_range); |
785 } | 785 } |
786 if (?key_OR_range) { | 786 if (key_OR_range != null) { |
787 return _count_2(key_OR_range); | 787 return _count_2(key_OR_range); |
788 } | 788 } |
789 throw new ArgumentError("Incorrect number or type of arguments"); | 789 throw new ArgumentError("Incorrect number or type of arguments"); |
790 } | 790 } |
791 | 791 |
792 Request _count_1(key_OR_range) native "IDBObjectStore__count_1_Callback"; | 792 Request _count_1(key_OR_range) native "IDBObjectStore__count_1_Callback"; |
793 | 793 |
794 Request _count_2(key_OR_range) native "IDBObjectStore__count_2_Callback"; | 794 Request _count_2(key_OR_range) native "IDBObjectStore__count_2_Callback"; |
795 | 795 |
796 Index $dom_createIndex(String name, keyPath, [Map options]) { | 796 Index $dom_createIndex(String name, keyPath, [Map options]) { |
797 if ((name is String || name == null) && (keyPath is List<String> || keyPath
== null) && (options is Map || options == null)) { | 797 if ((options is Map || options == null) && (keyPath is List<String> || keyPa
th == null) && (name is String || name == null)) { |
798 return _createIndex_1(name, keyPath, options); | 798 return _createIndex_1(name, keyPath, options); |
799 } | 799 } |
800 if ((name is String || name == null) && (keyPath is String || keyPath == nul
l) && (options is Map || options == null)) { | 800 if ((options is Map || options == null) && (keyPath is String || keyPath ==
null) && (name is String || name == null)) { |
801 return _createIndex_2(name, keyPath, options); | 801 return _createIndex_2(name, keyPath, options); |
802 } | 802 } |
803 throw new ArgumentError("Incorrect number or type of arguments"); | 803 throw new ArgumentError("Incorrect number or type of arguments"); |
804 } | 804 } |
805 | 805 |
806 Index _createIndex_1(name, keyPath, options) native "IDBObjectStore__createInd
ex_1_Callback"; | 806 Index _createIndex_1(name, keyPath, options) native "IDBObjectStore__createInd
ex_1_Callback"; |
807 | 807 |
808 Index _createIndex_2(name, keyPath, options) native "IDBObjectStore__createInd
ex_2_Callback"; | 808 Index _createIndex_2(name, keyPath, options) native "IDBObjectStore__createInd
ex_2_Callback"; |
809 | 809 |
810 Request $dom_delete(key_OR_keyRange) { | 810 Request $dom_delete(key_OR_keyRange) { |
811 if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) { | 811 if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) { |
812 return _delete_1(key_OR_keyRange); | 812 return _delete_1(key_OR_keyRange); |
813 } | 813 } |
814 if (?key_OR_keyRange) { | 814 if (key_OR_keyRange != null) { |
815 return _delete_2(key_OR_keyRange); | 815 return _delete_2(key_OR_keyRange); |
816 } | 816 } |
817 throw new ArgumentError("Incorrect number or type of arguments"); | 817 throw new ArgumentError("Incorrect number or type of arguments"); |
818 } | 818 } |
819 | 819 |
820 Request _delete_1(key_OR_keyRange) native "IDBObjectStore__delete_1_Callback"; | 820 Request _delete_1(key_OR_keyRange) native "IDBObjectStore__delete_1_Callback"; |
821 | 821 |
822 Request _delete_2(key_OR_keyRange) native "IDBObjectStore__delete_2_Callback"; | 822 Request _delete_2(key_OR_keyRange) native "IDBObjectStore__delete_2_Callback"; |
823 | 823 |
824 @DomName('IDBObjectStore.deleteIndex') | 824 @DomName('IDBObjectStore.deleteIndex') |
825 @DocsEditable | 825 @DocsEditable |
826 void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback"; | 826 void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback"; |
827 | 827 |
828 Request $dom_get(key) { | 828 Request $dom_get(key) { |
829 if ((key is KeyRange || key == null)) { | 829 if ((key is KeyRange || key == null)) { |
830 return _get_1(key); | 830 return _get_1(key); |
831 } | 831 } |
832 if (?key) { | 832 if (key != null) { |
833 return _get_2(key); | 833 return _get_2(key); |
834 } | 834 } |
835 throw new ArgumentError("Incorrect number or type of arguments"); | 835 throw new ArgumentError("Incorrect number or type of arguments"); |
836 } | 836 } |
837 | 837 |
838 Request _get_1(key) native "IDBObjectStore__get_1_Callback"; | 838 Request _get_1(key) native "IDBObjectStore__get_1_Callback"; |
839 | 839 |
840 Request _get_2(key) native "IDBObjectStore__get_2_Callback"; | 840 Request _get_2(key) native "IDBObjectStore__get_2_Callback"; |
841 | 841 |
842 @DomName('IDBObjectStore.index') | 842 @DomName('IDBObjectStore.index') |
843 @DocsEditable | 843 @DocsEditable |
844 Index index(String name) native "IDBObjectStore_index_Callback"; | 844 Index index(String name) native "IDBObjectStore_index_Callback"; |
845 | 845 |
846 Request $dom_openCursor([key_OR_range, String direction]) { | 846 Request $dom_openCursor([key_OR_range, String direction]) { |
847 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { | 847 if ((direction is String || direction == null) && (key_OR_range is KeyRange
|| key_OR_range == null)) { |
848 return _openCursor_1(key_OR_range, direction); | 848 return _openCursor_1(key_OR_range, direction); |
849 } | 849 } |
850 if (?key_OR_range && (direction is String || direction == null)) { | 850 if ((direction is String || direction == null) && key_OR_range != null) { |
851 return _openCursor_2(key_OR_range, direction); | 851 return _openCursor_2(key_OR_range, direction); |
852 } | 852 } |
853 throw new ArgumentError("Incorrect number or type of arguments"); | 853 throw new ArgumentError("Incorrect number or type of arguments"); |
854 } | 854 } |
855 | 855 |
856 Request _openCursor_1(key_OR_range, direction) native "IDBObjectStore__openCur
sor_1_Callback"; | 856 Request _openCursor_1(key_OR_range, direction) native "IDBObjectStore__openCur
sor_1_Callback"; |
857 | 857 |
858 Request _openCursor_2(key_OR_range, direction) native "IDBObjectStore__openCur
sor_2_Callback"; | 858 Request _openCursor_2(key_OR_range, direction) native "IDBObjectStore__openCur
sor_2_Callback"; |
859 | 859 |
860 @DomName('IDBObjectStore.put') | 860 @DomName('IDBObjectStore.put') |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 // WARNING: Do not edit - generated code. | 1119 // WARNING: Do not edit - generated code. |
1120 | 1120 |
1121 | 1121 |
1122 @DocsEditable | 1122 @DocsEditable |
1123 @DomName('IDBAny') | 1123 @DomName('IDBAny') |
1124 @deprecated // nonstandard | 1124 @deprecated // nonstandard |
1125 abstract class _IDBAny extends NativeFieldWrapperClass1 { | 1125 abstract class _IDBAny extends NativeFieldWrapperClass1 { |
1126 _IDBAny.internal(); | 1126 _IDBAny.internal(); |
1127 | 1127 |
1128 } | 1128 } |
OLD | NEW |