Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: sdk/lib/indexed_db/dartium/indexed_db_dartium.dart

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

Powered by Google App Engine
This is Rietveld 408576698