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

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

Issue 12094103: Added MappedListIterable/Iterator to implement map() on Lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 indexed_db; 1 library 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:_js_helper' show Creates, Returns, JSName, Null; 6 import 'dart:_js_helper' show Creates, Returns, JSName, Null;
7 import 'dart:_foreign_helper' show JS; 7 import 'dart:_foreign_helper' show JS;
8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9 // for details. All rights reserved. Use of this source code is governed by a 9 // for details. All rights reserved. Use of this source code is governed by a
10 // BSD-style license that can be found in the LICENSE file. 10 // BSD-style license that can be found in the LICENSE file.
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 final Object primaryKey; 154 final Object primaryKey;
155 155
156 @DomName('IDBCursor.source') 156 @DomName('IDBCursor.source')
157 @DocsEditable 157 @DocsEditable
158 final dynamic source; 158 final dynamic source;
159 159
160 @DomName('IDBCursor.advance') 160 @DomName('IDBCursor.advance')
161 @DocsEditable 161 @DocsEditable
162 void advance(int count) native; 162 void advance(int count) native;
163 163
164 void continueFunction([/*IDBKey*/ key]) { 164 void continue([key]) {
165 if (!?key) {
166 _continue_1();
167 return;
168 }
165 if (?key) { 169 if (?key) {
166 var key_1 = _convertDartToNative_IDBKey(key); 170 var key_1 = _convertDartToNative_IDBKey(key);
167 _continueFunction_1(key_1); 171 _continue_2(key_1);
168 return; 172 return;
169 } 173 }
170 _continueFunction_2(); 174 if (!?key) {
171 return; 175 _continue_3();
176 return;
177 }
178 if (?key) {
179 _continue_4(key);
180 return;
181 }
182 throw new ArgumentError("Incorrect number or type of arguments");
172 } 183 }
173 @JSName('continue') 184 @JSName('continue')
174 @DomName('IDBCursor.continue') 185 @DomName('IDBCursor.continue')
175 @DocsEditable 186 @DocsEditable
176 void _continueFunction_1(key) native; 187 void _continue_1() native;
177 @JSName('continue') 188 @JSName('continue')
178 @DomName('IDBCursor.continue') 189 @DomName('IDBCursor.continue')
179 @DocsEditable 190 @DocsEditable
180 void _continueFunction_2() native; 191 void _continue_2(key) native;
192 @JSName('continue')
193 @DomName('IDBCursor.continue')
194 @DocsEditable
195 void _continue_3() native;
196 @JSName('continue')
197 @DomName('IDBCursor.continue')
198 @DocsEditable
199 void _continue_4(Object key) native;
181 200
182 @DomName('IDBCursor.delete') 201 @DomName('IDBCursor.delete')
183 @DocsEditable 202 @DocsEditable
184 Request delete() native; 203 Request delete() native;
185 204
186 Request update(/*any*/ value) { 205 Request update(/*any*/ value) {
187 var value_1 = convertDartToNative_SerializedScriptValue(value); 206 var value_1 = convertDartToNative_SerializedScriptValue(value);
188 return _update_1(value_1); 207 return _update_1(value_1);
189 } 208 }
190 @JSName('update') 209 @JSName('update')
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 Request _count_3(key) native; 458 Request _count_3(key) native;
440 459
441 Request get(key) { 460 Request get(key) {
442 if ((key is KeyRange || key == null)) { 461 if ((key is KeyRange || key == null)) {
443 return _get_1(key); 462 return _get_1(key);
444 } 463 }
445 if (?key) { 464 if (?key) {
446 var key_1 = _convertDartToNative_IDBKey(key); 465 var key_1 = _convertDartToNative_IDBKey(key);
447 return _get_2(key_1); 466 return _get_2(key_1);
448 } 467 }
468 if (?key) {
469 return _get_3(key);
470 }
449 throw new ArgumentError("Incorrect number or type of arguments"); 471 throw new ArgumentError("Incorrect number or type of arguments");
450 } 472 }
451 @JSName('get') 473 @JSName('get')
452 @DomName('IDBIndex.get') 474 @DomName('IDBIndex.get')
453 @DocsEditable 475 @DocsEditable
454 @Returns('Request') 476 @Returns('Request')
455 @Creates('Request') 477 @Creates('Request')
456 @annotation_Creates_SerializedScriptValue 478 @annotation_Creates_SerializedScriptValue
457 Request _get_1(KeyRange key) native; 479 Request _get_1(KeyRange key) native;
458 @JSName('get') 480 @JSName('get')
459 @DomName('IDBIndex.get') 481 @DomName('IDBIndex.get')
460 @DocsEditable 482 @DocsEditable
461 @Returns('Request') 483 @Returns('Request')
462 @Creates('Request') 484 @Creates('Request')
463 @annotation_Creates_SerializedScriptValue 485 @annotation_Creates_SerializedScriptValue
464 Request _get_2(key) native; 486 Request _get_2(key) native;
487 @JSName('get')
488 @DomName('IDBIndex.get')
489 @DocsEditable
490 @Returns('Request')
491 @Creates('Request')
492 @annotation_Creates_SerializedScriptValue
493 Request _get_3(Object key) native;
465 494
466 Request getKey(key) { 495 Request getKey(key) {
467 if ((key is KeyRange || key == null)) { 496 if ((key is KeyRange || key == null)) {
468 return _getKey_1(key); 497 return _getKey_1(key);
469 } 498 }
470 if (?key) { 499 if (?key) {
471 var key_1 = _convertDartToNative_IDBKey(key); 500 var key_1 = _convertDartToNative_IDBKey(key);
472 return _getKey_2(key_1); 501 return _getKey_2(key_1);
473 } 502 }
474 throw new ArgumentError("Incorrect number or type of arguments"); 503 throw new ArgumentError("Incorrect number or type of arguments");
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 dynamic get upper => _convertNativeToDart_IDBKey(this._upper); 679 dynamic get upper => _convertNativeToDart_IDBKey(this._upper);
651 @JSName('upper') 680 @JSName('upper')
652 @DomName('IDBKeyRange.upper') 681 @DomName('IDBKeyRange.upper')
653 @DocsEditable 682 @DocsEditable
654 final dynamic _upper; 683 final dynamic _upper;
655 684
656 @DomName('IDBKeyRange.upperOpen') 685 @DomName('IDBKeyRange.upperOpen')
657 @DocsEditable 686 @DocsEditable
658 final bool upperOpen; 687 final bool upperOpen;
659 688
660 static KeyRange bound_(/*IDBKey*/ lower, /*IDBKey*/ upper, [bool lowerOpen, bo ol upperOpen]) { 689 static KeyRange bound(/*IDBKey*/ lower, /*IDBKey*/ upper, [bool lowerOpen, boo l upperOpen]) {
661 if (?upperOpen) { 690 if (?upperOpen) {
662 var lower_1 = _convertDartToNative_IDBKey(lower); 691 var lower_1 = _convertDartToNative_IDBKey(lower);
663 var upper_2 = _convertDartToNative_IDBKey(upper); 692 var upper_2 = _convertDartToNative_IDBKey(upper);
664 return _bound__1(lower_1, upper_2, lowerOpen, upperOpen); 693 return _bound_1(lower_1, upper_2, lowerOpen, upperOpen);
665 } 694 }
666 if (?lowerOpen) { 695 if (?lowerOpen) {
667 var lower_3 = _convertDartToNative_IDBKey(lower); 696 var lower_3 = _convertDartToNative_IDBKey(lower);
668 var upper_4 = _convertDartToNative_IDBKey(upper); 697 var upper_4 = _convertDartToNative_IDBKey(upper);
669 return _bound__2(lower_3, upper_4, lowerOpen); 698 return _bound_2(lower_3, upper_4, lowerOpen);
670 } 699 }
671 var lower_5 = _convertDartToNative_IDBKey(lower); 700 var lower_5 = _convertDartToNative_IDBKey(lower);
672 var upper_6 = _convertDartToNative_IDBKey(upper); 701 var upper_6 = _convertDartToNative_IDBKey(upper);
673 return _bound__3(lower_5, upper_6); 702 return _bound_3(lower_5, upper_6);
674 } 703 }
675 @JSName('bound') 704 @JSName('bound')
676 @DomName('IDBKeyRange.bound') 705 @DomName('IDBKeyRange.bound')
677 @DocsEditable 706 @DocsEditable
678 static KeyRange _bound__1(lower, upper, lowerOpen, upperOpen) native; 707 static KeyRange _bound_1(lower, upper, lowerOpen, upperOpen) native;
679 @JSName('bound') 708 @JSName('bound')
680 @DomName('IDBKeyRange.bound') 709 @DomName('IDBKeyRange.bound')
681 @DocsEditable 710 @DocsEditable
682 static KeyRange _bound__2(lower, upper, lowerOpen) native; 711 static KeyRange _bound_2(lower, upper, lowerOpen) native;
683 @JSName('bound') 712 @JSName('bound')
684 @DomName('IDBKeyRange.bound') 713 @DomName('IDBKeyRange.bound')
685 @DocsEditable 714 @DocsEditable
686 static KeyRange _bound__3(lower, upper) native; 715 static KeyRange _bound_3(lower, upper) native;
687 716
688 static KeyRange lowerBound_(/*IDBKey*/ bound, [bool open]) { 717 static KeyRange lowerBound(/*IDBKey*/ bound, [bool open]) {
689 if (?open) { 718 if (?open) {
690 var bound_1 = _convertDartToNative_IDBKey(bound); 719 var bound_1 = _convertDartToNative_IDBKey(bound);
691 return _lowerBound__1(bound_1, open); 720 return _lowerBound_1(bound_1, open);
692 } 721 }
693 var bound_2 = _convertDartToNative_IDBKey(bound); 722 var bound_2 = _convertDartToNative_IDBKey(bound);
694 return _lowerBound__2(bound_2); 723 return _lowerBound_2(bound_2);
695 } 724 }
696 @JSName('lowerBound') 725 @JSName('lowerBound')
697 @DomName('IDBKeyRange.lowerBound') 726 @DomName('IDBKeyRange.lowerBound')
698 @DocsEditable 727 @DocsEditable
699 static KeyRange _lowerBound__1(bound, open) native; 728 static KeyRange _lowerBound_1(bound, open) native;
700 @JSName('lowerBound') 729 @JSName('lowerBound')
701 @DomName('IDBKeyRange.lowerBound') 730 @DomName('IDBKeyRange.lowerBound')
702 @DocsEditable 731 @DocsEditable
703 static KeyRange _lowerBound__2(bound) native; 732 static KeyRange _lowerBound_2(bound) native;
704 733
705 static KeyRange only_(/*IDBKey*/ value) { 734 static KeyRange only(/*IDBKey*/ value) {
706 var value_1 = _convertDartToNative_IDBKey(value); 735 var value_1 = _convertDartToNative_IDBKey(value);
707 return _only__1(value_1); 736 return _only_1(value_1);
708 } 737 }
709 @JSName('only') 738 @JSName('only')
710 @DomName('IDBKeyRange.only') 739 @DomName('IDBKeyRange.only')
711 @DocsEditable 740 @DocsEditable
712 static KeyRange _only__1(value) native; 741 static KeyRange _only_1(value) native;
713 742
714 static KeyRange upperBound_(/*IDBKey*/ bound, [bool open]) { 743 static KeyRange upperBound(/*IDBKey*/ bound, [bool open]) {
715 if (?open) { 744 if (?open) {
716 var bound_1 = _convertDartToNative_IDBKey(bound); 745 var bound_1 = _convertDartToNative_IDBKey(bound);
717 return _upperBound__1(bound_1, open); 746 return _upperBound_1(bound_1, open);
718 } 747 }
719 var bound_2 = _convertDartToNative_IDBKey(bound); 748 var bound_2 = _convertDartToNative_IDBKey(bound);
720 return _upperBound__2(bound_2); 749 return _upperBound_2(bound_2);
721 } 750 }
722 @JSName('upperBound') 751 @JSName('upperBound')
723 @DomName('IDBKeyRange.upperBound') 752 @DomName('IDBKeyRange.upperBound')
724 @DocsEditable 753 @DocsEditable
725 static KeyRange _upperBound__1(bound, open) native; 754 static KeyRange _upperBound_1(bound, open) native;
726 @JSName('upperBound') 755 @JSName('upperBound')
727 @DomName('IDBKeyRange.upperBound') 756 @DomName('IDBKeyRange.upperBound')
728 @DocsEditable 757 @DocsEditable
729 static KeyRange _upperBound__2(bound) native; 758 static KeyRange _upperBound_2(bound) native;
730 759
731 } 760 }
732 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 761 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
733 // for details. All rights reserved. Use of this source code is governed by a 762 // for details. All rights reserved. Use of this source code is governed by a
734 // BSD-style license that can be found in the LICENSE file. 763 // BSD-style license that can be found in the LICENSE file.
735 764
736 765
737 @DocsEditable 766 @DocsEditable
738 @DomName('IDBObjectStore') 767 @DomName('IDBObjectStore')
739 class ObjectStore native "*IDBObjectStore" { 768 class ObjectStore native "*IDBObjectStore" {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 void deleteIndex(String name) native; 901 void deleteIndex(String name) native;
873 902
874 Request getObject(key) { 903 Request getObject(key) {
875 if ((key is KeyRange || key == null)) { 904 if ((key is KeyRange || key == null)) {
876 return _getObject_1(key); 905 return _getObject_1(key);
877 } 906 }
878 if (?key) { 907 if (?key) {
879 var key_1 = _convertDartToNative_IDBKey(key); 908 var key_1 = _convertDartToNative_IDBKey(key);
880 return _getObject_2(key_1); 909 return _getObject_2(key_1);
881 } 910 }
911 if (?key) {
912 return _getObject_3(key);
913 }
882 throw new ArgumentError("Incorrect number or type of arguments"); 914 throw new ArgumentError("Incorrect number or type of arguments");
883 } 915 }
884 @JSName('get') 916 @JSName('get')
885 @DomName('IDBObjectStore.get') 917 @DomName('IDBObjectStore.get')
886 @DocsEditable 918 @DocsEditable
887 @Returns('Request') 919 @Returns('Request')
888 @Creates('Request') 920 @Creates('Request')
889 @annotation_Creates_SerializedScriptValue 921 @annotation_Creates_SerializedScriptValue
890 Request _getObject_1(KeyRange key) native; 922 Request _getObject_1(KeyRange key) native;
891 @JSName('get') 923 @JSName('get')
892 @DomName('IDBObjectStore.get') 924 @DomName('IDBObjectStore.get')
893 @DocsEditable 925 @DocsEditable
894 @Returns('Request') 926 @Returns('Request')
895 @Creates('Request') 927 @Creates('Request')
896 @annotation_Creates_SerializedScriptValue 928 @annotation_Creates_SerializedScriptValue
897 Request _getObject_2(key) native; 929 Request _getObject_2(key) native;
930 @JSName('get')
931 @DomName('IDBObjectStore.get')
932 @DocsEditable
933 @Returns('Request')
934 @Creates('Request')
935 @annotation_Creates_SerializedScriptValue
936 Request _getObject_3(Object key) native;
898 937
899 @DomName('IDBObjectStore.index') 938 @DomName('IDBObjectStore.index')
900 @DocsEditable 939 @DocsEditable
901 Index index(String name) native; 940 Index index(String name) native;
902 941
903 Request openCursor([key_OR_range, String direction]) { 942 Request openCursor([key_OR_range, String direction]) {
904 if (!?key_OR_range && !?direction) { 943 if (!?key_OR_range && !?direction) {
905 return _openCursor_1(); 944 return _openCursor_1();
906 } 945 }
907 if ((key_OR_range is KeyRange || key_OR_range == null) && !?direction) { 946 if ((key_OR_range is KeyRange || key_OR_range == null) && !?direction) {
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 } 1307 }
1269 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1308 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1270 // for details. All rights reserved. Use of this source code is governed by a 1309 // for details. All rights reserved. Use of this source code is governed by a
1271 // BSD-style license that can be found in the LICENSE file. 1310 // BSD-style license that can be found in the LICENSE file.
1272 1311
1273 1312
1274 @DocsEditable 1313 @DocsEditable
1275 @DomName('IDBAny') 1314 @DomName('IDBAny')
1276 class _Any native "*IDBAny" { 1315 class _Any native "*IDBAny" {
1277 } 1316 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698