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

Unified Diff: sky/framework/fn.dart

Issue 1028473003: [Effen] Slightly cleaner enforcement of App lifetime signals (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/fn.dart
diff --git a/sky/framework/fn.dart b/sky/framework/fn.dart
index 80e7d1ab2bd044396e76b6fb5b31d7e1a46a8cda..616b2459d6289c8c2b86a0aeafaf5ddf99e9c48a 100644
--- a/sky/framework/fn.dart
+++ b/sky/framework/fn.dart
@@ -647,6 +647,9 @@ abstract class Component extends Node {
bool get _isBuilding => _currentlyBuilding == this;
bool _dirty = true;
+ sky.Node get _host => _root.parentNode;
+ sky.Node get _insertionPoint => _root == null ? _root : _root.nextSibling;
+
Node _built;
final int _order;
static int _currentOrder = 0;
@@ -735,8 +738,8 @@ abstract class Component extends Node {
if (!_dirty || _defunct)
return;
- assert(_root != null);
- _sync(null, _root.parentNode, _root.nextSibling);
+ assert(_host != null);
+ _sync(null, _host, _insertionPoint);
}
void scheduleBuild() {
@@ -757,21 +760,11 @@ abstract class Component extends Node {
}
abstract class App extends Component {
- sky.Node _host = null;
+ sky.Node _host;
+
App() : super(stateful: true) {
_host = sky.document.createElement('div');
sky.document.appendChild(_host);
-
- new Future.microtask(() {
- Stopwatch sw = new Stopwatch()..start();
-
- _sync(null, _host, null);
- assert(_root is sky.Node);
- _notifyMountStatusChanged();
-
- sw.stop();
- if (_shouldLogRenderDuration)
- print("Initial build: ${sw.elapsedMicroseconds} microseconds");
- });
+ _scheduleComponentForRender(this);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698