Chromium Code Reviews| 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); |
| + } |
| +} |