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

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

Issue 12159005: Dartifying some IndexedDB 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_IDBObjectStore.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_IDBTransaction.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate b/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate
new file mode 100644
index 0000000000000000000000000000000000000000..bd4d36a97573fb2a729d7961a1e09acea5493e45
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate
@@ -0,0 +1,35 @@
+// Copyright (c) 2013, 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.
+
+part of $LIBRARYNAME;
+
+$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+
+ /**
+ * Provides a Future which will be completed once the transaction has
+ * completed.
+ *
+ * The future will error if an error occurrs on the transaction or if the
+ * transaction is aborted.
+ */
+ Future<Database> get completed {
+ var completer = new Completer<Database>();
+
+ this.onComplete.first.then((_) {
+ completer.complete(db);
+ });
+
+ this.onError.first.then((e) {
+ completer.completeError(e);
+ });
+
+ this.onAbort.first.then((e) {
+ completer.completeError(e);
+ });
+
+ return completer.future;
+ }
+
+$!MEMBERS
+}
« no previous file with comments | « tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698