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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 14200026: Fix bad html library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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:
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 32ec0ea00dfa8d9b7ab7319a734a2274da1c3d2d..c845b333dcfb9b57fac592062886fac3f4f61242 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -17356,7 +17356,7 @@ class Node extends EventTarget native "*Node" {
@Creates('Null')
var _model;
bool _hasLocalModel;
- StreamController<Node> _modelChangedStream;
+ Set<StreamController<Node>> _modelChangedStreams;
/**
* The data model which is inherited through the tree.
@@ -17373,7 +17373,7 @@ class Node extends EventTarget native "*Node" {
@Experimental
get model {
// If we have a change handler then we've cached the model locally.
- if (_modelChangedStream != null) {
+ if (!_modelChangedStreams.isEmpty) {
return _model;
}
// Otherwise start looking up the tree.
@@ -17393,8 +17393,8 @@ class Node extends EventTarget native "*Node" {
_ModelTreeObserver.initialize();
if (changed) {
- if (_modelChangedStream != null) {
- _modelChangedStream.add(this);
+ if (!_modelChangedStreams.isEmpty) {
+ _modelChangedStreams.toList().forEach((stream) => stream.add(this));
}
// Propagate new model to all descendants.
_ModelTreeObserver.propagateModel(this, value, false);
@@ -17423,12 +17423,11 @@ class Node extends EventTarget native "*Node" {
* Get a stream of models, whenever the model changes.
*/
Stream<Node> get onModelChanged {
- if (_modelChangedStream == null) {
- // Ensure the model is cached locally to minimize change notifications.
- _model = model;
- _modelChangedStream = new StreamController();
- }
- return _modelChangedStream.stream;
+ var result;
+ result = new StreamController(
+ onListen: () { _modelChangedStreams.add(result); },
+ onCancel: () { _modelChangedStreams.remove(result); });
+ return result;
}
/**
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698