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