| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 @DomName('IDBCursor.value') | 53 @DomName('IDBCursor.value') |
| 54 Future update(value) { | 54 Future update(value) { |
| 55 try { | 55 try { |
| 56 return _completeRequest($dom_update(value)); | 56 return _completeRequest($dom_update(value)); |
| 57 } catch (e, stacktrace) { | 57 } catch (e, stacktrace) { |
| 58 return new Future.error(e, stacktrace); | 58 return new Future.error(e, stacktrace); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 // To suppress missing implicit constructor warnings. | 62 Cursor.internal(); |
| 63 factory Cursor._() { throw new UnsupportedError("Not supported"); } | |
| 64 | 63 |
| 65 @DomName('IDBCursor.direction') | 64 @DomName('IDBCursor.direction') |
| 66 @DocsEditable | 65 @DocsEditable |
| 67 String get direction native "IDBCursor_direction_Getter"; | 66 String get direction native "IDBCursor_direction_Getter"; |
| 68 | 67 |
| 69 @DomName('IDBCursor.key') | 68 @DomName('IDBCursor.key') |
| 70 @DocsEditable | 69 @DocsEditable |
| 71 Object get key native "IDBCursor_key_Getter"; | 70 Object get key native "IDBCursor_key_Getter"; |
| 72 | 71 |
| 73 @DomName('IDBCursor.primaryKey') | 72 @DomName('IDBCursor.primaryKey') |
| (...skipping 26 matching lines...) Expand all Loading... |
| 100 // for details. All rights reserved. Use of this source code is governed by a | 99 // for details. All rights reserved. Use of this source code is governed by a |
| 101 // BSD-style license that can be found in the LICENSE file. | 100 // BSD-style license that can be found in the LICENSE file. |
| 102 | 101 |
| 103 // WARNING: Do not edit - generated code. | 102 // WARNING: Do not edit - generated code. |
| 104 | 103 |
| 105 | 104 |
| 106 @DocsEditable | 105 @DocsEditable |
| 107 @DomName('IDBCursorWithValue') | 106 @DomName('IDBCursorWithValue') |
| 108 @Unstable | 107 @Unstable |
| 109 class CursorWithValue extends Cursor { | 108 class CursorWithValue extends Cursor { |
| 110 // To suppress missing implicit constructor warnings. | 109 CursorWithValue.internal() : super.internal(); |
| 111 factory CursorWithValue._() { throw new UnsupportedError("Not supported"); } | |
| 112 | 110 |
| 113 @DomName('IDBCursorWithValue.value') | 111 @DomName('IDBCursorWithValue.value') |
| 114 @DocsEditable | 112 @DocsEditable |
| 115 Object get value native "IDBCursorWithValue_value_Getter"; | 113 Object get value native "IDBCursorWithValue_value_Getter"; |
| 116 | 114 |
| 117 } | 115 } |
| 118 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 116 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 119 // for details. All rights reserved. Use of this source code is governed by a | 117 // for details. All rights reserved. Use of this source code is governed by a |
| 120 // BSD-style license that can be found in the LICENSE file. | 118 // BSD-style license that can be found in the LICENSE file. |
| 121 | 119 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 137 options['keyPath'] = keyPath; | 135 options['keyPath'] = keyPath; |
| 138 } | 136 } |
| 139 if (autoIncrement != null) { | 137 if (autoIncrement != null) { |
| 140 options['autoIncrement'] = autoIncrement; | 138 options['autoIncrement'] = autoIncrement; |
| 141 } | 139 } |
| 142 | 140 |
| 143 return $dom_createObjectStore(name, options); | 141 return $dom_createObjectStore(name, options); |
| 144 } | 142 } |
| 145 | 143 |
| 146 | 144 |
| 147 // To suppress missing implicit constructor warnings. | 145 Database.internal() : super.internal(); |
| 148 factory Database._() { throw new UnsupportedError("Not supported"); } | |
| 149 | 146 |
| 150 @DomName('IDBDatabase.abortEvent') | 147 @DomName('IDBDatabase.abortEvent') |
| 151 @DocsEditable | 148 @DocsEditable |
| 152 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); | 149 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); |
| 153 | 150 |
| 154 @DomName('IDBDatabase.errorEvent') | 151 @DomName('IDBDatabase.errorEvent') |
| 155 @DocsEditable | 152 @DocsEditable |
| 156 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); | 153 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); |
| 157 | 154 |
| 158 @DomName('IDBDatabase.versionchangeEvent') | 155 @DomName('IDBDatabase.versionchangeEvent') |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 305 } |
| 309 } | 306 } |
| 310 | 307 |
| 311 /** | 308 /** |
| 312 * Checks to see if getDatabaseNames is supported by the current platform. | 309 * Checks to see if getDatabaseNames is supported by the current platform. |
| 313 */ | 310 */ |
| 314 bool get supportsDatabaseNames { | 311 bool get supportsDatabaseNames { |
| 315 return true; | 312 return true; |
| 316 } | 313 } |
| 317 | 314 |
| 318 // To suppress missing implicit constructor warnings. | 315 IdbFactory.internal(); |
| 319 factory IdbFactory._() { throw new UnsupportedError("Not supported"); } | |
| 320 | 316 |
| 321 @DomName('IDBFactory.cmp') | 317 @DomName('IDBFactory.cmp') |
| 322 @DocsEditable | 318 @DocsEditable |
| 323 int cmp(Object first, Object second) native "IDBFactory_cmp_Callback"; | 319 int cmp(Object first, Object second) native "IDBFactory_cmp_Callback"; |
| 324 | 320 |
| 325 @DomName('IDBFactory.deleteDatabase') | 321 @DomName('IDBFactory.deleteDatabase') |
| 326 @DocsEditable | 322 @DocsEditable |
| 327 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; | 323 OpenDBRequest $dom_deleteDatabase(String name) native "IDBFactory_deleteDataba
se_Callback"; |
| 328 | 324 |
| 329 OpenDBRequest $dom_open(String name, [int version]) { | 325 OpenDBRequest $dom_open(String name, [int version]) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 } | 451 } |
| 456 var request; | 452 var request; |
| 457 if (direction == null) { | 453 if (direction == null) { |
| 458 request = $dom_openKeyCursor(key_OR_range); | 454 request = $dom_openKeyCursor(key_OR_range); |
| 459 } else { | 455 } else { |
| 460 request = $dom_openKeyCursor(key_OR_range, direction); | 456 request = $dom_openKeyCursor(key_OR_range, direction); |
| 461 } | 457 } |
| 462 return ObjectStore._cursorStreamFromResult(request, autoAdvance); | 458 return ObjectStore._cursorStreamFromResult(request, autoAdvance); |
| 463 } | 459 } |
| 464 | 460 |
| 465 // To suppress missing implicit constructor warnings. | 461 Index.internal(); |
| 466 factory Index._() { throw new UnsupportedError("Not supported"); } | |
| 467 | 462 |
| 468 @DomName('IDBIndex.keyPath') | 463 @DomName('IDBIndex.keyPath') |
| 469 @DocsEditable | 464 @DocsEditable |
| 470 dynamic get keyPath native "IDBIndex_keyPath_Getter"; | 465 dynamic get keyPath native "IDBIndex_keyPath_Getter"; |
| 471 | 466 |
| 472 @DomName('IDBIndex.multiEntry') | 467 @DomName('IDBIndex.multiEntry') |
| 473 @DocsEditable | 468 @DocsEditable |
| 474 bool get multiEntry native "IDBIndex_multiEntry_Getter"; | 469 bool get multiEntry native "IDBIndex_multiEntry_Getter"; |
| 475 | 470 |
| 476 @DomName('IDBIndex.name') | 471 @DomName('IDBIndex.name') |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 @DomName('IDBKeyRange.upperBound') | 570 @DomName('IDBKeyRange.upperBound') |
| 576 factory KeyRange.upperBound(/*Key*/ bound, [bool open = false]) => | 571 factory KeyRange.upperBound(/*Key*/ bound, [bool open = false]) => |
| 577 _KeyRangeFactoryProvider.createKeyRange_upperBound(bound, open); | 572 _KeyRangeFactoryProvider.createKeyRange_upperBound(bound, open); |
| 578 | 573 |
| 579 @DomName('KeyRange.bound') | 574 @DomName('KeyRange.bound') |
| 580 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, | 575 factory KeyRange.bound(/*Key*/ lower, /*Key*/ upper, |
| 581 [bool lowerOpen = false, bool upperOpen = false]) => | 576 [bool lowerOpen = false, bool upperOpen = false]) => |
| 582 _KeyRangeFactoryProvider.createKeyRange_bound( | 577 _KeyRangeFactoryProvider.createKeyRange_bound( |
| 583 lower, upper, lowerOpen, upperOpen); | 578 lower, upper, lowerOpen, upperOpen); |
| 584 | 579 |
| 585 // To suppress missing implicit constructor warnings. | 580 KeyRange.internal(); |
| 586 factory KeyRange._() { throw new UnsupportedError("Not supported"); } | |
| 587 | 581 |
| 588 @DomName('IDBKeyRange.lower') | 582 @DomName('IDBKeyRange.lower') |
| 589 @DocsEditable | 583 @DocsEditable |
| 590 Object get lower native "IDBKeyRange_lower_Getter"; | 584 Object get lower native "IDBKeyRange_lower_Getter"; |
| 591 | 585 |
| 592 @DomName('IDBKeyRange.lowerOpen') | 586 @DomName('IDBKeyRange.lowerOpen') |
| 593 @DocsEditable | 587 @DocsEditable |
| 594 bool get lowerOpen native "IDBKeyRange_lowerOpen_Getter"; | 588 bool get lowerOpen native "IDBKeyRange_lowerOpen_Getter"; |
| 595 | 589 |
| 596 @DomName('IDBKeyRange.upper') | 590 @DomName('IDBKeyRange.upper') |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 if (unique != null) { | 749 if (unique != null) { |
| 756 options['unique'] = unique; | 750 options['unique'] = unique; |
| 757 } | 751 } |
| 758 if (multiEntry != null) { | 752 if (multiEntry != null) { |
| 759 options['multiEntry'] = multiEntry; | 753 options['multiEntry'] = multiEntry; |
| 760 } | 754 } |
| 761 | 755 |
| 762 return $dom_createIndex(name, keyPath, options); | 756 return $dom_createIndex(name, keyPath, options); |
| 763 } | 757 } |
| 764 | 758 |
| 765 // To suppress missing implicit constructor warnings. | 759 ObjectStore.internal(); |
| 766 factory ObjectStore._() { throw new UnsupportedError("Not supported"); } | |
| 767 | 760 |
| 768 @DomName('IDBObjectStore.autoIncrement') | 761 @DomName('IDBObjectStore.autoIncrement') |
| 769 @DocsEditable | 762 @DocsEditable |
| 770 bool get autoIncrement native "IDBObjectStore_autoIncrement_Getter"; | 763 bool get autoIncrement native "IDBObjectStore_autoIncrement_Getter"; |
| 771 | 764 |
| 772 @DomName('IDBObjectStore.indexNames') | 765 @DomName('IDBObjectStore.indexNames') |
| 773 @DocsEditable | 766 @DocsEditable |
| 774 List<String> get indexNames native "IDBObjectStore_indexNames_Getter"; | 767 List<String> get indexNames native "IDBObjectStore_indexNames_Getter"; |
| 775 | 768 |
| 776 @DomName('IDBObjectStore.keyPath') | 769 @DomName('IDBObjectStore.keyPath') |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 // for details. All rights reserved. Use of this source code is governed by a | 902 // for details. All rights reserved. Use of this source code is governed by a |
| 910 // BSD-style license that can be found in the LICENSE file. | 903 // BSD-style license that can be found in the LICENSE file. |
| 911 | 904 |
| 912 // WARNING: Do not edit - generated code. | 905 // WARNING: Do not edit - generated code. |
| 913 | 906 |
| 914 | 907 |
| 915 @DocsEditable | 908 @DocsEditable |
| 916 @DomName('IDBOpenDBRequest') | 909 @DomName('IDBOpenDBRequest') |
| 917 @Unstable | 910 @Unstable |
| 918 class OpenDBRequest extends Request implements EventTarget { | 911 class OpenDBRequest extends Request implements EventTarget { |
| 919 // To suppress missing implicit constructor warnings. | 912 OpenDBRequest.internal() : super.internal(); |
| 920 factory OpenDBRequest._() { throw new UnsupportedError("Not supported"); } | |
| 921 | 913 |
| 922 @DomName('IDBOpenDBRequest.blockedEvent') | 914 @DomName('IDBOpenDBRequest.blockedEvent') |
| 923 @DocsEditable | 915 @DocsEditable |
| 924 static const EventStreamProvider<Event> blockedEvent = const EventStreamProvid
er<Event>('blocked'); | 916 static const EventStreamProvider<Event> blockedEvent = const EventStreamProvid
er<Event>('blocked'); |
| 925 | 917 |
| 926 @DomName('IDBOpenDBRequest.upgradeneededEvent') | 918 @DomName('IDBOpenDBRequest.upgradeneededEvent') |
| 927 @DocsEditable | 919 @DocsEditable |
| 928 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons
t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); | 920 static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = cons
t EventStreamProvider<VersionChangeEvent>('upgradeneeded'); |
| 929 | 921 |
| 930 @DomName('IDBOpenDBRequest.onblocked') | 922 @DomName('IDBOpenDBRequest.onblocked') |
| 931 @DocsEditable | 923 @DocsEditable |
| 932 Stream<Event> get onBlocked => blockedEvent.forTarget(this); | 924 Stream<Event> get onBlocked => blockedEvent.forTarget(this); |
| 933 | 925 |
| 934 @DomName('IDBOpenDBRequest.onupgradeneeded') | 926 @DomName('IDBOpenDBRequest.onupgradeneeded') |
| 935 @DocsEditable | 927 @DocsEditable |
| 936 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget
(this); | 928 Stream<VersionChangeEvent> get onUpgradeNeeded => upgradeNeededEvent.forTarget
(this); |
| 937 | 929 |
| 938 } | 930 } |
| 939 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 931 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 940 // for details. All rights reserved. Use of this source code is governed by a | 932 // for details. All rights reserved. Use of this source code is governed by a |
| 941 // BSD-style license that can be found in the LICENSE file. | 933 // BSD-style license that can be found in the LICENSE file. |
| 942 | 934 |
| 943 // WARNING: Do not edit - generated code. | 935 // WARNING: Do not edit - generated code. |
| 944 | 936 |
| 945 | 937 |
| 946 @DocsEditable | 938 @DocsEditable |
| 947 @DomName('IDBRequest') | 939 @DomName('IDBRequest') |
| 948 @Unstable | 940 @Unstable |
| 949 class Request extends EventTarget { | 941 class Request extends EventTarget { |
| 950 // To suppress missing implicit constructor warnings. | 942 Request.internal() : super.internal(); |
| 951 factory Request._() { throw new UnsupportedError("Not supported"); } | |
| 952 | 943 |
| 953 @DomName('IDBRequest.errorEvent') | 944 @DomName('IDBRequest.errorEvent') |
| 954 @DocsEditable | 945 @DocsEditable |
| 955 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); | 946 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider
<Event>('error'); |
| 956 | 947 |
| 957 @DomName('IDBRequest.successEvent') | 948 @DomName('IDBRequest.successEvent') |
| 958 @DocsEditable | 949 @DocsEditable |
| 959 static const EventStreamProvider<Event> successEvent = const EventStreamProvid
er<Event>('success'); | 950 static const EventStreamProvider<Event> successEvent = const EventStreamProvid
er<Event>('success'); |
| 960 | 951 |
| 961 @DomName('IDBRequest.error') | 952 @DomName('IDBRequest.error') |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 completer.completeError(e); | 1024 completer.completeError(e); |
| 1034 }); | 1025 }); |
| 1035 | 1026 |
| 1036 this.onAbort.first.then((e) { | 1027 this.onAbort.first.then((e) { |
| 1037 completer.completeError(e); | 1028 completer.completeError(e); |
| 1038 }); | 1029 }); |
| 1039 | 1030 |
| 1040 return completer.future; | 1031 return completer.future; |
| 1041 } | 1032 } |
| 1042 | 1033 |
| 1043 // To suppress missing implicit constructor warnings. | 1034 Transaction.internal() : super.internal(); |
| 1044 factory Transaction._() { throw new UnsupportedError("Not supported"); } | |
| 1045 | 1035 |
| 1046 @DomName('IDBTransaction.abortEvent') | 1036 @DomName('IDBTransaction.abortEvent') |
| 1047 @DocsEditable | 1037 @DocsEditable |
| 1048 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); | 1038 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); |
| 1049 | 1039 |
| 1050 @DomName('IDBTransaction.completeEvent') | 1040 @DomName('IDBTransaction.completeEvent') |
| 1051 @DocsEditable | 1041 @DocsEditable |
| 1052 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); | 1042 static const EventStreamProvider<Event> completeEvent = const EventStreamProvi
der<Event>('complete'); |
| 1053 | 1043 |
| 1054 @DomName('IDBTransaction.errorEvent') | 1044 @DomName('IDBTransaction.errorEvent') |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 // for details. All rights reserved. Use of this source code is governed by a | 1101 // for details. All rights reserved. Use of this source code is governed by a |
| 1112 // BSD-style license that can be found in the LICENSE file. | 1102 // BSD-style license that can be found in the LICENSE file. |
| 1113 | 1103 |
| 1114 // WARNING: Do not edit - generated code. | 1104 // WARNING: Do not edit - generated code. |
| 1115 | 1105 |
| 1116 | 1106 |
| 1117 @DocsEditable | 1107 @DocsEditable |
| 1118 @DomName('IDBVersionChangeEvent') | 1108 @DomName('IDBVersionChangeEvent') |
| 1119 @Unstable | 1109 @Unstable |
| 1120 class VersionChangeEvent extends Event { | 1110 class VersionChangeEvent extends Event { |
| 1121 // To suppress missing implicit constructor warnings. | 1111 VersionChangeEvent.internal() : super.internal(); |
| 1122 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported");
} | |
| 1123 | 1112 |
| 1124 @DomName('IDBVersionChangeEvent.newVersion') | 1113 @DomName('IDBVersionChangeEvent.newVersion') |
| 1125 @DocsEditable | 1114 @DocsEditable |
| 1126 dynamic get newVersion native "IDBVersionChangeEvent_newVersion_Getter"; | 1115 dynamic get newVersion native "IDBVersionChangeEvent_newVersion_Getter"; |
| 1127 | 1116 |
| 1128 @DomName('IDBVersionChangeEvent.oldVersion') | 1117 @DomName('IDBVersionChangeEvent.oldVersion') |
| 1129 @DocsEditable | 1118 @DocsEditable |
| 1130 dynamic get oldVersion native "IDBVersionChangeEvent_oldVersion_Getter"; | 1119 dynamic get oldVersion native "IDBVersionChangeEvent_oldVersion_Getter"; |
| 1131 | 1120 |
| 1132 } | 1121 } |
| 1133 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1122 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1134 // for details. All rights reserved. Use of this source code is governed by a | 1123 // for details. All rights reserved. Use of this source code is governed by a |
| 1135 // BSD-style license that can be found in the LICENSE file. | 1124 // BSD-style license that can be found in the LICENSE file. |
| 1136 | 1125 |
| 1137 // WARNING: Do not edit - generated code. | 1126 // WARNING: Do not edit - generated code. |
| 1138 | 1127 |
| 1139 | 1128 |
| 1140 @DocsEditable | 1129 @DocsEditable |
| 1141 @DomName('IDBAny') | 1130 @DomName('IDBAny') |
| 1142 @deprecated // nonstandard | 1131 @deprecated // nonstandard |
| 1143 abstract class _IDBAny extends NativeFieldWrapperClass1 { | 1132 abstract class _IDBAny extends NativeFieldWrapperClass1 { |
| 1144 // To suppress missing implicit constructor warnings. | 1133 _IDBAny.internal(); |
| 1145 factory _IDBAny._() { throw new UnsupportedError("Not supported"); } | |
| 1146 | 1134 |
| 1147 } | 1135 } |
| OLD | NEW |