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

Unified Diff: lib/dom/frog/dom_frog.dart

Issue 10128001: Constructors for IDBKeyRange (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/dom/dom.dart ('k') | lib/dom/idl/dart/dart.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/frog/dom_frog.dart
diff --git a/lib/dom/frog/dom_frog.dart b/lib/dom/frog/dom_frog.dart
index 682d24404289d388aa5e301fc698a538a064ca49..5be3f4c1695d81e1f871924db819733a4d7ab32f 100644
--- a/lib/dom/frog/dom_frog.dart
+++ b/lib/dom/frog/dom_frog.dart
@@ -4253,14 +4253,6 @@ class _IDBKeyRangeJs extends _DOMTypeJs implements IDBKeyRange native "*IDBKeyRa
final upper;
final bool upperOpen;
-
- _IDBKeyRangeJs bound(lower, upper, [bool lowerOpen = null, bool upperOpen = null]) native;
-
- _IDBKeyRangeJs lowerBound(bound, [bool open = null]) native;
-
- _IDBKeyRangeJs only(value) native;
-
- _IDBKeyRangeJs upperBound(bound, [bool open = null]) native;
}
class _IDBObjectStoreJs extends _DOMTypeJs implements IDBObjectStore native "*IDBObjectStore" {
@@ -17152,23 +17144,25 @@ interface IDBKey {
// WARNING: Do not edit - generated code.
-interface IDBKeyRange {
+interface IDBKeyRange default _IDBKeyRangeFactoryProvider {
- final /*IDBKey*/ lower;
+ IDBKeyRange.only(/*IDBKey*/ value);
- final bool lowerOpen;
+ IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open]);
- final /*IDBKey*/ upper;
+ IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open]);
- final bool upperOpen;
+ IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper,
+ [bool lowerOpen, bool upperOpen]);
- IDBKeyRange bound(/*IDBKey*/ lower, /*IDBKey*/ upper, [bool lowerOpen, bool upperOpen]);
- IDBKeyRange lowerBound(/*IDBKey*/ bound, [bool open]);
+ final /*IDBKey*/ lower;
- IDBKeyRange only(/*IDBKey*/ value);
+ final bool lowerOpen;
+
+ final /*IDBKey*/ upper;
- IDBKeyRange upperBound(/*IDBKey*/ bound, [bool open]);
+ final bool upperOpen;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -24794,58 +24788,6 @@ interface ReadyState {
*/
static final String COMPLETE = "complete";
}
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/**
- * The [Collections] class implements static methods useful when
- * writing a class that implements [Collection] and the [iterator]
- * method.
- */
-class _Collections {
- static void forEach(Iterable<Object> iterable, void f(Object o)) {
- for (final e in iterable) {
- f(e);
- }
- }
-
- static List map(Iterable<Object> source,
- List<Object> destination,
- f(o)) {
- for (final e in source) {
- destination.add(f(e));
- }
- return destination;
- }
-
- static bool some(Iterable<Object> iterable, bool f(Object o)) {
- for (final e in iterable) {
- if (f(e)) return true;
- }
- return false;
- }
-
- static bool every(Iterable<Object> iterable, bool f(Object o)) {
- for (final e in iterable) {
- if (!f(e)) return false;
- }
- return true;
- }
-
- static List filter(Iterable<Object> source,
- List<Object> destination,
- bool f(o)) {
- for (final e in source) {
- if (f(e)) destination.add(e);
- }
- return destination;
- }
-
- static bool isEmpty(Iterable<Object> iterable) {
- return !iterable.iterator().hasNext();
- }
-}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -24942,6 +24884,53 @@ class _WebSocketFactoryProvider {
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+class _IDBKeyRangeFactoryProvider {
+
+ factory IDBKeyRange.only(/*IDBKey*/ value) =>
+ _only(_class(), _translateKey(value));
+
+ factory IDBKeyRange.lowerBound(/*IDBKey*/ bound, [bool open = false]) =>
+ _lowerBound(_class(), _translateKey(bound), open);
+
+ factory IDBKeyRange.upperBound(/*IDBKey*/ bound, [bool open = false]) =>
+ _upperBound(_class(), _translateKey(bound), open);
+
+ factory IDBKeyRange.bound(/*IDBKey*/ lower, /*IDBKey*/ upper,
+ [bool lowerOpen = false, bool upperOpen = false]) =>
+ _bound(_class(), _translateKey(lower), _translateKey(upper),
+ lowerOpen, upperOpen);
+
+ static var _cachedClass;
+
+ static _class() {
+ if (_cachedClass != null) return _cachedClass;
+ return _cachedClass = _uncachedClass();
+ }
+
+ static _uncachedClass() native '''
+ return window.webkitIDBKeyRange || window.mozIDBKeyRange ||
+ window.msIDBKeyRange || window.IDBKeyRange;
+ ''';
+
+ static _translateKey(idbkey) => idbkey; // TODO: fixme.
+
+ static _IDBKeyRangeJs _only(cls, value) native
+ '''return cls.only(value);''';
+
+ static _IDBKeyRangeJs _lowerBound(cls, bound, open) native
+ '''return cls.lowerBound(bound, open);''';
+
+ static _IDBKeyRangeJs _upperBound(cls, bound, open) native
+ '''return cls.upperBound(bound, open);''';
+
+ static _IDBKeyRangeJs _bound(cls, lower, upper, lowerOpen, upperOpen) native
+ '''return cls.bound(lower, upper, lowerOpen, upperOpen);''';
+
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
class _TypedArrayFactoryProvider {
factory Float32Array(int length) => _F32(length);
@@ -25055,6 +25044,58 @@ class _TypedArrayFactoryProvider {
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+/**
+ * The [Collections] class implements static methods useful when
+ * writing a class that implements [Collection] and the [iterator]
+ * method.
+ */
+class _Collections {
+ static void forEach(Iterable<Object> iterable, void f(Object o)) {
+ for (final e in iterable) {
+ f(e);
+ }
+ }
+
+ static List map(Iterable<Object> source,
+ List<Object> destination,
+ f(o)) {
+ for (final e in source) {
+ destination.add(f(e));
+ }
+ return destination;
+ }
+
+ static bool some(Iterable<Object> iterable, bool f(Object o)) {
+ for (final e in iterable) {
+ if (f(e)) return true;
+ }
+ return false;
+ }
+
+ static bool every(Iterable<Object> iterable, bool f(Object o)) {
+ for (final e in iterable) {
+ if (!f(e)) return false;
+ }
+ return true;
+ }
+
+ static List filter(Iterable<Object> source,
+ List<Object> destination,
+ bool f(o)) {
+ for (final e in source) {
+ if (f(e)) destination.add(e);
+ }
+ return destination;
+ }
+
+ static bool isEmpty(Iterable<Object> iterable) {
+ return !iterable.iterator().hasNext();
+ }
+}
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
// Iterator for arrays with fixed size.
class _FixedSizeListIterator<T> extends _VariableSizeListIterator<T> {
_FixedSizeListIterator(List<T> array)
« 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