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

Unified Diff: sky/sdk/lib/framework/rendering/object.dart

Issue 1144933007: Assert that you can't mutate the tree during paint or layout. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 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/sdk/lib/framework/rendering/object.dart
diff --git a/sky/sdk/lib/framework/rendering/object.dart b/sky/sdk/lib/framework/rendering/object.dart
index 69a1b8286fe167269b7c21909c635473ddcd00d0..736d67771c26f263b17d5df476f26d7d52a8778d 100644
--- a/sky/sdk/lib/framework/rendering/object.dart
+++ b/sky/sdk/lib/framework/rendering/object.dart
@@ -46,18 +46,24 @@ abstract class RenderObject extends AbstractNode {
ParentData parentData;
void setParentData(RenderObject child) {
// override this to setup .parentData correctly for your class
+ assert(!_debugDoingLayout);
+ assert(!debugDoingPaint);
if (child.parentData is! ParentData)
child.parentData = new ParentData();
}
void adoptChild(RenderObject child) { // only for use by subclasses
// call this whenever you decide a node is a child
+ assert(!_debugDoingLayout);
+ assert(!debugDoingPaint);
assert(child != null);
setParentData(child);
super.adoptChild(child);
markNeedsLayout();
}
void dropChild(RenderObject child) { // only for use by subclasses
+ assert(!_debugDoingLayout);
+ assert(!debugDoingPaint);
assert(child != null);
assert(child.parentData != null);
child.parentData.detach();
« 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