The UIDartState is now always owned by the isolate and always freed in
the isolate cleanup callback.
In the isolate shutdown callback, if the isolate being shut down is the
main isolate, the RuntimeController is informed which in turn notifies
the RuntimeHolder and thus the ApplicationControllerImpl. The
ApplicationControllerImpl tears down the whole Flutter application.
This fixes Fuchsia bug: MI4-328
* Read core platform kernel file during Dart initialization.
Currently service isolate is initialized from the source code parsed by VM.
This CL changes it so service isolate created during Dart initialization
is created from the kernel platform.dill file if it is present in the application
bundle. Then this platform kernel file is kept in dart_init module and reused
for application sciprt isolates.
* Reformat and merge
* Use accessor method
* Avoid passing running_from_kernel param. Add TODO for cleanup. Rename param.
* Fix for issue 12526
Ensure that child isolates do not clear the dart_ui_state_ field present in the dart controller.
The commit 093a8a4dfd implemented code to reset the dart_ui_state_ back to null when an isolate was being shutdown to ensure there was no use after free issues when the main isolate exeutes Isolate.current.kill() it however it was also clearning the field when a child isolate was shutdown causing SEGVs later.
* Address code format issues.
If an isolate shuts down (for example if an app calls
Isolate.current.kill()), the UIDartState* on DartController will refer
to a freed object. This wires through notification that the is shutting
down through to the DartController so it can clean up appropriately.
This also makes gives the vm-service isolate an UIDartState* so that
the shutdown callback can behave correctly.
If an isolate shuts down (for example if an app calls
Isolate.current.kill()), the UIDartState* on DartController will refer
to a freed object. This wires through notification that the is shutting
down through to the DartController so it can clean up appropriately.
- Assumes only the Dart VM is interested in idle notification.
- Gives the VM the time remaining in each frame.
- Gives the VM 100ms if there is no pending frame.
Issue flutter/flutter#9594
* Fix Flutter loading from dill files.
* Remove disable of causal async stacks.
* Include mirrors patch files as they are needed for release/profile gen_snapshot
* Free the bytes
* Add FTL_DCHECK
After this patch, platform messages now take the same path through the system
that semantics data does (on Android). Support on iOS will be in another patch.
This patch prepares us to switch sending semantics information over mojom to
using dart:ui directly. Currently the recorded information is dropped on the
floor, but that will improve in future patches.
Rather than using mojom to encode pointer data, we now encode and decode it
manually. A future patch will remove the mojom codepath once the framework is
updated.
Also, rename SkyViewClient to RuntimeDelegate. These names are more
sensible.
This patch also cleans up the RuntimeDelegate a bit, for example by
removing support for flushing real-time events, which aren't used.