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

Side by Side Diff: sdk/lib/async/stream.dart

Issue 1696453002: Use internal const-constructor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/lib/async/stream_view_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.async; 5 part of dart.async;
6 6
7 // ------------------------------------------------------------------- 7 // -------------------------------------------------------------------
8 // Core Stream types 8 // Core Stream types
9 // ------------------------------------------------------------------- 9 // -------------------------------------------------------------------
10 10
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 1488
1489 /** Close the sink. No further events can be added after closing. */ 1489 /** Close the sink. No further events can be added after closing. */
1490 void close(); 1490 void close();
1491 } 1491 }
1492 1492
1493 1493
1494 /** [Stream] wrapper that only exposes the [Stream] interface. */ 1494 /** [Stream] wrapper that only exposes the [Stream] interface. */
1495 class StreamView<T> extends Stream<T> { 1495 class StreamView<T> extends Stream<T> {
1496 final Stream<T> _stream; 1496 final Stream<T> _stream;
1497 1497
1498 StreamView(this._stream); 1498 const StreamView(this._stream) : super._internal();
kevmoo 2016/02/11 21:19:56 Please update changelog, too
Lasse Reichstein Nielsen 2016/02/11 22:04:49 Consider making the public parameter name be "stre
floitsch 2016/02/12 19:29:16 Done.
floitsch 2016/02/12 19:29:16 Done.
1499 1499
1500 bool get isBroadcast => _stream.isBroadcast; 1500 bool get isBroadcast => _stream.isBroadcast;
1501 1501
1502 Stream<T> asBroadcastStream({void onListen(StreamSubscription subscription), 1502 Stream<T> asBroadcastStream({void onListen(StreamSubscription subscription),
1503 void onCancel(StreamSubscription subscription)}) 1503 void onCancel(StreamSubscription subscription)})
1504 => _stream.asBroadcastStream(onListen: onListen, onCancel: onCancel); 1504 => _stream.asBroadcastStream(onListen: onListen, onCancel: onCancel);
1505 1505
1506 StreamSubscription<T> listen(void onData(T value), 1506 StreamSubscription<T> listen(void onData(T value),
1507 { Function onError, 1507 { Function onError,
1508 void onDone(), 1508 void onDone(),
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 class _ControllerEventSinkWrapper<T> implements EventSink<T> { 1800 class _ControllerEventSinkWrapper<T> implements EventSink<T> {
1801 EventSink _sink; 1801 EventSink _sink;
1802 _ControllerEventSinkWrapper(this._sink); 1802 _ControllerEventSinkWrapper(this._sink);
1803 1803
1804 void add(T data) { _sink.add(data); } 1804 void add(T data) { _sink.add(data); }
1805 void addError(error, [StackTrace stackTrace]) { 1805 void addError(error, [StackTrace stackTrace]) {
1806 _sink.addError(error, stackTrace); 1806 _sink.addError(error, stackTrace);
1807 } 1807 }
1808 void close() { _sink.close(); } 1808 void close() { _sink.close(); }
1809 } 1809 }
OLDNEW
« no previous file with comments | « no previous file | tests/lib/async/stream_view_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698