Configure FfiNative resolver on dart:io (#176621)

This is needed by file watching implementation after
dart-lang/sdk@ed6bab847b

Ideally we should actually move this whole code into `io_natives.{h,cc}`
on the Dart runtime side to avoid duplication.
This commit is contained in:
Slava Egorov 2025-10-08 17:42:39 +02:00 committed by GitHub
parent 44c77df80a
commit e11e2c1128
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,10 +17,13 @@ namespace flutter {
void DartIO::InitForIsolate(bool may_insecurely_connect_to_all_domains,
const std::string& domain_network_policy) {
// TODO(https://dartbug.com/61694): move this code into dart_io_api.h
Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io"));
Dart_Handle result = Dart_SetNativeResolver(io_lib, dart::bin::LookupIONative,
dart::bin::LookupIONativeSymbol);
FML_CHECK(!CheckAndHandleError(result));
result = Dart_SetFfiNativeResolver(io_lib, dart::bin::LookupIOFfiNative);
FML_CHECK(!CheckAndHandleError(result));
Dart_Handle ui_lib = Dart_LookupLibrary(ToDart("dart:ui"));
Dart_Handle dart_validate_args[1];