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

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 16007003: Optimize internals of multiplex-streams. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/async/stream_controller.dart ('k') | sdk/lib/html/dartium/html_dartium.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 /// The Dart HTML library. 1 /// The Dart HTML library.
2 library dart.dom.html; 2 library dart.dom.html;
3 3
4 import 'dart:async'; 4 import 'dart:async';
5 import 'dart:collection'; 5 import 'dart:collection';
6 import 'dart:_collection-dev' hide Symbol; 6 import 'dart:_collection-dev' hide Symbol;
7 import 'dart:html_common'; 7 import 'dart:html_common';
8 import 'dart:indexed_db'; 8 import 'dart:indexed_db';
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 import 'dart:json' as json; 10 import 'dart:json' as json;
(...skipping 26807 matching lines...) Expand 10 before | Expand all | Expand 10 after
26818 * Observes [path] on [object] for changes. This returns an object that can be 26818 * Observes [path] on [object] for changes. This returns an object that can be
26819 * used to get the changes and get/set the value at this path. 26819 * used to get the changes and get/set the value at this path.
26820 * See [PathObserver.values] and [PathObserver.value]. 26820 * See [PathObserver.values] and [PathObserver.value].
26821 */ 26821 */
26822 PathObserver(this.object, String path) 26822 PathObserver(this.object, String path)
26823 : path = path, _isValid = _isPathValid(path) { 26823 : path = path, _isValid = _isPathValid(path) {
26824 26824
26825 // TODO(jmesserly): if the path is empty, or the object is! Observable, we 26825 // TODO(jmesserly): if the path is empty, or the object is! Observable, we
26826 // can optimize the PathObserver to be more lightweight. 26826 // can optimize the PathObserver to be more lightweight.
26827 26827
26828 _values = new StreamController.multiplex(onListen: _observe, 26828 _values = new StreamController.broadcast(onListen: _observe,
26829 onCancel: _unobserve); 26829 onCancel: _unobserve);
26830 26830
26831 if (_isValid) { 26831 if (_isValid) {
26832 var segments = []; 26832 var segments = [];
26833 for (var segment in path.trim().split('.')) { 26833 for (var segment in path.trim().split('.')) {
26834 if (segment == '') continue; 26834 if (segment == '') continue;
26835 var index = int.parse(segment, onError: (_) {}); 26835 var index = int.parse(segment, onError: (_) {});
26836 segments.add(index != null ? index : new Symbol(segment)); 26836 segments.add(index != null ? index : new Symbol(segment));
26837 } 26837 }
26838 26838
(...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after
29274 _position = nextPosition; 29274 _position = nextPosition;
29275 return true; 29275 return true;
29276 } 29276 }
29277 _current = null; 29277 _current = null;
29278 _position = _array.length; 29278 _position = _array.length;
29279 return false; 29279 return false;
29280 } 29280 }
29281 29281
29282 T get current => _current; 29282 T get current => _current;
29283 } 29283 }
OLDNEW
« no previous file with comments | « sdk/lib/async/stream_controller.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698