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

Unified Diff: sdk/lib/async/collection_sink.dart

Issue 12610006: Renamed StreamSink to EventSink. Renamed signalError to addError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed inheritance back! Now create StreamSink instead of EventSink where we create them. Created 7 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
Index: sdk/lib/async/collection_sink.dart
diff --git a/sdk/lib/async/collection_sink.dart b/sdk/lib/async/collection_sink.dart
index a023fd1d0bbae6abd9fdfd7096c74ed830530511..ad3dda5b7dedd4ee9e95b808459ee748b92ea1d7 100644
--- a/sdk/lib/async/collection_sink.dart
+++ b/sdk/lib/async/collection_sink.dart
@@ -7,8 +7,9 @@ part of dart.async;
typedef void _CollectionSinkCallback<T>(Collection<T> collection);
typedef void _CollectionSinkErrorCallback(AsyncError error);
-/** StreamSink that stores incoming data in a collection. */
-class CollectionSink<T> implements StreamSink<T> {
+/** EventSink that stores incoming data in a collection. */
+class CollectionSink<T> extends StreamSink<T> {
+ // TODO(8997): Implement EventSink instead.
final Collection<T> collection;
final _CollectionSinkCallback<T> _callback;
final _CollectionSinkErrorCallback _errorCallback;
@@ -33,8 +34,8 @@ class CollectionSink<T> implements StreamSink<T> {
collection.add(value);
}
- void signalError(AsyncError error) {
- if (_isClosed) throw new StateError("Singalling error on closed sink");
+ void addError(AsyncError error) {
+ if (_isClosed) throw new StateError("Adding error to closed sink");
if (_errorCallback != null) _errorCallback(error);
}

Powered by Google App Engine
This is Rietveld 408576698