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

Unified Diff: pkg/analysis_server/lib/src/channel.dart

Issue 203603008: Introduce class Sink<T>. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 9 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 | « no previous file | sdk/lib/async/stream.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/channel.dart
diff --git a/pkg/analysis_server/lib/src/channel.dart b/pkg/analysis_server/lib/src/channel.dart
index 85203b0bdab74a0c8dcca61d6d644c892d57344b..7fcaa12c0e571b7aaf6da40bfd0fee1c8753eb29 100644
--- a/pkg/analysis_server/lib/src/channel.dart
+++ b/pkg/analysis_server/lib/src/channel.dart
@@ -178,7 +178,7 @@ class _JsonStreamDecoder extends Converter<String, Map> {
Map convert(String text) => JSON.decode(text);
@override
- ChunkedConversionSink startChunkedConversion(ChunkedConversionSink sink) =>
+ ChunkedConversionSink startChunkedConversion(Sink sink) =>
new _ChannelChunkSink<String, Map>(this, sink);
}
@@ -191,7 +191,7 @@ class _ResponseConverter extends Converter<Map, Response> {
Response convert(Map json) => new Response.fromJson(json);
@override
- ChunkedConversionSink startChunkedConversion(ChunkedConversionSink sink) =>
+ ChunkedConversionSink startChunkedConversion(Sink sink) =>
new _ChannelChunkSink<Map, Response>(this, sink);
}
@@ -204,27 +204,27 @@ class _NotificationConverter extends Converter<Map, Notification> {
Notification convert(Map json) => new Notification.fromJson(json);
@override
- ChunkedConversionSink startChunkedConversion(ChunkedConversionSink sink) =>
+ ChunkedConversionSink startChunkedConversion(Sink sink) =>
new _ChannelChunkSink<Map, Notification>(this, sink);
}
/**
- * A [_ChannelChunkSink] uses a [Convter] to translate chunks.
+ * A [_ChannelChunkSink] uses a [Converter] to translate chunks.
*/
class _ChannelChunkSink<S, T> extends ChunkedConversionSink<S> {
final Converter<S, T> _converter;
- final ChunkedConversionSink _chunkedSink;
+ final Sink _sink;
- _ChannelChunkSink(this._converter, this._chunkedSink);
+ _ChannelChunkSink(this._converter, this._sink);
@override
void add(S chunk) {
var convertedChunk = _converter.convert(chunk);
if (convertedChunk != null) {
- _chunkedSink.add(convertedChunk);
+ _sink.add(convertedChunk);
}
}
@override
- void close() => _chunkedSink.close();
+ void close() => _sink.close();
}
« no previous file with comments | « no previous file | sdk/lib/async/stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698