| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 316 |
| 317 @DomName('IDBFactory.cmp') | 317 @DomName('IDBFactory.cmp') |
| 318 @DocsEditable | 318 @DocsEditable |
| 319 int cmp(Object first, Object second) native "IDBFactory_cmp_Callback"; | 319 int cmp(Object first, Object second) native "IDBFactory_cmp_Callback"; |
| 320 | 320 |
| 321 @DomName('IDBFactory.deleteDatabase') | 321 @DomName('IDBFactory.deleteDatabase') |
| 322 @DocsEditable | 322 @DocsEditable |
| 323 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; | 323 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; |
| 324 | 324 |
| 325 OpenDBRequest $dom_open(String name, [int version]) { | 325 OpenDBRequest $dom_open(String name, [int version]) { |
| 326 if (?version) { | 326 if (version != null) { |
| 327 return _open_1(name, version); | 327 return _open_1(name, version); |
| 328 } | 328 } |
| 329 return _open_2(name); | 329 return _open_2(name); |
| 330 } | 330 } |
| 331 | 331 |
| 332 OpenDBRequest _open_1(name, version) native "IDBFactory__open_1_Callback"; | 332 OpenDBRequest _open_1(name, version) native "IDBFactory__open_1_Callback"; |
| 333 | 333 |
| 334 OpenDBRequest _open_2(name) native "IDBFactory__open_2_Callback"; | 334 OpenDBRequest _open_2(name) native "IDBFactory__open_2_Callback"; |
| 335 | 335 |
| 336 @DomName('IDBFactory.webkitGetDatabaseNames') | 336 @DomName('IDBFactory.webkitGetDatabaseNames') |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 ObjectStore get objectStore native "IDBIndex_objectStore_Getter"; | 477 ObjectStore get objectStore native "IDBIndex_objectStore_Getter"; |
| 478 | 478 |
| 479 @DomName('IDBIndex.unique') | 479 @DomName('IDBIndex.unique') |
| 480 @DocsEditable | 480 @DocsEditable |
| 481 bool get unique native "IDBIndex_unique_Getter"; | 481 bool get unique native "IDBIndex_unique_Getter"; |
| 482 | 482 |
| 483 Request $dom_count([key_OR_range]) { | 483 Request $dom_count([key_OR_range]) { |
| 484 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 484 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 485 return _count_1(key_OR_range); | 485 return _count_1(key_OR_range); |
| 486 } | 486 } |
| 487 if (?key_OR_range) { | 487 if (key_OR_range != null) { |
| 488 return _count_2(key_OR_range); | 488 return _count_2(key_OR_range); |
| 489 } | 489 } |
| 490 throw new ArgumentError("Incorrect number or type of arguments"); | 490 throw new ArgumentError("Incorrect number or type of arguments"); |
| 491 } | 491 } |
| 492 | 492 |
| 493 Request _count_1(key_OR_range) native "IDBIndex__count_1_Callback"; | 493 Request _count_1(key_OR_range) native "IDBIndex__count_1_Callback"; |
| 494 | 494 |
| 495 Request _count_2(key_OR_range) native "IDBIndex__count_2_Callback"; | 495 Request _count_2(key_OR_range) native "IDBIndex__count_2_Callback"; |
| 496 | 496 |
| 497 Request $dom_get(key) { | 497 Request $dom_get(key) { |
| 498 if ((key is KeyRange || key == null)) { | 498 if ((key is KeyRange || key == null)) { |
| 499 return _get_1(key); | 499 return _get_1(key); |
| 500 } | 500 } |
| 501 if (?key) { | 501 if (key != null) { |
| 502 return _get_2(key); | 502 return _get_2(key); |
| 503 } | 503 } |
| 504 throw new ArgumentError("Incorrect number or type of arguments"); | 504 throw new ArgumentError("Incorrect number or type of arguments"); |
| 505 } | 505 } |
| 506 | 506 |
| 507 Request _get_1(key) native "IDBIndex__get_1_Callback"; | 507 Request _get_1(key) native "IDBIndex__get_1_Callback"; |
| 508 | 508 |
| 509 Request _get_2(key) native "IDBIndex__get_2_Callback"; | 509 Request _get_2(key) native "IDBIndex__get_2_Callback"; |
| 510 | 510 |
| 511 Request $dom_getKey(key) { | 511 Request $dom_getKey(key) { |
| 512 if ((key is KeyRange || key == null)) { | 512 if ((key is KeyRange || key == null)) { |
| 513 return _getKey_1(key); | 513 return _getKey_1(key); |
| 514 } | 514 } |
| 515 if (?key) { | 515 if (key != null) { |
| 516 return _getKey_2(key); | 516 return _getKey_2(key); |
| 517 } | 517 } |
| 518 throw new ArgumentError("Incorrect number or type of arguments"); | 518 throw new ArgumentError("Incorrect number or type of arguments"); |
| 519 } | 519 } |
| 520 | 520 |
| 521 Request _getKey_1(key) native "IDBIndex__getKey_1_Callback"; | 521 Request _getKey_1(key) native "IDBIndex__getKey_1_Callback"; |
| 522 | 522 |
| 523 Request _getKey_2(key) native "IDBIndex__getKey_2_Callback"; | 523 Request _getKey_2(key) native "IDBIndex__getKey_2_Callback"; |
| 524 | 524 |
| 525 Request $dom_openCursor([key_OR_range, String direction]) { | 525 Request $dom_openCursor([key_OR_range, String direction]) { |
| 526 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { | 526 if ((direction is String || direction == null) && (key_OR_range is KeyRange
|| key_OR_range == null)) { |
| 527 return _openCursor_1(key_OR_range, direction); | 527 return _openCursor_1(key_OR_range, direction); |
| 528 } | 528 } |
| 529 if (?key_OR_range && (direction is String || direction == null)) { | 529 if ((direction is String || direction == null) && key_OR_range != null) { |
| 530 return _openCursor_2(key_OR_range, direction); | 530 return _openCursor_2(key_OR_range, direction); |
| 531 } | 531 } |
| 532 throw new ArgumentError("Incorrect number or type of arguments"); | 532 throw new ArgumentError("Incorrect number or type of arguments"); |
| 533 } | 533 } |
| 534 | 534 |
| 535 Request _openCursor_1(key_OR_range, direction) native "IDBIndex__openCursor_1_
Callback"; | 535 Request _openCursor_1(key_OR_range, direction) native "IDBIndex__openCursor_1_
Callback"; |
| 536 | 536 |
| 537 Request _openCursor_2(key_OR_range, direction) native "IDBIndex__openCursor_2_
Callback"; | 537 Request _openCursor_2(key_OR_range, direction) native "IDBIndex__openCursor_2_
Callback"; |
| 538 | 538 |
| 539 Request $dom_openKeyCursor([key_OR_range, String direction]) { | 539 Request $dom_openKeyCursor([key_OR_range, String direction]) { |
| 540 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { | 540 if ((direction is String || direction == null) && (key_OR_range is KeyRange
|| key_OR_range == null)) { |
| 541 return _openKeyCursor_1(key_OR_range, direction); | 541 return _openKeyCursor_1(key_OR_range, direction); |
| 542 } | 542 } |
| 543 if (?key_OR_range && (direction is String || direction == null)) { | 543 if ((direction is String || direction == null) && key_OR_range != null) { |
| 544 return _openKeyCursor_2(key_OR_range, direction); | 544 return _openKeyCursor_2(key_OR_range, direction); |
| 545 } | 545 } |
| 546 throw new ArgumentError("Incorrect number or type of arguments"); | 546 throw new ArgumentError("Incorrect number or type of arguments"); |
| 547 } | 547 } |
| 548 | 548 |
| 549 Request _openKeyCursor_1(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_1_Callback"; | 549 Request _openKeyCursor_1(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_1_Callback"; |
| 550 | 550 |
| 551 Request _openKeyCursor_2(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_2_Callback"; | 551 Request _openKeyCursor_2(key_OR_range, direction) native "IDBIndex__openKeyCur
sor_2_Callback"; |
| 552 | 552 |
| 553 } | 553 } |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 Request $dom_add(Object value, [Object key]) native "IDBObjectStore_add_Callba
ck"; | 783 Request $dom_add(Object value, [Object key]) native "IDBObjectStore_add_Callba
ck"; |
| 784 | 784 |
| 785 @DomName('IDBObjectStore.clear') | 785 @DomName('IDBObjectStore.clear') |
| 786 @DocsEditable | 786 @DocsEditable |
| 787 Request $dom_clear() native "IDBObjectStore_clear_Callback"; | 787 Request $dom_clear() native "IDBObjectStore_clear_Callback"; |
| 788 | 788 |
| 789 Request $dom_count([key_OR_range]) { | 789 Request $dom_count([key_OR_range]) { |
| 790 if ((key_OR_range is KeyRange || key_OR_range == null)) { | 790 if ((key_OR_range is KeyRange || key_OR_range == null)) { |
| 791 return _count_1(key_OR_range); | 791 return _count_1(key_OR_range); |
| 792 } | 792 } |
| 793 if (?key_OR_range) { | 793 if (key_OR_range != null) { |
| 794 return _count_2(key_OR_range); | 794 return _count_2(key_OR_range); |
| 795 } | 795 } |
| 796 throw new ArgumentError("Incorrect number or type of arguments"); | 796 throw new ArgumentError("Incorrect number or type of arguments"); |
| 797 } | 797 } |
| 798 | 798 |
| 799 Request _count_1(key_OR_range) native "IDBObjectStore__count_1_Callback"; | 799 Request _count_1(key_OR_range) native "IDBObjectStore__count_1_Callback"; |
| 800 | 800 |
| 801 Request _count_2(key_OR_range) native "IDBObjectStore__count_2_Callback"; | 801 Request _count_2(key_OR_range) native "IDBObjectStore__count_2_Callback"; |
| 802 | 802 |
| 803 Index $dom_createIndex(String name, keyPath, [Map options]) { | 803 Index $dom_createIndex(String name, keyPath, [Map options]) { |
| 804 if ((name is String || name == null) && (keyPath is List<String> || keyPath
== null) && (options is Map || options == null)) { | 804 if ((options is Map || options == null) && (keyPath is List<String> || keyPa
th == null) && (name is String || name == null)) { |
| 805 return _createIndex_1(name, keyPath, options); | 805 return _createIndex_1(name, keyPath, options); |
| 806 } | 806 } |
| 807 if ((name is String || name == null) && (keyPath is String || keyPath == nul
l) && (options is Map || options == null)) { | 807 if ((options is Map || options == null) && (keyPath is String || keyPath ==
null) && (name is String || name == null)) { |
| 808 return _createIndex_2(name, keyPath, options); | 808 return _createIndex_2(name, keyPath, options); |
| 809 } | 809 } |
| 810 throw new ArgumentError("Incorrect number or type of arguments"); | 810 throw new ArgumentError("Incorrect number or type of arguments"); |
| 811 } | 811 } |
| 812 | 812 |
| 813 Index _createIndex_1(name, keyPath, options) native "IDBObjectStore__createInd
ex_1_Callback"; | 813 Index _createIndex_1(name, keyPath, options) native "IDBObjectStore__createInd
ex_1_Callback"; |
| 814 | 814 |
| 815 Index _createIndex_2(name, keyPath, options) native "IDBObjectStore__createInd
ex_2_Callback"; | 815 Index _createIndex_2(name, keyPath, options) native "IDBObjectStore__createInd
ex_2_Callback"; |
| 816 | 816 |
| 817 Request $dom_delete(key_OR_keyRange) { | 817 Request $dom_delete(key_OR_keyRange) { |
| 818 if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) { | 818 if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) { |
| 819 return _delete_1(key_OR_keyRange); | 819 return _delete_1(key_OR_keyRange); |
| 820 } | 820 } |
| 821 if (?key_OR_keyRange) { | 821 if (key_OR_keyRange != null) { |
| 822 return _delete_2(key_OR_keyRange); | 822 return _delete_2(key_OR_keyRange); |
| 823 } | 823 } |
| 824 throw new ArgumentError("Incorrect number or type of arguments"); | 824 throw new ArgumentError("Incorrect number or type of arguments"); |
| 825 } | 825 } |
| 826 | 826 |
| 827 Request _delete_1(key_OR_keyRange) native "IDBObjectStore__delete_1_Callback"; | 827 Request _delete_1(key_OR_keyRange) native "IDBObjectStore__delete_1_Callback"; |
| 828 | 828 |
| 829 Request _delete_2(key_OR_keyRange) native "IDBObjectStore__delete_2_Callback"; | 829 Request _delete_2(key_OR_keyRange) native "IDBObjectStore__delete_2_Callback"; |
| 830 | 830 |
| 831 @DomName('IDBObjectStore.deleteIndex') | 831 @DomName('IDBObjectStore.deleteIndex') |
| 832 @DocsEditable | 832 @DocsEditable |
| 833 void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback"; | 833 void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback"; |
| 834 | 834 |
| 835 Request $dom_get(key) { | 835 Request $dom_get(key) { |
| 836 if ((key is KeyRange || key == null)) { | 836 if ((key is KeyRange || key == null)) { |
| 837 return _get_1(key); | 837 return _get_1(key); |
| 838 } | 838 } |
| 839 if (?key) { | 839 if (key != null) { |
| 840 return _get_2(key); | 840 return _get_2(key); |
| 841 } | 841 } |
| 842 throw new ArgumentError("Incorrect number or type of arguments"); | 842 throw new ArgumentError("Incorrect number or type of arguments"); |
| 843 } | 843 } |
| 844 | 844 |
| 845 Request _get_1(key) native "IDBObjectStore__get_1_Callback"; | 845 Request _get_1(key) native "IDBObjectStore__get_1_Callback"; |
| 846 | 846 |
| 847 Request _get_2(key) native "IDBObjectStore__get_2_Callback"; | 847 Request _get_2(key) native "IDBObjectStore__get_2_Callback"; |
| 848 | 848 |
| 849 @DomName('IDBObjectStore.index') | 849 @DomName('IDBObjectStore.index') |
| 850 @DocsEditable | 850 @DocsEditable |
| 851 Index index(String name) native "IDBObjectStore_index_Callback"; | 851 Index index(String name) native "IDBObjectStore_index_Callback"; |
| 852 | 852 |
| 853 Request $dom_openCursor([key_OR_range, String direction]) { | 853 Request $dom_openCursor([key_OR_range, String direction]) { |
| 854 if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is Stri
ng || direction == null)) { | 854 if ((direction is String || direction == null) && (key_OR_range is KeyRange
|| key_OR_range == null)) { |
| 855 return _openCursor_1(key_OR_range, direction); | 855 return _openCursor_1(key_OR_range, direction); |
| 856 } | 856 } |
| 857 if (?key_OR_range && (direction is String || direction == null)) { | 857 if ((direction is String || direction == null) && key_OR_range != null) { |
| 858 return _openCursor_2(key_OR_range, direction); | 858 return _openCursor_2(key_OR_range, direction); |
| 859 } | 859 } |
| 860 throw new ArgumentError("Incorrect number or type of arguments"); | 860 throw new ArgumentError("Incorrect number or type of arguments"); |
| 861 } | 861 } |
| 862 | 862 |
| 863 Request _openCursor_1(key_OR_range, direction) native "IDBObjectStore__openCur
sor_1_Callback"; | 863 Request _openCursor_1(key_OR_range, direction) native "IDBObjectStore__openCur
sor_1_Callback"; |
| 864 | 864 |
| 865 Request _openCursor_2(key_OR_range, direction) native "IDBObjectStore__openCur
sor_2_Callback"; | 865 Request _openCursor_2(key_OR_range, direction) native "IDBObjectStore__openCur
sor_2_Callback"; |
| 866 | 866 |
| 867 @DomName('IDBObjectStore.put') | 867 @DomName('IDBObjectStore.put') |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1126 // WARNING: Do not edit - generated code. | 1126 // WARNING: Do not edit - generated code. |
| 1127 | 1127 |
| 1128 | 1128 |
| 1129 @DocsEditable | 1129 @DocsEditable |
| 1130 @DomName('IDBAny') | 1130 @DomName('IDBAny') |
| 1131 @deprecated // nonstandard | 1131 @deprecated // nonstandard |
| 1132 abstract class _IDBAny extends NativeFieldWrapperClass1 { | 1132 abstract class _IDBAny extends NativeFieldWrapperClass1 { |
| 1133 _IDBAny.internal(); | 1133 _IDBAny.internal(); |
| 1134 | 1134 |
| 1135 } | 1135 } |
| OLD | NEW |