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

Unified Diff: tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate

Issue 12313015: Dartifying remainder of Index DB APIs. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/templates/html/impl/impl_IDBIndex.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate b/tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate
index ec7d9b30fcfd67b4868159442bd479803e348f21..6f22f937e86ffd3d31a6ffcb46aeb00358c1108e 100644
--- a/tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate
+++ b/tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate
@@ -6,6 +6,54 @@ part of $LIBRARYNAME;
$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+ @DomName('IDBObjectStore.add')
+ Future add(value, [key]) {
+ try {
+ var request;
+ if (key != null) {
+ request = $dom_add(value, key);
+ } else {
+ request = $dom_add(value);
+ }
+ return _completeRequest(request);
+ } catch (e, stacktrace) {
+ return new Future.immediateError(e, stacktrace);
+ }
+ }
+
+ @DomName('IDBObjectStore.clear')
+ Future clear() {
+ try {
+ return _completeRequest($dom_clear());
+ } catch (e, stacktrace) {
+ return new Future.immediateError(e, stacktrace);
+ }
+ }
+
+ @DomName('IDBObjectStore.delete')
+ Future delete(key_OR_keyRange){
+ try {
+ return _completeRequest($dom_delete(key_OR_keyRange));
+ } catch (e, stacktrace) {
+ return new Future.immediateError(e, stacktrace);
+ }
+ }
+
+ @DomName('IDBObjectStore.count')
+ Future<int> count([key_OR_range]) {
+ try {
+ var request;
+ if (key_OR_range != null) {
+ request = $dom_count(key_OR_range);
+ } else {
+ request = $dom_count();
+ }
+ return _completeRequest(request);
+ } catch (e, stacktrace) {
+ return new Future.immediateError(e, stacktrace);
+ }
+ }
+
@DomName('IDBObjectStore.put')
Future put(value, [key]) {
try {
@@ -76,6 +124,19 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
return _cursorStreamFromResult(request, autoAdvance);
}
+ @DomName('IDBObjectStore.createIndex')
+ Index createIndex(String name, keyPath, {bool unique, bool multiEntry}) {
+ var options = {};
+ if (unique != null) {
+ options['unique'] = unique;
+ }
+ if (multiEntry != null) {
+ options['multiEntry'] = multiEntry;
+ }
+
+ return $dom_createIndex(name, keyPath, options);
+ }
+
$!MEMBERS
/**
« no previous file with comments | « tools/dom/templates/html/impl/impl_IDBIndex.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698