Chromium Code Reviews| Index: lib/html/frog/html_frog.dart |
| diff --git a/lib/html/frog/html_frog.dart b/lib/html/frog/html_frog.dart |
| index 0b5598a59547bff58f1e2377a38e770a4cef6d48..f149f5f8cd56361eb3cf0e3fbb00e5a6ec846b45 100644 |
| --- a/lib/html/frog/html_frog.dart |
| +++ b/lib/html/frog/html_frog.dart |
| @@ -13639,9 +13639,55 @@ class _SpeechRecognitionResultListImpl implements SpeechRecognitionResultList na |
| _SpeechRecognitionResultImpl item(int index) native; |
| } |
| +// 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 _StorageImpl implements Storage native "*Storage" { |
| + // TODO(nweiz): update this when maps support lazy iteration |
| + bool containsValue(String value) => getValues().some((e) => e == value); |
| + |
| + bool containsKey(String key) => getItem(key) != null; |
| + |
| + String operator [](String key) => getItem(key); |
| + |
| + void operator []=(String key, String value) => setItem(key, value); |
| + |
| + String putIfAbsent(String key, String ifAbsent()) { |
| + if (!containsKey(key)) this[key] = ifAbsent(); |
| + return this[key]; |
| + } |
| + |
| + String remove(String key) { |
| + final value = this[key]; |
| + removeItem(key); |
| + return value; |
| + } |
| + |
| + void forEach(void f(String key, String value)) { |
| + for (var i = 0; true; i++) { |
| + final key = key(i); |
| + if (key == null) return; |
| + |
| + f(key, this[key]); |
| + } |
| + } |
| + |
| + Collection<String> getKeys() { |
| + final keys = []; |
| + forEach((k, v) => keys.add(k)); |
| + return keys; |
| + } |
| + |
| + Collection<String> getValues() { |
| + final values = []; |
| + forEach((k, v) => values.add(v)); |
| + return values; |
| + } |
| + |
| + bool isEmpty() => key(0) == null; |
| + |
| final int length; |
| void clear() native; |
| @@ -13653,6 +13699,7 @@ class _StorageImpl implements Storage native "*Storage" { |
| void removeItem(String key) native; |
| void setItem(String key, String data) native; |
| + |
| } |
| class _StorageEventImpl extends _EventImpl implements StorageEvent native "*StorageEvent" { |
| @@ -28106,9 +28153,8 @@ interface SpeechRecognitionResultList { |
| // 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. |
| -// WARNING: Do not edit - generated code. |
| - |
| -interface Storage { |
| +interface Storage extends Map<String, String> { |
| +/* |
| final int length; |
|
Jacob
2012/04/02 21:06:41
mark these 3 fields as private in systemhtml.py an
nweiz
2012/04/02 22:32:14
Done.
|
| @@ -28121,6 +28167,8 @@ interface Storage { |
| void removeItem(String key); |
| void setItem(String key, String data); |
| + |
| +*/ |
| } |
| // 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 |