9a6503b500
Extends the `NativeAssetsApi` with a `dlopen` that takes an asset id instead of an asset path. This enables the embedder (instead of the vm) to resolve the asset id to asset path. Additionally, the `NativeAssetsApi` gets an `available_assets` callback to report which asset ids are available if asset resolution failed. (Otherwise, users would lose this important part of the error message on failed resolution.) We postpone migrating the Dart standalone embedder to this API: https://dart-review.googlesource.com/c/sdk/+/388160. That CL verifies this new API and it's implementation. Without that CL this new API is hard to test. So, no further tests are added here. Tests that verify the old behavior for the standalone embedder: TEST=tests/ffi/native_assets/* TEST=pkg/dartdev/test/native_assets/* Bug: https://github.com/flutter/flutter/issues/154425 Change-Id: I04d0fb45dc5663e63d91b21a6f5764929f10aaff Cq-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try,vm-aot-asan-linux-release-x64-try,vm-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388161 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>