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

Unified Diff: sdk/lib/mdv_observe_impl/mdv_observe_impl.dart

Issue 16125005: Make new StreamController be async by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments Created 7 years, 7 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/isolate/isolate_stream.dart ('k') | sdk/lib/web_audio/dart2js/web_audio_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/mdv_observe_impl/mdv_observe_impl.dart
diff --git a/sdk/lib/mdv_observe_impl/mdv_observe_impl.dart b/sdk/lib/mdv_observe_impl/mdv_observe_impl.dart
index 577f0b8ce6d7c0e6baa1aea0fb82ce2868287456..e83a15d863726dccd4605405ce96f89630304a40 100644
--- a/sdk/lib/mdv_observe_impl/mdv_observe_impl.dart
+++ b/sdk/lib/mdv_observe_impl/mdv_observe_impl.dart
@@ -63,15 +63,15 @@ typedef ObservableBase = Object with ObservableMixin;
* call [notifyPropertyChange]. See that method for an example.
*/
abstract class ObservableMixin implements Observable {
- StreamController _multiplexController;
+ StreamController _broadcastController;
List<ChangeRecord> _changes;
Stream<List<ChangeRecord>> get changes {
- if (_multiplexController == null) {
- _multiplexController =
- new StreamController<List<ChangeRecord>>.broadcast();
+ if (_broadcastController == null) {
+ _broadcastController =
+ new StreamController<List<ChangeRecord>>.broadcast(sync: true);
}
- return _multiplexController.stream;
+ return _broadcastController.stream;
}
void _deliverChanges() {
@@ -79,7 +79,7 @@ abstract class ObservableMixin implements Observable {
_changes = null;
if (hasObservers && changes != null) {
// TODO(jmesserly): make "changes" immutable
- _multiplexController.add(changes);
+ _broadcastController.add(changes);
}
}
@@ -87,8 +87,8 @@ abstract class ObservableMixin implements Observable {
* True if this object has any observers, and should call
* [notifyPropertyChange] for changes.
*/
- bool get hasObservers => _multiplexController != null &&
- _multiplexController.hasListener;
+ bool get hasObservers => _broadcastController != null &&
+ _broadcastController.hasListener;
/**
* Notify that the field [name] of this object has been changed.
« no previous file with comments | « sdk/lib/isolate/isolate_stream.dart ('k') | sdk/lib/web_audio/dart2js/web_audio_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698