-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Inspector robustness fixes. #14154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inspector robustness fixes. #14154
Conversation
Avoid cases where setState was called on disposed object. Avoid cases where the inspector wouldn't render as it was called after the first frame rendered and no other frames were rendered.
| bool get _reportFirstFrame => _deferFirstFrameReportCount == 0; | ||
|
|
||
| /// Whether the first frame has finished rendering. | ||
| bool get debugDidSendFirstFrameEvent => !_needToReportFirstFrame; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These docs should mention:
- that this is only valid in debug and profile builds, it can't be used in release builds
- that it can be deferred using [deferFirstFrameReport] and [allowFirstFrameReport]
- that it is set at the end of the call to drawFrame
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| /// appropriate to display the Widget tree in the inspector. | ||
| bool isWidgetTreeReady([String groupName]) { | ||
| return WidgetsBinding.instance != null && | ||
| WidgetsBinding.instance.debugDidSendFirstFrameEvent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: vertical alignment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } else { | ||
| // It isn't safe to trigger the selection change callback if we are in | ||
| // the middle of rendering the frame. | ||
| WidgetsBinding.instance.scheduleTask( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better to use SchedulerBinding here (the result is the same but it's more idiomatic)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| /// as selecting the edge of the bounding box. | ||
| static const double _kEdgeHitMargin = 2.0; | ||
|
|
||
| InspectorSelectionChangedCallback selectionChangedCallback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not a (private) method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be private. done.
jacob314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ptal
|
Its on my list to create some good inspector integration tests that can verify these sorts of cases as well as verifying that widget creation locations are right once that CL lands. |
* Inspector robustness fixes. Avoid cases where setState was called on disposed object. Avoid cases where the inspector wouldn't render as it was called after the first frame rendered and no other frames were rendered.
…utter/engine#14154) (#46220) git@github.com:flutter/engine.git/compare/fd240d0d532a...ed2d00b git log fd240d0..ed2d00b --first-parent --oneline 2019-12-06 skia-flutter-autoroll@skia.org Roll fuchsia/sdk/core/mac-amd64 from qQlb5... to VKso5... (#14154) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC chinmaygarde@google.com on the revert to ensure that a human is aware of the problem. To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Avoid cases where setState was called on disposed object.
Avoid cases where the inspector wouldn't render as it was called
after the first frame rendered and no other frames were rendered.