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

Side by Side Diff: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart

Issue 1762063002: Basline of dart2js w/ regen'd sdk/libs (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/svg/dart2js/svg_dart2js.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * A client-side key-value store with support for indexes. 2 * A client-side key-value store with support for indexes.
3 * 3 *
4 * Many browsers support IndexedDB—a web standard for 4 * Many browsers support IndexedDB—a web standard for
5 * an indexed database. 5 * an indexed database.
6 * By storing data on the client in an IndexedDB, 6 * By storing data on the client in an IndexedDB,
7 * a web app gets some advantages, such as faster performance and persistence. 7 * a web app gets some advantages, such as faster performance and persistence.
8 * To find out which browsers support IndexedDB, 8 * To find out which browsers support IndexedDB,
9 * refer to [Can I Use?](http://caniuse.com/#feat=indexeddb) 9 * refer to [Can I Use?](http://caniuse.com/#feat=indexeddb)
10 * 10 *
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 Request _count(Object key) native; 767 Request _count(Object key) native;
768 768
769 @JSName('get') 769 @JSName('get')
770 @DomName('IDBIndex.get') 770 @DomName('IDBIndex.get')
771 @DocsEditable() 771 @DocsEditable()
772 @Returns('Request') 772 @Returns('Request')
773 @Creates('Request') 773 @Creates('Request')
774 @annotation_Creates_SerializedScriptValue 774 @annotation_Creates_SerializedScriptValue
775 Request _get(Object key) native; 775 Request _get(Object key) native;
776 776
777 @DomName('IDBIndex.getAll')
778 @DocsEditable()
779 @Experimental() // untriaged
780 Request getAll(Object range, [int maxCount]) native;
781
782 @DomName('IDBIndex.getAllKeys')
783 @DocsEditable()
784 @Experimental() // untriaged
785 Request getAllKeys(Object range, [int maxCount]) native;
786
777 @JSName('getKey') 787 @JSName('getKey')
778 @DomName('IDBIndex.getKey') 788 @DomName('IDBIndex.getKey')
779 @DocsEditable() 789 @DocsEditable()
780 @Returns('Request') 790 @Returns('Request')
781 @Creates('Request') 791 @Creates('Request')
782 @annotation_Creates_SerializedScriptValue 792 @annotation_Creates_SerializedScriptValue
783 @Creates('ObjectStore') 793 @Creates('ObjectStore')
784 Request _getKey(Object key) native; 794 Request _getKey(Object key) native;
785 795
786 @JSName('openCursor') 796 @JSName('openCursor')
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 @DocsEditable() 1075 @DocsEditable()
1066 Request _clear() native; 1076 Request _clear() native;
1067 1077
1068 @JSName('count') 1078 @JSName('count')
1069 @DomName('IDBObjectStore.count') 1079 @DomName('IDBObjectStore.count')
1070 @DocsEditable() 1080 @DocsEditable()
1071 Request _count(Object key) native; 1081 Request _count(Object key) native;
1072 1082
1073 @DomName('IDBObjectStore.createIndex') 1083 @DomName('IDBObjectStore.createIndex')
1074 @DocsEditable() 1084 @DocsEditable()
1075 Index _createIndex(String name, keyPath, [Map options]) { 1085 Index _createIndex(String name, Object keyPath, [Map options]) {
1076 if ((keyPath is String || keyPath == null) && options == null) { 1086 if (options != null) {
1077 return _createIndex_1(name, keyPath); 1087 var options_1 = convertDartToNative_Dictionary(options);
1088 return _createIndex_1(name, keyPath, options_1);
1078 } 1089 }
1079 if (options != null && (keyPath is String || keyPath == null)) { 1090 return _createIndex_2(name, keyPath);
1080 var options_1 = convertDartToNative_Dictionary(options);
1081 return _createIndex_2(name, keyPath, options_1);
1082 }
1083 if ((keyPath is List<String> || keyPath == null) && options == null) {
1084 List keyPath_1 = convertDartToNative_StringArray(keyPath);
1085 return _createIndex_3(name, keyPath_1);
1086 }
1087 if (options != null && (keyPath is List<String> || keyPath == null)) {
1088 List keyPath_1 = convertDartToNative_StringArray(keyPath);
1089 var options_2 = convertDartToNative_Dictionary(options);
1090 return _createIndex_4(name, keyPath_1, options_2);
1091 }
1092 throw new ArgumentError("Incorrect number or type of arguments");
1093 } 1091 }
1094 @JSName('createIndex') 1092 @JSName('createIndex')
1095 @DomName('IDBObjectStore.createIndex') 1093 @DomName('IDBObjectStore.createIndex')
1096 @DocsEditable() 1094 @DocsEditable()
1097 Index _createIndex_1(name, String keyPath) native; 1095 Index _createIndex_1(name, keyPath, options) native;
1098 @JSName('createIndex') 1096 @JSName('createIndex')
1099 @DomName('IDBObjectStore.createIndex') 1097 @DomName('IDBObjectStore.createIndex')
1100 @DocsEditable() 1098 @DocsEditable()
1101 Index _createIndex_2(name, String keyPath, options) native; 1099 Index _createIndex_2(name, keyPath) native;
1102 @JSName('createIndex')
1103 @DomName('IDBObjectStore.createIndex')
1104 @DocsEditable()
1105 Index _createIndex_3(name, List keyPath) native;
1106 @JSName('createIndex')
1107 @DomName('IDBObjectStore.createIndex')
1108 @DocsEditable()
1109 Index _createIndex_4(name, List keyPath, options) native;
1110 1100
1111 @JSName('delete') 1101 @JSName('delete')
1112 @DomName('IDBObjectStore.delete') 1102 @DomName('IDBObjectStore.delete')
1113 @DocsEditable() 1103 @DocsEditable()
1114 Request _delete(Object key) native; 1104 Request _delete(Object key) native;
1115 1105
1116 @DomName('IDBObjectStore.deleteIndex') 1106 @DomName('IDBObjectStore.deleteIndex')
1117 @DocsEditable() 1107 @DocsEditable()
1118 void deleteIndex(String name) native; 1108 void deleteIndex(String name) native;
1119 1109
1120 @JSName('get') 1110 @JSName('get')
1121 @DomName('IDBObjectStore.get') 1111 @DomName('IDBObjectStore.get')
1122 @DocsEditable() 1112 @DocsEditable()
1123 @Returns('Request') 1113 @Returns('Request')
1124 @Creates('Request') 1114 @Creates('Request')
1125 @annotation_Creates_SerializedScriptValue 1115 @annotation_Creates_SerializedScriptValue
1126 Request _get(Object key) native; 1116 Request _get(Object key) native;
1127 1117
1118 @DomName('IDBObjectStore.getAll')
1119 @DocsEditable()
1120 @Experimental() // untriaged
1121 Request getAll(Object range, [int maxCount]) native;
1122
1123 @DomName('IDBObjectStore.getAllKeys')
1124 @DocsEditable()
1125 @Experimental() // untriaged
1126 Request getAllKeys(Object range, [int maxCount]) native;
1127
1128 @DomName('IDBObjectStore.index') 1128 @DomName('IDBObjectStore.index')
1129 @DocsEditable() 1129 @DocsEditable()
1130 Index index(String name) native; 1130 Index index(String name) native;
1131 1131
1132 @JSName('openCursor') 1132 @JSName('openCursor')
1133 @DomName('IDBObjectStore.openCursor') 1133 @DomName('IDBObjectStore.openCursor')
1134 @DocsEditable() 1134 @DocsEditable()
1135 @Returns('Request') 1135 @Returns('Request')
1136 @Creates('Request') 1136 @Creates('Request')
1137 @Creates('Cursor') 1137 @Creates('Cursor')
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 final Database db; 1387 final Database db;
1388 1388
1389 @DomName('IDBTransaction.error') 1389 @DomName('IDBTransaction.error')
1390 @DocsEditable() 1390 @DocsEditable()
1391 final DomError error; 1391 final DomError error;
1392 1392
1393 @DomName('IDBTransaction.mode') 1393 @DomName('IDBTransaction.mode')
1394 @DocsEditable() 1394 @DocsEditable()
1395 final String mode; 1395 final String mode;
1396 1396
1397 @DomName('IDBTransaction.objectStoreNames')
1398 @DocsEditable()
1399 @Experimental() // untriaged
1400 @Returns('DomStringList')
1401 @Creates('DomStringList')
1402 final List<String> objectStoreNames;
1403
1397 @DomName('IDBTransaction.abort') 1404 @DomName('IDBTransaction.abort')
1398 @DocsEditable() 1405 @DocsEditable()
1399 void abort() native; 1406 void abort() native;
1400 1407
1401 @DomName('IDBTransaction.objectStore') 1408 @DomName('IDBTransaction.objectStore')
1402 @DocsEditable() 1409 @DocsEditable()
1403 ObjectStore objectStore(String name) native; 1410 ObjectStore objectStore(String name) native;
1404 1411
1405 /// Stream of `abort` events handled by this [Transaction]. 1412 /// Stream of `abort` events handled by this [Transaction].
1406 @DomName('IDBTransaction.onabort') 1413 @DomName('IDBTransaction.onabort')
(...skipping 17 matching lines...) Expand all
1424 1431
1425 1432
1426 @DocsEditable() 1433 @DocsEditable()
1427 @DomName('IDBVersionChangeEvent') 1434 @DomName('IDBVersionChangeEvent')
1428 @Unstable() 1435 @Unstable()
1429 @Native("IDBVersionChangeEvent") 1436 @Native("IDBVersionChangeEvent")
1430 class VersionChangeEvent extends Event { 1437 class VersionChangeEvent extends Event {
1431 // To suppress missing implicit constructor warnings. 1438 // To suppress missing implicit constructor warnings.
1432 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); } 1439 factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); }
1433 1440
1441 @DomName('IDBVersionChangeEvent.IDBVersionChangeEvent')
1442 @DocsEditable()
1443 factory VersionChangeEvent(String type, [Map eventInitDict]) {
1444 if (eventInitDict != null) {
1445 var eventInitDict_1 = convertDartToNative_Dictionary(eventInitDict);
1446 return VersionChangeEvent._create_1(type, eventInitDict_1);
1447 }
1448 return VersionChangeEvent._create_2(type);
1449 }
1450 static VersionChangeEvent _create_1(type, eventInitDict) => JS('VersionChangeE vent', 'new IDBVersionChangeEvent(#,#)', type, eventInitDict);
1451 static VersionChangeEvent _create_2(type) => JS('VersionChangeEvent', 'new IDB VersionChangeEvent(#)', type);
1452
1434 @DomName('IDBVersionChangeEvent.dataLoss') 1453 @DomName('IDBVersionChangeEvent.dataLoss')
1435 @DocsEditable() 1454 @DocsEditable()
1436 @Experimental() // untriaged 1455 @Experimental() // untriaged
1437 final String dataLoss; 1456 final String dataLoss;
1438 1457
1439 @DomName('IDBVersionChangeEvent.dataLossMessage') 1458 @DomName('IDBVersionChangeEvent.dataLossMessage')
1440 @DocsEditable() 1459 @DocsEditable()
1441 @Experimental() // untriaged 1460 @Experimental() // untriaged
1442 final String dataLossMessage; 1461 final String dataLossMessage;
1443 1462
1444 @DomName('IDBVersionChangeEvent.newVersion') 1463 @DomName('IDBVersionChangeEvent.newVersion')
1445 @DocsEditable() 1464 @DocsEditable()
1446 @Creates('int|String|Null') 1465 @Creates('int|String|Null')
1447 @Returns('int|String|Null') 1466 @Returns('int|String|Null')
1448 final int newVersion; 1467 final int newVersion;
1449 1468
1450 @DomName('IDBVersionChangeEvent.oldVersion') 1469 @DomName('IDBVersionChangeEvent.oldVersion')
1451 @DocsEditable() 1470 @DocsEditable()
1452 @Creates('int|String|Null') 1471 @Creates('int|String|Null')
1453 @Returns('int|String|Null') 1472 @Returns('int|String|Null')
1454 final int oldVersion; 1473 final int oldVersion;
1455 } 1474 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/svg/dart2js/svg_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698