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

Unified Diff: utils/archive/input_stream.dart

Issue 11785028: Commit Martin's patch for pub + lib_v2. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 11 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 | « utils/archive/entry.dart ('k') | utils/archive/reader.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/archive/input_stream.dart
diff --git a/utils/archive/input_stream.dart b/utils/archive/input_stream.dart
index a2198e88782998de1e9cf0bf96c6886df9880b2f..877c769bcee236765757fdadc66deb644eb0d4aa 100644
--- a/utils/archive/input_stream.dart
+++ b/utils/archive/input_stream.dart
@@ -75,7 +75,7 @@ class ArchiveInputStream {
this.onError = (e, stack) => completer.completeException(e, stack);
this.onClosed = () => completer.complete(result);
- return completer.future.chain(Futures.wait);
+ return completer.future.then(Futures.wait);
}
/**
@@ -130,11 +130,11 @@ class ArchiveInputStream {
Future _consumeHeaders() {
if (closed) return new Future.immediate(null);
var data;
- return call(NEXT_HEADER, _id.value).chain((_data) {
+ return call(NEXT_HEADER, _id.value).then((_data) {
data = _data;
if (data == null) return new Future.immediate(null);
return _emit(new archive.ArchiveEntry.internal(data, _id.value)).
- chain((_) => _consumeHeaders());
+ then((_) => _consumeHeaders());
});
}
@@ -145,16 +145,16 @@ class ArchiveInputStream {
*/
Future _emit(ArchiveEntry entry) {
_currentEntry = entry;
- var future = _onEntryCompleter.future.chain((onEntry) {
+ var future = _onEntryCompleter.future.then((onEntry) {
if (closed) return new Future.immediate(null);
var result = onEntry(entry);
if (result is Future) return result;
return new Future.immediate(null);
- }).chain((_) {
+ }).then((_) {
if (entry.isInputOpen) return entry.inputComplete;
return new Future.immediate(null);
});
- future.onComplete((_) {
+ future.whenComplete(() {
_currentEntry = null;
entry.close();
});
« no previous file with comments | « utils/archive/entry.dart ('k') | utils/archive/reader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698