| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library input_stream; | 5 library input_stream; |
| 6 | 6 |
| 7 import 'archive.dart' as archive; | 7 import 'archive.dart' as archive; |
| 8 import 'entry.dart'; | 8 import 'entry.dart'; |
| 9 import 'read_request.dart'; | 9 import 'read_request.dart'; |
| 10 import 'utils.dart'; | 10 import 'utils.dart'; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 Future _emit(ArchiveEntry entry) { | 146 Future _emit(ArchiveEntry entry) { |
| 147 _currentEntry = entry; | 147 _currentEntry = entry; |
| 148 var future = _onEntryCompleter.future.then((onEntry) { | 148 var future = _onEntryCompleter.future.then((onEntry) { |
| 149 if (closed) return new Future.immediate(null); | 149 if (closed) return new Future.immediate(null); |
| 150 var result = onEntry(entry); | 150 var result = onEntry(entry); |
| 151 if (result is Future) return result; | 151 if (result is Future) return result; |
| 152 return new Future.immediate(null); | 152 return new Future.immediate(null); |
| 153 }).then((_) { | 153 }).then((_) { |
| 154 if (entry.isInputOpen) return entry.inputComplete; | 154 if (entry.isInputOpen) return entry.inputComplete; |
| 155 return new Future.immediate(null); | 155 return new Future.immediate(null); |
| 156 }); | 156 }).whenComplete(() { |
| 157 future.whenComplete(() { | |
| 158 _currentEntry = null; | 157 _currentEntry = null; |
| 159 entry.close(); | 158 entry.close(); |
| 160 }); | 159 }); |
| 161 return future; | 160 return future; |
| 162 } | 161 } |
| 163 } | 162 } |
| OLD | NEW |