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

Side by Side Diff: lib/dom/frog/dom_frog.dart

Issue 10146002: Revert "Revert "Revert "Constructors for IDBKeyRange""" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
« no previous file with comments | « lib/dom/dom.dart ('k') | lib/dom/idl/dart/dart.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #library('dom'); 1 #library('dom');
2 2
3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 6
7 // DO NOT EDIT 7 // DO NOT EDIT
8 // Auto-generated Dart DOM library. 8 // Auto-generated Dart DOM library.
9 9
10 10
(...skipping 4235 matching lines...) Expand 10 before | Expand all | Expand 10 after
4246 4246
4247 class _IDBKeyRangeJs extends _DOMTypeJs implements IDBKeyRange native "*IDBKeyRa nge" { 4247 class _IDBKeyRangeJs extends _DOMTypeJs implements IDBKeyRange native "*IDBKeyRa nge" {
4248 4248
4249 final lower; 4249 final lower;
4250 4250
4251 final bool lowerOpen; 4251 final bool lowerOpen;
4252 4252
4253 final upper; 4253 final upper;
4254 4254
4255 final bool upperOpen; 4255 final bool upperOpen;
4256
4257 _IDBKeyRangeJs bound(lower, upper, [bool lowerOpen = null, bool upperOpen = nu ll]) native;
4258
4259 _IDBKeyRangeJs lowerBound(bound, [bool open = null]) native;
4260
4261 _IDBKeyRangeJs only(value) native;
4262
4263 _IDBKeyRangeJs upperBound(bound, [bool open = null]) native;
4256 } 4264 }
4257 4265
4258 class _IDBObjectStoreJs extends _DOMTypeJs implements IDBObjectStore native "*ID BObjectStore" { 4266 class _IDBObjectStoreJs extends _DOMTypeJs implements IDBObjectStore native "*ID BObjectStore" {
4259 4267
4260 final List<String> indexNames; 4268 final List<String> indexNames;
4261 4269
4262 final String keyPath; 4270 final String keyPath;
4263 4271
4264 final String name; 4272 final String name;
4265 4273
(...skipping 12871 matching lines...) Expand 10 before | Expand all | Expand 10 after
17137 // WARNING: Do not edit - generated code. 17145 // WARNING: Do not edit - generated code.
17138 17146
17139 interface IDBKey { 17147 interface IDBKey {
17140 } 17148 }
17141 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 17149 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
17142 // for details. All rights reserved. Use of this source code is governed by a 17150 // for details. All rights reserved. Use of this source code is governed by a
17143 // BSD-style license that can be found in the LICENSE file. 17151 // BSD-style license that can be found in the LICENSE file.
17144 17152
17145 // WARNING: Do not edit - generated code. 17153 // WARNING: Do not edit - generated code.
17146 17154
17147 interface IDBKeyRange default _IDBKeyRangeFactoryProvider { 17155 interface IDBKeyRange {
17148
17149 IDBKeyRange.only(/*IDBKey*/ value);
17150
17151 IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open]);
17152
17153 IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open]);
17154
17155 IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper,
17156 [bool lowerOpen, bool upperOpen]);
17157
17158 17156
17159 final /*IDBKey*/ lower; 17157 final /*IDBKey*/ lower;
17160 17158
17161 final bool lowerOpen; 17159 final bool lowerOpen;
17162 17160
17163 final /*IDBKey*/ upper; 17161 final /*IDBKey*/ upper;
17164 17162
17165 final bool upperOpen; 17163 final bool upperOpen;
17164
17165 IDBKeyRange bound(/*IDBKey*/ lower, /*IDBKey*/ upper, [bool lowerOpen, bool up perOpen]);
17166
17167 IDBKeyRange lowerBound(/*IDBKey*/ bound, [bool open]);
17168
17169 IDBKeyRange only(/*IDBKey*/ value);
17170
17171 IDBKeyRange upperBound(/*IDBKey*/ bound, [bool open]);
17166 } 17172 }
17167 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 17173 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
17168 // for details. All rights reserved. Use of this source code is governed by a 17174 // for details. All rights reserved. Use of this source code is governed by a
17169 // BSD-style license that can be found in the LICENSE file. 17175 // BSD-style license that can be found in the LICENSE file.
17170 17176
17171 // WARNING: Do not edit - generated code. 17177 // WARNING: Do not edit - generated code.
17172 17178
17173 interface IDBObjectStore { 17179 interface IDBObjectStore {
17174 17180
17175 final List<String> indexNames; 17181 final List<String> indexNames;
(...skipping 7605 matching lines...) Expand 10 before | Expand all | Expand 10 after
24781 * Indicates the document is finished parsing but is still loading 24787 * Indicates the document is finished parsing but is still loading
24782 * subresources. 24788 * subresources.
24783 */ 24789 */
24784 static final String INTERACTIVE = "interactive"; 24790 static final String INTERACTIVE = "interactive";
24785 24791
24786 /** 24792 /**
24787 * Indicates the document and all subresources have been loaded. 24793 * Indicates the document and all subresources have been loaded.
24788 */ 24794 */
24789 static final String COMPLETE = "complete"; 24795 static final String COMPLETE = "complete";
24790 } 24796 }
24797 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
24798 // for details. All rights reserved. Use of this source code is governed by a
24799 // BSD-style license that can be found in the LICENSE file.
24800
24801 /**
24802 * The [Collections] class implements static methods useful when
24803 * writing a class that implements [Collection] and the [iterator]
24804 * method.
24805 */
24806 class _Collections {
24807 static void forEach(Iterable<Object> iterable, void f(Object o)) {
24808 for (final e in iterable) {
24809 f(e);
24810 }
24811 }
24812
24813 static List map(Iterable<Object> source,
24814 List<Object> destination,
24815 f(o)) {
24816 for (final e in source) {
24817 destination.add(f(e));
24818 }
24819 return destination;
24820 }
24821
24822 static bool some(Iterable<Object> iterable, bool f(Object o)) {
24823 for (final e in iterable) {
24824 if (f(e)) return true;
24825 }
24826 return false;
24827 }
24828
24829 static bool every(Iterable<Object> iterable, bool f(Object o)) {
24830 for (final e in iterable) {
24831 if (!f(e)) return false;
24832 }
24833 return true;
24834 }
24835
24836 static List filter(Iterable<Object> source,
24837 List<Object> destination,
24838 bool f(o)) {
24839 for (final e in source) {
24840 if (f(e)) destination.add(e);
24841 }
24842 return destination;
24843 }
24844
24845 static bool isEmpty(Iterable<Object> iterable) {
24846 return !iterable.iterator().hasNext();
24847 }
24848 }
24791 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 24849 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24792 // for details. All rights reserved. Use of this source code is governed by a 24850 // for details. All rights reserved. Use of this source code is governed by a
24793 // BSD-style license that can be found in the LICENSE file. 24851 // BSD-style license that can be found in the LICENSE file.
24794 24852
24795 // TODO(vsm): Unify with Dartium version. 24853 // TODO(vsm): Unify with Dartium version.
24796 class _DOMWindowCrossFrameImpl implements DOMType, DOMWindow { 24854 class _DOMWindowCrossFrameImpl implements DOMType, DOMWindow {
24797 // Private window. 24855 // Private window.
24798 _DOMWindowJs _window; 24856 _DOMWindowJs _window;
24799 24857
24800 // DOMType 24858 // DOMType
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
24877 } 24935 }
24878 24936
24879 class _WebSocketFactoryProvider { 24937 class _WebSocketFactoryProvider {
24880 24938
24881 factory WebSocket(String url) native '''return new WebSocket(url);'''; 24939 factory WebSocket(String url) native '''return new WebSocket(url);''';
24882 } 24940 }
24883 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 24941 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24884 // for details. All rights reserved. Use of this source code is governed by a 24942 // for details. All rights reserved. Use of this source code is governed by a
24885 // BSD-style license that can be found in the LICENSE file. 24943 // BSD-style license that can be found in the LICENSE file.
24886 24944
24887 class _IDBKeyRangeFactoryProvider {
24888
24889 factory IDBKeyRange.only(/*IDBKey*/ value) =>
24890 _only(_class(), _translateKey(value));
24891
24892 factory IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open = false]) =>
24893 _lowerBound(_class(), _translateKey(bound), open);
24894
24895 factory IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open = false]) =>
24896 _upperBound(_class(), _translateKey(bound), open);
24897
24898 factory IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper,
24899 [bool lowerOpen = false, bool upperOpen = false]) =>
24900 _bound(_class(), _translateKey(lower), _translateKey(upper),
24901 lowerOpen, upperOpen);
24902
24903 static var _cachedClass;
24904
24905 static _class() {
24906 if (_cachedClass != null) return _cachedClass;
24907 return _cachedClass = _uncachedClass();
24908 }
24909
24910 static _uncachedClass() native '''
24911 return window.webkitIDBKeyRange || window.mozIDBKeyRange ||
24912 window.msIDBKeyRange || window.IDBKeyRange;
24913 ''';
24914
24915 static _translateKey(idbkey) => idbkey; // TODO: fixme.
24916
24917 static _IDBKeyRangeJs _only(cls, value) native
24918 '''return cls.only(value);''';
24919
24920 static _IDBKeyRangeJs _lowerBound(cls, bound, open) native
24921 '''return cls.lowerBound(bound, open);''';
24922
24923 static _IDBKeyRangeJs _upperBound(cls, bound, open) native
24924 '''return cls.upperBound(bound, open);''';
24925
24926 static _IDBKeyRangeJs _bound(cls, lower, upper, lowerOpen, upperOpen) native
24927 '''return cls.bound(lower, upper, lowerOpen, upperOpen);''';
24928
24929 }
24930 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24931 // for details. All rights reserved. Use of this source code is governed by a
24932 // BSD-style license that can be found in the LICENSE file.
24933
24934 class _TypedArrayFactoryProvider { 24945 class _TypedArrayFactoryProvider {
24935 24946
24936 factory Float32Array(int length) => _F32(length); 24947 factory Float32Array(int length) => _F32(length);
24937 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list)); 24948 factory Float32Array.fromList(List<num> list) => _F32(ensureNative(list));
24938 factory Float32Array.fromBuffer(ArrayBuffer buffer, 24949 factory Float32Array.fromBuffer(ArrayBuffer buffer,
24939 [int byteOffset = 0, int length]) { 24950 [int byteOffset = 0, int length]) {
24940 if (length == null) return _F32_2(buffer, byteOffset); 24951 if (length == null) return _F32_2(buffer, byteOffset);
24941 return _F32_3(buffer, byteOffset, length); 24952 return _F32_3(buffer, byteOffset, length);
24942 } 24953 }
24943 24954
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
25037 25048
25038 25049
25039 // Ensures that [list] is a JavaScript Array or a typed array. If necessary, 25050 // Ensures that [list] is a JavaScript Array or a typed array. If necessary,
25040 // copies the list. 25051 // copies the list.
25041 static ensureNative(List list) => list; // TODO: make sure. 25052 static ensureNative(List list) => list; // TODO: make sure.
25042 } 25053 }
25043 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 25054 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
25044 // for details. All rights reserved. Use of this source code is governed by a 25055 // for details. All rights reserved. Use of this source code is governed by a
25045 // BSD-style license that can be found in the LICENSE file. 25056 // BSD-style license that can be found in the LICENSE file.
25046 25057
25047 /**
25048 * The [Collections] class implements static methods useful when
25049 * writing a class that implements [Collection] and the [iterator]
25050 * method.
25051 */
25052 class _Collections {
25053 static void forEach(Iterable<Object> iterable, void f(Object o)) {
25054 for (final e in iterable) {
25055 f(e);
25056 }
25057 }
25058
25059 static List map(Iterable<Object> source,
25060 List<Object> destination,
25061 f(o)) {
25062 for (final e in source) {
25063 destination.add(f(e));
25064 }
25065 return destination;
25066 }
25067
25068 static bool some(Iterable<Object> iterable, bool f(Object o)) {
25069 for (final e in iterable) {
25070 if (f(e)) return true;
25071 }
25072 return false;
25073 }
25074
25075 static bool every(Iterable<Object> iterable, bool f(Object o)) {
25076 for (final e in iterable) {
25077 if (!f(e)) return false;
25078 }
25079 return true;
25080 }
25081
25082 static List filter(Iterable<Object> source,
25083 List<Object> destination,
25084 bool f(o)) {
25085 for (final e in source) {
25086 if (f(e)) destination.add(e);
25087 }
25088 return destination;
25089 }
25090
25091 static bool isEmpty(Iterable<Object> iterable) {
25092 return !iterable.iterator().hasNext();
25093 }
25094 }
25095 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
25096 // for details. All rights reserved. Use of this source code is governed by a
25097 // BSD-style license that can be found in the LICENSE file.
25098
25099 // Iterator for arrays with fixed size. 25058 // Iterator for arrays with fixed size.
25100 class _FixedSizeListIterator<T> extends _VariableSizeListIterator<T> { 25059 class _FixedSizeListIterator<T> extends _VariableSizeListIterator<T> {
25101 _FixedSizeListIterator(List<T> array) 25060 _FixedSizeListIterator(List<T> array)
25102 : super(array), 25061 : super(array),
25103 _length = array.length; 25062 _length = array.length;
25104 25063
25105 bool hasNext() => _length > _pos; 25064 bool hasNext() => _length > _pos;
25106 25065
25107 final int _length; // Cache array length for faster access. 25066 final int _length; // Cache array length for faster access.
25108 } 25067 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
25186 if (length < 0) throw new IllegalArgumentException('length'); 25145 if (length < 0) throw new IllegalArgumentException('length');
25187 if (start < 0) throw new IndexOutOfRangeException(start); 25146 if (start < 0) throw new IndexOutOfRangeException(start);
25188 int end = start + length; 25147 int end = start + length;
25189 if (end > a.length) throw new IndexOutOfRangeException(end); 25148 if (end > a.length) throw new IndexOutOfRangeException(end);
25190 for (int i = start; i < end; i++) { 25149 for (int i = start; i < end; i++) {
25191 accumulator.add(a[i]); 25150 accumulator.add(a[i]);
25192 } 25151 }
25193 return accumulator; 25152 return accumulator;
25194 } 25153 }
25195 } 25154 }
OLDNEW
« no previous file with comments | « lib/dom/dom.dart ('k') | lib/dom/idl/dart/dart.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698