Commit 2b0705a3 authored by Kris Giesing's avatar Kris Giesing

Rename debugOwner to debugCreator

Fixes #2940
parent 07f60e67
...@@ -22,7 +22,7 @@ bool debugCheckHasMaterial(BuildContext context) { ...@@ -22,7 +22,7 @@ bool debugCheckHasMaterial(BuildContext context) {
'The specific widget that could not find a Material ancestor was:\n' 'The specific widget that could not find a Material ancestor was:\n'
' ${context.widget}' ' ${context.widget}'
'The ownership chain for the affected widget is:\n' 'The ownership chain for the affected widget is:\n'
' ${element.debugGetOwnershipChain(10)}' ' ${element.debugGetCreatorChain(10)}'
); );
} }
return true; return true;
...@@ -41,7 +41,7 @@ bool debugCheckHasScaffold(BuildContext context) { ...@@ -41,7 +41,7 @@ bool debugCheckHasScaffold(BuildContext context) {
'The specific widget that could not find a Scaffold ancestor was:\n' 'The specific widget that could not find a Scaffold ancestor was:\n'
' ${context.widget}' ' ${context.widget}'
'The ownership chain for the affected widget is:\n' 'The ownership chain for the affected widget is:\n'
' ${element.debugGetOwnershipChain(10)}' ' ${element.debugGetCreatorChain(10)}'
); );
} }
return true; return true;
......
...@@ -73,7 +73,7 @@ abstract class Layer { ...@@ -73,7 +73,7 @@ abstract class Layer {
@override @override
String toString() => '$runtimeType'; String toString() => '$runtimeType';
dynamic debugOwner; dynamic debugCreator;
String toStringDeep([String prefixLineOne = '', String prefixOtherLines = '']) { String toStringDeep([String prefixLineOne = '', String prefixOtherLines = '']) {
String result = '$prefixLineOne$this\n'; String result = '$prefixLineOne$this\n';
...@@ -89,8 +89,8 @@ abstract class Layer { ...@@ -89,8 +89,8 @@ abstract class Layer {
} }
void debugFillDescription(List<String> description) { void debugFillDescription(List<String> description) {
if (debugOwner != null) if (debugCreator != null)
description.add('owner: $debugOwner'); description.add('creator: $debugCreator');
} }
String debugDescribeChildren(String prefix) => ''; String debugDescribeChildren(String prefix) => '';
......
...@@ -73,7 +73,7 @@ class PaintingContext { ...@@ -73,7 +73,7 @@ class PaintingContext {
child._layer ??= new OffsetLayer(); child._layer ??= new OffsetLayer();
child._layer.removeAllChildren(); child._layer.removeAllChildren();
assert(() { assert(() {
child._layer.debugOwner = child.debugOwner ?? child.runtimeType; child._layer.debugCreator = child.debugCreator ?? child.runtimeType;
return true; return true;
}); });
PaintingContext childContext = new PaintingContext._(child._layer, child.paintBounds); PaintingContext childContext = new PaintingContext._(child._layer, child.paintBounds);
...@@ -111,7 +111,7 @@ class PaintingContext { ...@@ -111,7 +111,7 @@ class PaintingContext {
}); });
child._layer.detach(); child._layer.detach();
assert(() { assert(() {
child._layer.debugOwner = child.debugOwner ?? child.runtimeType; child._layer.debugCreator = child.debugCreator ?? child.runtimeType;
return true; return true;
}); });
} }
...@@ -871,7 +871,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { ...@@ -871,7 +871,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// Override in subclasses with children and call the visitor for each child /// Override in subclasses with children and call the visitor for each child
void visitChildren(RenderObjectVisitor visitor) { } void visitChildren(RenderObjectVisitor visitor) { }
dynamic debugOwner; dynamic debugCreator;
static int _debugPrintedExceptionCount = 0; static int _debugPrintedExceptionCount = 0;
void _debugReportException(String method, dynamic exception, StackTrace stack) { void _debugReportException(String method, dynamic exception, StackTrace stack) {
try { try {
...@@ -884,8 +884,8 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { ...@@ -884,8 +884,8 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
debugPrint('The following exception was raised during $method():'); debugPrint('The following exception was raised during $method():');
debugPrint('$exception'); debugPrint('$exception');
debugPrint('The following RenderObject was being processed when the exception was fired:\n${this}'); debugPrint('The following RenderObject was being processed when the exception was fired:\n${this}');
if (debugOwner != null) if (debugCreator != null)
debugPrint('This RenderObject had the following owner:\n$debugOwner'); debugPrint('This RenderObject had the following creator:\n$debugCreator');
int depth = 0; int depth = 0;
List<String> descendants = <String>[]; List<String> descendants = <String>[];
const int maxDepth = 5; const int maxDepth = 5;
...@@ -1803,8 +1803,8 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget { ...@@ -1803,8 +1803,8 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
/// per string. Subclasses should override this to have their information /// per string. Subclasses should override this to have their information
/// included in toStringDeep(). /// included in toStringDeep().
void debugFillDescription(List<String> description) { void debugFillDescription(List<String> description) {
if (debugOwner != null) if (debugCreator != null)
description.add('owner: $debugOwner'); description.add('creator: $debugCreator');
description.add('parentData: $parentData'); description.add('parentData: $parentData');
description.add('constraints: $constraints'); description.add('constraints: $constraints');
} }
......
...@@ -1029,7 +1029,7 @@ abstract class Element implements BuildContext { ...@@ -1029,7 +1029,7 @@ abstract class Element implements BuildContext {
assert(false); assert(false);
} }
String debugGetOwnershipChain(int limit) { String debugGetCreatorChain(int limit) {
List<String> chain = <String>[]; List<String> chain = <String>[];
Element node = this; Element node = this;
while (chain.length < limit && node != null) { while (chain.length < limit && node != null) {
...@@ -1512,7 +1512,7 @@ class ParentDataElement<T extends RenderObjectWidget> extends _ProxyElement { ...@@ -1512,7 +1512,7 @@ class ParentDataElement<T extends RenderObjectWidget> extends _ProxyElement {
'Incorrect use of ParentDataWidget.\n' + 'Incorrect use of ParentDataWidget.\n' +
widget.debugDescribeInvalidAncestorChain( widget.debugDescribeInvalidAncestorChain(
description: "$this", description: "$this",
ownershipChain: parent.debugGetOwnershipChain(10), ownershipChain: parent.debugGetCreatorChain(10),
foundValidAncestor: ancestor != null, foundValidAncestor: ancestor != null,
badAncestors: badAncestors badAncestors: badAncestors
) )
...@@ -1634,7 +1634,7 @@ abstract class RenderObjectElement extends BuildableElement { ...@@ -1634,7 +1634,7 @@ abstract class RenderObjectElement extends BuildableElement {
} }
void debugUpdateRenderObjectOwner() { void debugUpdateRenderObjectOwner() {
_renderObject.debugOwner = debugGetOwnershipChain(10); _renderObject.debugCreator = debugGetCreatorChain(10);
} }
@override @override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment