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

Side by Side Diff: pkg/observe/lib/src/dirty_check.dart

Issue 27618002: package:observe fix various api issues (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « pkg/observe/lib/src/compound_binding.dart ('k') | pkg/observe/lib/src/list_path_observer.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 /** 5 /**
6 * *Warning*: this library is **internal**, and APIs are subject to change. 6 * *Warning*: this library is **internal**, and APIs are subject to change.
7 * 7 *
8 * Tracks observable objects for dirty checking and testing purposes. 8 * Tracks observable objects for dirty checking and testing purposes.
9 * 9 *
10 * It can collect all observed objects, which can be used to trigger predictable 10 * It can collect all observed objects, which can be used to trigger predictable
(...skipping 17 matching lines...) Expand all
28 void registerObservable(Observable obj) { 28 void registerObservable(Observable obj) {
29 if (_allObservables == null) _allObservables = <Observable>[]; 29 if (_allObservables == null) _allObservables = <Observable>[];
30 _allObservables.add(obj); 30 _allObservables.add(obj);
31 _allObservablesCount++; 31 _allObservablesCount++;
32 } 32 }
33 33
34 /** 34 /**
35 * Synchronously deliver all change records for known observables. 35 * Synchronously deliver all change records for known observables.
36 * 36 *
37 * This will execute [Observable.deliverChanges] on objects that inherit from 37 * This will execute [Observable.deliverChanges] on objects that inherit from
38 * [ObservableMixin]. 38 * [Observable].
39 */ 39 */
40 // Note: this is called performMicrotaskCheckpoint in change_summary.js. 40 // Note: this is called performMicrotaskCheckpoint in change_summary.js.
41 void dirtyCheckObservables() { 41 void dirtyCheckObservables() {
42 if (_delivering) return; 42 if (_delivering) return;
43 if (_allObservables == null) return; 43 if (_allObservables == null) return;
44 44
45 _delivering = true; 45 _delivering = true;
46 46
47 int cycles = 0; 47 int cycles = 0;
48 bool anyChanged = false; 48 bool anyChanged = false;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 const MAX_DIRTY_CHECK_CYCLES = 1000; 85 const MAX_DIRTY_CHECK_CYCLES = 1000;
86 86
87 87
88 /** 88 /**
89 * Log for messages produced at runtime by this library. Logging can be 89 * Log for messages produced at runtime by this library. Logging can be
90 * configured by accessing Logger.root from the logging library. 90 * configured by accessing Logger.root from the logging library.
91 */ 91 */
92 final Logger _logger = new Logger('Observable.dirtyCheck'); 92 final Logger _logger = new Logger('Observable.dirtyCheck');
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/compound_binding.dart ('k') | pkg/observe/lib/src/list_path_observer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698