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

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

Issue 1349293006: Start using the dart2js type conversions in Dartium as well. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged Created 5 years, 3 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/html_common/html_common_dart2js.dart ('k') | tools/dom/scripts/generator.py » ('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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 if (key != null) { 215 if (key != null) {
216 _blink.BlinkIDBCursor.instance.continue_Callback_1_(unwrap_jso(this), key) ; 216 _blink.BlinkIDBCursor.instance.continue_Callback_1_(unwrap_jso(this), key) ;
217 return; 217 return;
218 } 218 }
219 _blink.BlinkIDBCursor.instance.continue_Callback_0_(unwrap_jso(this)); 219 _blink.BlinkIDBCursor.instance.continue_Callback_0_(unwrap_jso(this));
220 return; 220 return;
221 } 221 }
222 222
223 @DomName('IDBCursor.update') 223 @DomName('IDBCursor.update')
224 @DocsEditable() 224 @DocsEditable()
225 Request _update(Object value) => wrap_jso(_blink.BlinkIDBCursor.instance.updat e_Callback_1_(unwrap_jso(this), value)); 225 Request _update(Object value) => wrap_jso(_blink.BlinkIDBCursor.instance.updat e_Callback_1_(unwrap_jso(this), convertDartToNative_SerializedScriptValue(value) ));
226 226
227 } 227 }
228 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 228 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
229 // for details. All rights reserved. Use of this source code is governed by a 229 // for details. All rights reserved. Use of this source code is governed by a
230 // BSD-style license that can be found in the LICENSE file. 230 // BSD-style license that can be found in the LICENSE file.
231 231
232 // WARNING: Do not edit - generated code. 232 // WARNING: Do not edit - generated code.
233 233
234 234
235 @DocsEditable() 235 @DocsEditable()
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 @DomName('IDBDatabase.version') 357 @DomName('IDBDatabase.version')
358 @DocsEditable() 358 @DocsEditable()
359 Object get version => wrap_jso(_blink.BlinkIDBDatabase.instance.version_Getter _(unwrap_jso(this))); 359 Object get version => wrap_jso(_blink.BlinkIDBDatabase.instance.version_Getter _(unwrap_jso(this)));
360 360
361 @DomName('IDBDatabase.close') 361 @DomName('IDBDatabase.close')
362 @DocsEditable() 362 @DocsEditable()
363 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(unwrap_jso( this)); 363 void close() => _blink.BlinkIDBDatabase.instance.close_Callback_0_(unwrap_jso( this));
364 364
365 ObjectStore _createObjectStore(String name, [Map options]) { 365 ObjectStore _createObjectStore(String name, [Map options]) {
366 if (options != null) { 366 if (options != null) {
367 return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callbac k_2_(unwrap_jso(this), name, options != null ? new js.JsObject.jsify(options) : options)); 367 return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callbac k_2_(unwrap_jso(this), name, convertDartToNative_Dictionary(options)));
368 } 368 }
369 return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callback_ 1_(unwrap_jso(this), name)); 369 return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callback_ 1_(unwrap_jso(this), name));
370 } 370 }
371 371
372 @DomName('IDBDatabase.deleteObjectStore') 372 @DomName('IDBDatabase.deleteObjectStore')
373 @DocsEditable() 373 @DocsEditable()
374 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete ObjectStore_Callback_1_(unwrap_jso(this), name); 374 void deleteObjectStore(String name) => _blink.BlinkIDBDatabase.instance.delete ObjectStore_Callback_1_(unwrap_jso(this), name);
375 375
376 Transaction transaction(storeName_OR_storeNames, [String mode]) { 376 Transaction transaction(storeName_OR_storeNames, [String mode]) {
377 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) & & mode == null) { 377 if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) & & mode == null) {
(...skipping 12 matching lines...) Expand all
390 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(u nwrap_jso(this), unwrap_jso(storeName_OR_storeNames))); 390 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(u nwrap_jso(this), unwrap_jso(storeName_OR_storeNames)));
391 } 391 }
392 if ((mode is String || mode == null) && (storeName_OR_storeNames is DomStrin gList || storeName_OR_storeNames == null)) { 392 if ((mode is String || mode == null) && (storeName_OR_storeNames is DomStrin gList || storeName_OR_storeNames == null)) {
393 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u nwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode)); 393 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u nwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode));
394 } 394 }
395 throw new ArgumentError("Incorrect number or type of arguments"); 395 throw new ArgumentError("Incorrect number or type of arguments");
396 } 396 }
397 397
398 Transaction transactionList(List<String> storeNames, [String mode]) { 398 Transaction transactionList(List<String> storeNames, [String mode]) {
399 if (mode != null) { 399 if (mode != null) {
400 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u nwrap_jso(this), storeNames, mode)); 400 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u nwrap_jso(this), convertDartToNative_StringArray(storeNames), mode));
401 } 401 }
402 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unw rap_jso(this), storeNames)); 402 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unw rap_jso(this), convertDartToNative_StringArray(storeNames)));
403 } 403 }
404 404
405 Transaction transactionStore(String storeName, [String mode]) { 405 Transaction transactionStore(String storeName, [String mode]) {
406 if (mode != null) { 406 if (mode != null) {
407 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u nwrap_jso(this), storeName, mode)); 407 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(u nwrap_jso(this), storeName, mode));
408 } 408 }
409 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unw rap_jso(this), storeName)); 409 return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unw rap_jso(this), storeName));
410 } 410 }
411 411
412 Transaction transactionStores(List<String> storeNames, [String mode]) { 412 Transaction transactionStores(List<String> storeNames, [String mode]) {
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 @DomName('IDBObjectStore.name') 1001 @DomName('IDBObjectStore.name')
1002 @DocsEditable() 1002 @DocsEditable()
1003 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(unwrap_jso (this)); 1003 String get name => _blink.BlinkIDBObjectStore.instance.name_Getter_(unwrap_jso (this));
1004 1004
1005 @DomName('IDBObjectStore.transaction') 1005 @DomName('IDBObjectStore.transaction')
1006 @DocsEditable() 1006 @DocsEditable()
1007 Transaction get transaction => wrap_jso(_blink.BlinkIDBObjectStore.instance.tr ansaction_Getter_(unwrap_jso(this))); 1007 Transaction get transaction => wrap_jso(_blink.BlinkIDBObjectStore.instance.tr ansaction_Getter_(unwrap_jso(this)));
1008 1008
1009 Request _add(Object value, [Object key]) { 1009 Request _add(Object value, [Object key]) {
1010 if (key != null) { 1010 if (key != null) {
1011 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_2_(unwrap _jso(this), value, key)); 1011 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_2_(unwrap _jso(this), convertDartToNative_SerializedScriptValue(value), convertDartToNativ e_SerializedScriptValue(key)));
1012 } 1012 }
1013 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_1_(unwrap_j so(this), value)); 1013 return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_1_(unwrap_j so(this), convertDartToNative_SerializedScriptValue(value)));
1014 } 1014 }
1015 1015
1016 @DomName('IDBObjectStore.clear') 1016 @DomName('IDBObjectStore.clear')
1017 @DocsEditable() 1017 @DocsEditable()
1018 Request _clear() => wrap_jso(_blink.BlinkIDBObjectStore.instance.clear_Callbac k_0_(unwrap_jso(this))); 1018 Request _clear() => wrap_jso(_blink.BlinkIDBObjectStore.instance.clear_Callbac k_0_(unwrap_jso(this)));
1019 1019
1020 @DomName('IDBObjectStore.count') 1020 @DomName('IDBObjectStore.count')
1021 @DocsEditable() 1021 @DocsEditable()
1022 Request _count(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.cou nt_Callback_1_(unwrap_jso(this), key)); 1022 Request _count(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.cou nt_Callback_1_(unwrap_jso(this), key));
1023 1023
1024 Index _createIndex(String name, keyPath, [Map options]) { 1024 Index _createIndex(String name, keyPath, [Map options]) {
1025 if ((keyPath is String || keyPath == null) && (name is String || name == nul l) && options == null) { 1025 if ((keyPath is String || keyPath == null) && (name is String || name == nul l) && options == null) {
1026 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_2 _(unwrap_jso(this), name, unwrap_jso(keyPath))); 1026 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_2 _(unwrap_jso(this), name, unwrap_jso(keyPath)));
1027 } 1027 }
1028 if ((options is Map || options == null) && (keyPath is String || keyPath == null) && (name is String || name == null)) { 1028 if ((options is Map || options == null) && (keyPath is String || keyPath == null) && (name is String || name == null)) {
1029 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_3 _(unwrap_jso(this), name, unwrap_jso(keyPath), options != null ? new js.JsObject .jsify(options) : options)); 1029 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_3 _(unwrap_jso(this), name, unwrap_jso(keyPath), convertDartToNative_Dictionary(op tions)));
1030 } 1030 }
1031 if ((keyPath is List<String> || keyPath == null) && (name is String || name == null) && options == null) { 1031 if ((keyPath is List<String> || keyPath == null) && (name is String || name == null) && options == null) {
1032 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_2 _(unwrap_jso(this), name, unwrap_jso(keyPath))); 1032 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_2 _(unwrap_jso(this), name, unwrap_jso(keyPath)));
1033 } 1033 }
1034 if ((options is Map || options == null) && (keyPath is List<String> || keyPa th == null) && (name is String || name == null)) { 1034 if ((options is Map || options == null) && (keyPath is List<String> || keyPa th == null) && (name is String || name == null)) {
1035 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_3 _(unwrap_jso(this), name, unwrap_jso(keyPath), options != null ? new js.JsObject .jsify(options) : options)); 1035 return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_3 _(unwrap_jso(this), name, unwrap_jso(keyPath), convertDartToNative_Dictionary(op tions)));
1036 } 1036 }
1037 throw new ArgumentError("Incorrect number or type of arguments"); 1037 throw new ArgumentError("Incorrect number or type of arguments");
1038 } 1038 }
1039 1039
1040 @DomName('IDBObjectStore.delete') 1040 @DomName('IDBObjectStore.delete')
1041 @DocsEditable() 1041 @DocsEditable()
1042 Request _delete(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.de lete_Callback_1_(unwrap_jso(this), key)); 1042 Request _delete(Object key) => wrap_jso(_blink.BlinkIDBObjectStore.instance.de lete_Callback_1_(unwrap_jso(this), key));
1043 1043
1044 @DomName('IDBObjectStore.deleteIndex') 1044 @DomName('IDBObjectStore.deleteIndex')
1045 @DocsEditable() 1045 @DocsEditable()
(...skipping 16 matching lines...) Expand all
1062 1062
1063 Request openKeyCursor(Object range, [String direction]) { 1063 Request openKeyCursor(Object range, [String direction]) {
1064 if (direction != null) { 1064 if (direction != null) {
1065 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback _2_(unwrap_jso(this), range, direction)); 1065 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback _2_(unwrap_jso(this), range, direction));
1066 } 1066 }
1067 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_1 _(unwrap_jso(this), range)); 1067 return wrap_jso(_blink.BlinkIDBObjectStore.instance.openKeyCursor_Callback_1 _(unwrap_jso(this), range));
1068 } 1068 }
1069 1069
1070 Request _put(Object value, [Object key]) { 1070 Request _put(Object value, [Object key]) {
1071 if (key != null) { 1071 if (key != null) {
1072 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_2_(unwrap _jso(this), value, key)); 1072 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_2_(unwrap _jso(this), convertDartToNative_SerializedScriptValue(value), convertDartToNativ e_SerializedScriptValue(key)));
1073 } 1073 }
1074 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_1_(unwrap_j so(this), value)); 1074 return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_1_(unwrap_j so(this), convertDartToNative_SerializedScriptValue(value)));
1075 } 1075 }
1076 1076
1077 1077
1078 /** 1078 /**
1079 * Helper for iterating over cursors in a request. 1079 * Helper for iterating over cursors in a request.
1080 */ 1080 */
1081 static Stream<Cursor> _cursorStreamFromResult(Request request, 1081 static Stream<Cursor> _cursorStreamFromResult(Request request,
1082 bool autoAdvance) { 1082 bool autoAdvance) {
1083 // TODO: need to guarantee that the controller provides the values 1083 // TODO: need to guarantee that the controller provides the values
1084 // immediately as waiting until the next tick will cause the transaction to 1084 // immediately as waiting until the next tick will cause the transaction to
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 1392
1393 @DomName('IDBVersionChangeEvent.newVersion') 1393 @DomName('IDBVersionChangeEvent.newVersion')
1394 @DocsEditable() 1394 @DocsEditable()
1395 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge tter_(unwrap_jso(this)); 1395 int get newVersion => _blink.BlinkIDBVersionChangeEvent.instance.newVersion_Ge tter_(unwrap_jso(this));
1396 1396
1397 @DomName('IDBVersionChangeEvent.oldVersion') 1397 @DomName('IDBVersionChangeEvent.oldVersion')
1398 @DocsEditable() 1398 @DocsEditable()
1399 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge tter_(unwrap_jso(this)); 1399 int get oldVersion => _blink.BlinkIDBVersionChangeEvent.instance.oldVersion_Ge tter_(unwrap_jso(this));
1400 1400
1401 } 1401 }
OLDNEW
« no previous file with comments | « sdk/lib/html/html_common/html_common_dart2js.dart ('k') | tools/dom/scripts/generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698