| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n
ull) && (mode is String || mode == null)) { | 195 if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == n
ull) && (mode is String || mode == null)) { |
| 196 return _transaction_2(storeName_OR_storeNames, mode); | 196 return _transaction_2(storeName_OR_storeNames, mode); |
| 197 } | 197 } |
| 198 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) &
& (mode is String || mode == null)) { | 198 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) &
& (mode is String || mode == null)) { |
| 199 return _transaction_3(storeName_OR_storeNames, mode); | 199 return _transaction_3(storeName_OR_storeNames, mode); |
| 200 } | 200 } |
| 201 throw new ArgumentError("Incorrect number or type of arguments"); | 201 throw new ArgumentError("Incorrect number or type of arguments"); |
| 202 } | 202 } |
| 203 | 203 |
| 204 @DomName('IDBDatabase._transaction_1') | |
| 205 @DocsEditable | |
| 206 Transaction _transaction_1(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_1_Callback"; | 204 Transaction _transaction_1(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_1_Callback"; |
| 207 | 205 |
| 208 @DomName('IDBDatabase._transaction_2') | |
| 209 @DocsEditable | |
| 210 Transaction _transaction_2(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_2_Callback"; | 206 Transaction _transaction_2(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_2_Callback"; |
| 211 | 207 |
| 212 @DomName('IDBDatabase._transaction_3') | |
| 213 @DocsEditable | |
| 214 Transaction _transaction_3(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_3_Callback"; | 208 Transaction _transaction_3(storeName_OR_storeNames, mode) native "IDBDatabase_
_transaction_3_Callback"; |
| 215 | 209 |
| 216 @DomName('IDBDatabase.onabort') | 210 @DomName('IDBDatabase.onabort') |
| 217 @DocsEditable | 211 @DocsEditable |
| 218 Stream<Event> get onAbort => abortEvent.forTarget(this); | 212 Stream<Event> get onAbort => abortEvent.forTarget(this); |
| 219 | 213 |
| 220 @DomName('IDBDatabase.onerror') | 214 @DomName('IDBDatabase.onerror') |
| 221 @DocsEditable | 215 @DocsEditable |
| 222 Stream<Event> get onError => errorEvent.forTarget(this); | 216 Stream<Event> get onError => errorEvent.forTarget(this); |
| 223 | 217 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 @DocsEditable | 310 @DocsEditable |
| 317 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; | 311 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; |
| 318 | 312 |
| 319 OpenDBRequest $dom_open(String name, [int version]) { | 313 OpenDBRequest $dom_open(String name, [int version]) { |
| 320 if (?version) { | 314 if (?version) { |
| 321 return _open_1(name, version); | 315 return _open_1(name, version); |
| 322 } | 316 } |
| 323 return _open_2(name); | 317 return _open_2(name); |
| 324 } | 318 } |
| 325 | 319 |
| 326 @DomName('IDBFactory._open_1') | |
| 327 @DocsEditable | |
| 328 OpenDBRequest _open_1(name, version) native "IDBFactory__open_1_Callback"; | 320 OpenDBRequest _open_1(name, version) native "IDBFactory__open_1_Callback"; |
| 329 | 321 |
| 330 @DomName('IDBFactory._open_2') | |
| 331 @DocsEditable | |
| 332 OpenDBRequest _open_2(name) native "IDBFactory__open_2_Callback"; | 322 OpenDBRequest _open_2(name) native "IDBFactory__open_2_Callback"; |
| 333 | 323 |
| 334 @DomName('IDBFactory.webkitGetDatabaseNames') | 324 @DomName('IDBFactory.webkitGetDatabaseNames') |
| 335 @DocsEditable | 325 @DocsEditable |
| 336 @SupportedBrowser(SupportedBrowser.CHROME) | 326 @SupportedBrowser(SupportedBrowser.CHROME) |
| 337 @SupportedBrowser(SupportedBrowser.SAFARI) | 327 @SupportedBrowser(SupportedBrowser.SAFARI) |
| 338 @Experimental | 328 @Experimental |
| 339 Request $dom_webkitGetDatabaseNames() native "IDBFactory_webkitGetDatabaseName
s_Callback"; | 329 Request $dom_webkitGetDatabaseNames() native "IDBFactory_webkitGetDatabaseName
s_Callback"; |
| 340 | 330 |
| 341 } | 331 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 Request $dom_count([key_OR_range]) { | 470 Request $dom_count([key_OR_range]) { |
| 481 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 471 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 482 return _count_1(key_OR_range); | 472 return _count_1(key_OR_range); |
| 483 } | 473 } |
| 484 if (?key_OR_range) { | 474 if (?key_OR_range) { |
| 485 return _count_2(key_OR_range); | 475 return _count_2(key_OR_range); |
| 486 } | 476 } |
| 487 throw new ArgumentError("Incorrect number or type of arguments"); | 477 throw new ArgumentError("Incorrect number or type of arguments"); |
| 488 } | 478 } |
| 489 | 479 |
| 490 @DomName('IDBIndex._count_1') | |
| 491 @DocsEditable | |
| 492 Request _count_1(key_OR_range) native "IDBIndex__count_1_Callback"; | 480 Request _count_1(key_OR_range) native "IDBIndex__count_1_Callback"; |
| 493 | 481 |
| 494 @DomName('IDBIndex._count_2') | |
| 495 @DocsEditable | |
| 496 Request _count_2(key_OR_range) native "IDBIndex__count_2_Callback"; | 482 Request _count_2(key_OR_range) native "IDBIndex__count_2_Callback"; |
| 497 | 483 |
| 498 Request $dom_get(key) { | 484 Request $dom_get(key) { |
| 499 if ((key is KeyRange || key == null)) { | 485 if ((key is KeyRange || key == null)) { |
| 500 return _get_1(key); | 486 return _get_1(key); |
| 501 } | 487 } |
| 502 if (?key) { | 488 if (?key) { |
| 503 return _get_2(key); | 489 return _get_2(key); |
| 504 } | 490 } |
| 505 throw new ArgumentError("Incorrect number or type of arguments"); | 491 throw new ArgumentError("Incorrect number or type of arguments"); |
| 506 } | 492 } |
| 507 | 493 |
| 508 @DomName('IDBIndex._get_1') | |
| 509 @DocsEditable | |
| 510 Request _get_1(key) native "IDBIndex__get_1_Callback"; | 494 Request _get_1(key) native "IDBIndex__get_1_Callback"; |
| 511 | 495 |
| 512 @DomName('IDBIndex._get_2') | |
| 513 @DocsEditable | |
| 514 Request _get_2(key) native "IDBIndex__get_2_Callback"; | 496 Request _get_2(key) native "IDBIndex__get_2_Callback"; |
| 515 | 497 |
| 516 Request $dom_getKey(key) { | 498 Request $dom_getKey(key) { |
| 517 if ((key is KeyRange || key == null)) { | 499 if ((key is KeyRange || key == null)) { |
| 518 return _getKey_1(key); | 500 return _getKey_1(key); |
| 519 } | 501 } |
| 520 if (?key) { | 502 if (?key) { |
| 521 return _getKey_2(key); | 503 return _getKey_2(key); |
| 522 } | 504 } |
| 523 throw new ArgumentError("Incorrect number or type of arguments"); | 505 throw new ArgumentError("Incorrect number or type of arguments"); |
| 524 } | 506 } |
| 525 | 507 |
| 526 @DomName('IDBIndex._getKey_1') | |
| 527 @DocsEditable | |
| 528 Request _getKey_1(key) native "IDBIndex__getKey_1_Callback"; | 508 Request _getKey_1(key) native "IDBIndex__getKey_1_Callback"; |
| 529 | 509 |
| 530 @DomName('IDBIndex._getKey_2') | |
| 531 @DocsEditable | |
| 532 Request _getKey_2(key) native "IDBIndex__getKey_2_Callback"; | 510 Request _getKey_2(key) native "IDBIndex__getKey_2_Callback"; |
| 533 | 511 |
| 534 Request $dom_openCursor([key_OR_range, String direction]) { | 512 Request $dom_openCursor([key_OR_range, String direction]) { |
| 535 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { | 513 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { |
| 536 return _openCursor_1(key_OR_range, direction); | 514 return _openCursor_1(key_OR_range, direction); |
| 537 } | 515 } |
| 538 if (?key_OR_range && (direction is String || direction == null)) { | 516 if (?key_OR_range && (direction is String || direction == null)) { |
| 539 return _openCursor_2(key_OR_range, direction); | 517 return _openCursor_2(key_OR_range, direction); |
| 540 } | 518 } |
| 541 throw new ArgumentError("Incorrect number or type of arguments"); | 519 throw new ArgumentError("Incorrect number or type of arguments"); |
| 542 } | 520 } |
| 543 | 521 |
| 544 @DomName('IDBIndex._openCursor_1') | |
| 545 @DocsEditable | |
| 546 Request _openCursor_1(key_OR_range, direction) native "IDBIndex__openCursor_1_
Callback"; | 522 Request _openCursor_1(key_OR_range, direction) native "IDBIndex__openCursor_1_
Callback"; |
| 547 | 523 |
| 548 @DomName('IDBIndex._openCursor_2') | |
| 549 @DocsEditable | |
| 550 Request _openCursor_2(key_OR_range, direction) native "IDBIndex__openCursor_2_
Callback"; | 524 Request _openCursor_2(key_OR_range, direction) native "IDBIndex__openCursor_2_
Callback"; |
| 551 | 525 |
| 552 Request $dom_openKeyCursor([key_OR_range, String direction]) { | 526 Request $dom_openKeyCursor([key_OR_range, String direction]) { |
| 553 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { | 527 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { |
| 554 return _openKeyCursor_1(key_OR_range, direction); | 528 return _openKeyCursor_1(key_OR_range, direction); |
| 555 } | 529 } |
| 556 if (?key_OR_range && (direction is String || direction == null)) { | 530 if (?key_OR_range && (direction is String || direction == null)) { |
| 557 return _openKeyCursor_2(key_OR_range, direction); | 531 return _openKeyCursor_2(key_OR_range, direction); |
| 558 } | 532 } |
| 559 throw new ArgumentError("Incorrect number or type of arguments"); | 533 throw new ArgumentError("Incorrect number or type of arguments"); |
| 560 } | 534 } |
| 561 | 535 |
| 562 @DomName('IDBIndex._openKeyCursor_1') | |
| 563 @DocsEditable | |
| 564 Request _openKeyCursor_1(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_1_Callback"; | 536 Request _openKeyCursor_1(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_1_Callback"; |
| 565 | 537 |
| 566 @DomName('IDBIndex._openKeyCursor_2') | |
| 567 @DocsEditable | |
| 568 Request _openKeyCursor_2(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_2_Callback"; | 538 Request _openKeyCursor_2(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_2_Callback"; |
| 569 | 539 |
| 570 } | 540 } |
| 571 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 541 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 572 // for details. All rights reserved. Use of this source code is governed by a | 542 // for details. All rights reserved. Use of this source code is governed by a |
| 573 // BSD-style license that can be found in the LICENSE file. | 543 // BSD-style license that can be found in the LICENSE file. |
| 574 | 544 |
| 575 | 545 |
| 576 @DomName('IDBKeyRange') | 546 @DomName('IDBKeyRange') |
| 577 class KeyRange extends NativeFieldWrapperClass1 { | 547 class KeyRange extends NativeFieldWrapperClass1 { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 Request $dom_count([key_OR_range]) { | 770 Request $dom_count([key_OR_range]) { |
| 801 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 771 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 802 return _count_1(key_OR_range); | 772 return _count_1(key_OR_range); |
| 803 } | 773 } |
| 804 if (?key_OR_range) { | 774 if (?key_OR_range) { |
| 805 return _count_2(key_OR_range); | 775 return _count_2(key_OR_range); |
| 806 } | 776 } |
| 807 throw new ArgumentError("Incorrect number or type of arguments"); | 777 throw new ArgumentError("Incorrect number or type of arguments"); |
| 808 } | 778 } |
| 809 | 779 |
| 810 @DomName('IDBObjectStore._count_1') | |
| 811 @DocsEditable | |
| 812 Request _count_1(key_OR_range) native "IDBObjectStore__count_1_Callback"; | 780 Request _count_1(key_OR_range) native "IDBObjectStore__count_1_Callback"; |
| 813 | 781 |
| 814 @DomName('IDBObjectStore._count_2') | |
| 815 @DocsEditable | |
| 816 Request _count_2(key_OR_range) native "IDBObjectStore__count_2_Callback"; | 782 Request _count_2(key_OR_range) native "IDBObjectStore__count_2_Callback"; |
| 817 | 783 |
| 818 Index $dom_createIndex(String name, keyPath, [Map options]) { | 784 Index $dom_createIndex(String name, keyPath, [Map options]) { |
| 819 if ((name is String || name == null) && (keyPath is List<String> || keyPath
== null) && (options is Map || options == null)) { | 785 if ((name is String || name == null) && (keyPath is List<String> || keyPath
== null) && (options is Map || options == null)) { |
| 820 return _createIndex_1(name, keyPath, options); | 786 return _createIndex_1(name, keyPath, options); |
| 821 } | 787 } |
| 822 if ((name is String || name == null) && (keyPath is String || keyPath == nul
l) && (options is Map || options == null)) { | 788 if ((name is String || name == null) && (keyPath is String || keyPath == nul
l) && (options is Map || options == null)) { |
| 823 return _createIndex_2(name, keyPath, options); | 789 return _createIndex_2(name, keyPath, options); |
| 824 } | 790 } |
| 825 throw new ArgumentError("Incorrect number or type of arguments"); | 791 throw new ArgumentError("Incorrect number or type of arguments"); |
| 826 } | 792 } |
| 827 | 793 |
| 828 @DomName('IDBObjectStore._createIndex_1') | |
| 829 @DocsEditable | |
| 830 Index _createIndex_1(name, keyPath, options) native "IDBObjectStore__createInd
ex_1_Callback"; | 794 Index _createIndex_1(name, keyPath, options) native "IDBObjectStore__createInd
ex_1_Callback"; |
| 831 | 795 |
| 832 @DomName('IDBObjectStore._createIndex_2') | |
| 833 @DocsEditable | |
| 834 Index _createIndex_2(name, keyPath, options) native "IDBObjectStore__createInd
ex_2_Callback"; | 796 Index _createIndex_2(name, keyPath, options) native "IDBObjectStore__createInd
ex_2_Callback"; |
| 835 | 797 |
| 836 Request $dom_delete(key_OR_keyRange) { | 798 Request $dom_delete(key_OR_keyRange) { |
| 837 if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) { | 799 if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) { |
| 838 return _delete_1(key_OR_keyRange); | 800 return _delete_1(key_OR_keyRange); |
| 839 } | 801 } |
| 840 if (?key_OR_keyRange) { | 802 if (?key_OR_keyRange) { |
| 841 return _delete_2(key_OR_keyRange); | 803 return _delete_2(key_OR_keyRange); |
| 842 } | 804 } |
| 843 throw new ArgumentError("Incorrect number or type of arguments"); | 805 throw new ArgumentError("Incorrect number or type of arguments"); |
| 844 } | 806 } |
| 845 | 807 |
| 846 @DomName('IDBObjectStore._delete_1') | |
| 847 @DocsEditable | |
| 848 Request _delete_1(key_OR_keyRange) native "IDBObjectStore__delete_1_Callback"; | 808 Request _delete_1(key_OR_keyRange) native "IDBObjectStore__delete_1_Callback"; |
| 849 | 809 |
| 850 @DomName('IDBObjectStore._delete_2') | |
| 851 @DocsEditable | |
| 852 Request _delete_2(key_OR_keyRange) native "IDBObjectStore__delete_2_Callback"; | 810 Request _delete_2(key_OR_keyRange) native "IDBObjectStore__delete_2_Callback"; |
| 853 | 811 |
| 854 @DomName('IDBObjectStore.deleteIndex') | 812 @DomName('IDBObjectStore.deleteIndex') |
| 855 @DocsEditable | 813 @DocsEditable |
| 856 void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback"; | 814 void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback"; |
| 857 | 815 |
| 858 Request $dom_get(key) { | 816 Request $dom_get(key) { |
| 859 if ((key is KeyRange || key == null)) { | 817 if ((key is KeyRange || key == null)) { |
| 860 return _get_1(key); | 818 return _get_1(key); |
| 861 } | 819 } |
| 862 if (?key) { | 820 if (?key) { |
| 863 return _get_2(key); | 821 return _get_2(key); |
| 864 } | 822 } |
| 865 throw new ArgumentError("Incorrect number or type of arguments"); | 823 throw new ArgumentError("Incorrect number or type of arguments"); |
| 866 } | 824 } |
| 867 | 825 |
| 868 @DomName('IDBObjectStore._get_1') | |
| 869 @DocsEditable | |
| 870 Request _get_1(key) native "IDBObjectStore__get_1_Callback"; | 826 Request _get_1(key) native "IDBObjectStore__get_1_Callback"; |
| 871 | 827 |
| 872 @DomName('IDBObjectStore._get_2') | |
| 873 @DocsEditable | |
| 874 Request _get_2(key) native "IDBObjectStore__get_2_Callback"; | 828 Request _get_2(key) native "IDBObjectStore__get_2_Callback"; |
| 875 | 829 |
| 876 @DomName('IDBObjectStore.index') | 830 @DomName('IDBObjectStore.index') |
| 877 @DocsEditable | 831 @DocsEditable |
| 878 Index index(String name) native "IDBObjectStore_index_Callback"; | 832 Index index(String name) native "IDBObjectStore_index_Callback"; |
| 879 | 833 |
| 880 Request $dom_openCursor([key_OR_range, String direction]) { | 834 Request $dom_openCursor([key_OR_range, String direction]) { |
| 881 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { | 835 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { |
| 882 return _openCursor_1(key_OR_range, direction); | 836 return _openCursor_1(key_OR_range, direction); |
| 883 } | 837 } |
| 884 if (?key_OR_range && (direction is String || direction == null)) { | 838 if (?key_OR_range && (direction is String || direction == null)) { |
| 885 return _openCursor_2(key_OR_range, direction); | 839 return _openCursor_2(key_OR_range, direction); |
| 886 } | 840 } |
| 887 throw new ArgumentError("Incorrect number or type of arguments"); | 841 throw new ArgumentError("Incorrect number or type of arguments"); |
| 888 } | 842 } |
| 889 | 843 |
| 890 @DomName('IDBObjectStore._openCursor_1') | |
| 891 @DocsEditable | |
| 892 Request _openCursor_1(key_OR_range, direction) native "IDBObjectStore__openCur
sor_1_Callback"; | 844 Request _openCursor_1(key_OR_range, direction) native "IDBObjectStore__openCur
sor_1_Callback"; |
| 893 | 845 |
| 894 @DomName('IDBObjectStore._openCursor_2') | |
| 895 @DocsEditable | |
| 896 Request _openCursor_2(key_OR_range, direction) native "IDBObjectStore__openCur
sor_2_Callback"; | 846 Request _openCursor_2(key_OR_range, direction) native "IDBObjectStore__openCur
sor_2_Callback"; |
| 897 | 847 |
| 898 @DomName('IDBObjectStore.put') | 848 @DomName('IDBObjectStore.put') |
| 899 @DocsEditable | 849 @DocsEditable |
| 900 Request $dom_put(Object value, [Object key]) native "IDBObjectStore_put_Callba
ck"; | 850 Request $dom_put(Object value, [Object key]) native "IDBObjectStore_put_Callba
ck"; |
| 901 | 851 |
| 902 | 852 |
| 903 /** | 853 /** |
| 904 * Helper for iterating over cursors in a request. | 854 * Helper for iterating over cursors in a request. |
| 905 */ | 855 */ |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 | 1102 |
| 1153 // WARNING: Do not edit - generated code. | 1103 // WARNING: Do not edit - generated code. |
| 1154 | 1104 |
| 1155 | 1105 |
| 1156 @DocsEditable | 1106 @DocsEditable |
| 1157 @DomName('IDBAny') | 1107 @DomName('IDBAny') |
| 1158 abstract class _IDBAny extends NativeFieldWrapperClass1 { | 1108 abstract class _IDBAny extends NativeFieldWrapperClass1 { |
| 1159 _IDBAny.internal(); | 1109 _IDBAny.internal(); |
| 1160 | 1110 |
| 1161 } | 1111 } |
| OLD | NEW |