OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // The following code is copied from sdk/lib/io/io_sink.dart. The "dart:io" | 5 // The following code is copied from sdk/lib/io/io_sink.dart. The "dart:io" |
6 // implementation isn't used directly to support non-"dart:io" applications. | 6 // implementation isn't used directly to support non-"dart:io" applications. |
7 // | 7 // |
8 // Because it's copied directly, only modifications necessary to support the | 8 // Because it's copied directly, only modifications necessary to support the |
9 // desired public API and to remove "dart:io" dependencies have been made. | 9 // desired public API and to remove "dart:io" dependencies have been made. |
10 // | 10 // |
11 // This is up-to-date as of sdk revision | 11 // This is up-to-date as of sdk revision |
12 // 86227840d75d974feb238f8b3c59c038b99c05cf. | 12 // 86227840d75d974feb238f8b3c59c038b99c05cf. |
13 library http_parser.copy.io_sink; | |
14 | |
15 import 'dart:async'; | 13 import 'dart:async'; |
16 | 14 |
17 class StreamSinkImpl<T> implements StreamSink<T> { | 15 class StreamSinkImpl<T> implements StreamSink<T> { |
18 final StreamConsumer<T> _target; | 16 final StreamConsumer<T> _target; |
19 Completer _doneCompleter = new Completer(); | 17 Completer _doneCompleter = new Completer(); |
20 Future _doneFuture; | 18 Future _doneFuture; |
21 StreamController<T> _controllerInstance; | 19 StreamController<T> _controllerInstance; |
22 Completer _controllerCompleter; | 20 Completer _controllerCompleter; |
23 bool _isClosed = false; | 21 bool _isClosed = false; |
24 bool _isBound = false; | 22 bool _isBound = false; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // No new stream. No need to close target, as it have already | 136 // No new stream. No need to close target, as it have already |
139 // failed. | 137 // failed. |
140 _completeDoneError(error, stackTrace); | 138 _completeDoneError(error, stackTrace); |
141 } | 139 } |
142 }); | 140 }); |
143 } | 141 } |
144 return _controllerInstance; | 142 return _controllerInstance; |
145 } | 143 } |
146 } | 144 } |
147 | 145 |
OLD | NEW |