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

Unified Diff: corelib/unified/core/implementation/completer.dart

Issue 10830117: Port the remaining of dart:core to the unified corelib. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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
Index: corelib/unified/core/implementation/completer.dart
diff --git a/corelib/unified/core/implementation/completer.dart b/corelib/unified/core/implementation/completer.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8e2b608d4594fe4812502b4e7dd475d536abd22c
--- /dev/null
+++ b/corelib/unified/core/implementation/completer.dart
@@ -0,0 +1,21 @@
+// Copyright 2012 Google Inc. All Rights Reserved.
Mads Ager (google) 2012/08/01 13:48:34 Wrong copyright notice. I would remove this again
Anders Johnsen 2012/08/01 14:21:09 I'll remove it again. The reason for moving them
+// Dart core library.
+
+class CompleterImpl<T> implements Completer<T> {
+
+ final FutureImpl<T> _futureImpl;
+
+ CompleterImpl() : _futureImpl = new FutureImpl() {}
+
+ Future<T> get future() {
+ return _futureImpl;
+ }
+
+ void complete(T value) {
+ _futureImpl._setValue(value);
+ }
+
+ void completeException(Object exception, [Object stackTrace]) {
+ _futureImpl._setException(exception, stackTrace);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698