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

Unified Diff: sdk/lib/io/http_parser.dart

Issue 14028017: Remove .writeStream, .consume and rewrite IOSink to correctly implement a (sane) well-defined behav… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review comments. Created 7 years, 8 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 | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/io_sink.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_parser.dart
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index dd55494c7010d4af1b56b99533e8d90df0c5b4db..9a2f6b9bfdc0ed40b0ef93a7e71c6d95cd7b61bd 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -225,7 +225,7 @@ class _HttpParser
unsubscribeOnError: unsubscribeOnError);
}
- Future<_HttpParser> consume(Stream<List<int>> stream) {
+ Future<_HttpParser> addStream(Stream<List<int>> stream) {
// Listen to the stream and handle data accordingly. When a
// _HttpIncoming is created, _dataPause, _dataResume, _dataDone is
// given to provide a way of controlling the parser.
@@ -236,18 +236,14 @@ class _HttpParser
_onData,
onError: _onError,
onDone: () {
- _onDone();
completer.complete(this);
});
return completer.future;
}
- Future<_HttpParser> addStream(Stream<List<int>> stream) {
- throw new UnimplementedError("_HttpParser.addStream");
- }
-
Future<_HttpParser> close() {
- throw new UnimplementedError("_HttpParser.close");
+ _onDone();
+ return new Future.immediate(this);
}
// From RFC 2616.
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/io_sink.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698