e780a771d3
BUG= Review URL: https://codereview.chromium.org//12159005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18338 260f80e4-7a28-3924-810f-c04153c831b5
36 lines
873 B
Plaintext
36 lines
873 B
Plaintext
// 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
|
|
}
|