diff --git a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/BUILD.gn index 2ff857aaf08..1ee3396a7c6 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/BUILD.gn @@ -19,12 +19,13 @@ source_set("sdk_ext") { ] deps = [ - "$fuchsia_sdk_root/fidl:fuchsia.sys", "$fuchsia_sdk_root/pkg:async-cpp", "../zircon", "//flutter/fml", "//flutter/third_party/tonic", ] + public_deps = [ "$fuchsia_sdk_root/pkg:zx" ] + public_configs = [ ":sdk_ext_config" ] } diff --git a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.cc b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.cc index 2c80baa4be3..25f0d96127c 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.cc @@ -100,8 +100,7 @@ void SetReturnCode(Dart_NativeArguments arguments) { } // namespace -void Initialize(fidl::InterfaceHandle environment, - zx::channel directory_request, +void Initialize(zx::channel directory_request, std::optional view_ref) { zircon::dart::Initialize(); @@ -117,14 +116,6 @@ void Initialize(fidl::InterfaceHandle environment, dart_state->class_library().add_provider("fuchsia", std::move(fuchsia_class_provider)); - // V2 components do not use the environment. - if (environment) { - result = Dart_SetField( - library, ToDart("_environment"), - ToDart(zircon::dart::Handle::Create(environment.TakeChannel()))); - FML_CHECK(!tonic::CheckAndHandleError(result)); - } - if (directory_request) { result = Dart_SetField( library, ToDart("_outgoingServices"), diff --git a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.h b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.h index acdb38fe21b..457528d9931 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.h +++ b/engine/src/flutter/shell/platform/fuchsia/dart-pkg/fuchsia/sdk_ext/fuchsia.h @@ -5,14 +5,16 @@ #ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_PKG_FUCHSIA_SDK_EXT_FUCHSIA_H_ #define FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_PKG_FUCHSIA_SDK_EXT_FUCHSIA_H_ -#include +#include +#include + +#include namespace fuchsia { namespace dart { /// Initializes Dart bindings for the Fuchsia application model. -void Initialize(fidl::InterfaceHandle environment, - zx::channel directory_request, +void Initialize(zx::channel directory_request, std::optional view_ref); } // namespace dart diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/builtin_libraries.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/builtin_libraries.cc index 9fd6a9b2034..9207d4c2a33 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/builtin_libraries.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/builtin_libraries.cc @@ -96,19 +96,16 @@ void ScheduleMicrotask(Dart_NativeArguments args) { } // namespace -void InitBuiltinLibrariesForIsolate( - const std::string& script_uri, - fdio_ns_t* namespc, - int stdoutfd, - int stderrfd, - fidl::InterfaceHandle environment, - zx::channel directory_request, - bool service_isolate) { +void InitBuiltinLibrariesForIsolate(const std::string& script_uri, + fdio_ns_t* namespc, + int stdoutfd, + int stderrfd, + zx::channel directory_request, + bool service_isolate) { // dart:fuchsia -------------------------------------------------------------- // dart runner doesn't care about scenic view ref. if (!service_isolate) { - fuchsia::dart::Initialize(std::move(environment), - std::move(directory_request), std::nullopt); + fuchsia::dart::Initialize(std::move(directory_request), std::nullopt); } // dart:fuchsia.builtin ------------------------------------------------------ diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/builtin_libraries.h b/engine/src/flutter/shell/platform/fuchsia/dart_runner/builtin_libraries.h index a23403c1a4b..b44dc0166c5 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/builtin_libraries.h +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/builtin_libraries.h @@ -5,22 +5,20 @@ #ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_BUILTIN_LIBRARIES_H_ #define FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_BUILTIN_LIBRARIES_H_ -#include #include +#include #include #include namespace dart_runner { -void InitBuiltinLibrariesForIsolate( - const std::string& script_uri, - fdio_ns_t* namespc, - int stdoutfd, - int stderrfd, - fidl::InterfaceHandle environment, - zx::channel directory_request, - bool service_isolate); +void InitBuiltinLibrariesForIsolate(const std::string& script_uri, + fdio_ns_t* namespc, + int stdoutfd, + int stderrfd, + zx::channel directory_request, + bool service_isolate); } // namespace dart_runner diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller.cc index 80be8c924e7..11c0822e686 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller.cc @@ -466,9 +466,9 @@ bool DartComponentController::RunDartMain() { stdout_fd_ = fileno(stdout); stderr_fd_ = fileno(stderr); - InitBuiltinLibrariesForIsolate( - url_, namespace_, stdout_fd_, stderr_fd_, nullptr /* environment */, - dart_outgoing_dir_request_.TakeChannel(), false /* service_isolate */); + InitBuiltinLibrariesForIsolate(url_, namespace_, stdout_fd_, stderr_fd_, + dart_outgoing_dir_request_.TakeChannel(), + false /* service_isolate */); Dart_ExitScope(); Dart_ExitIsolate(); diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller.h b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller.h index 252962caaaf..fdc24407921 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller.h +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_component_controller.h @@ -7,7 +7,6 @@ #include #include -#include #include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_runner.h b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_runner.h index 8df540b3f01..84da1a8b5be 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_runner.h +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_runner.h @@ -6,7 +6,6 @@ #define FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_DART_RUNNER_H_ #include -#include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller.cc index 848a3f48ab2..b9ce55676c4 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller.cc @@ -523,9 +523,9 @@ fpromise::promise<> DartTestComponentController::RunDartMain() { fidl::InterfaceRequest outgoing_dir = std::move(*start_info_.mutable_outgoing_dir()); - InitBuiltinLibrariesForIsolate( - url_, namespace_, stdout_fd_, stderr_fd_, nullptr /* environment */, - outgoing_dir.TakeChannel(), false /* service_isolate */); + InitBuiltinLibrariesForIsolate(url_, namespace_, stdout_fd_, stderr_fd_, + outgoing_dir.TakeChannel(), + false /* service_isolate */); Dart_ExitScope(); Dart_ExitIsolate(); diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller.h b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller.h index 2d39e73c623..81655653342 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller.h +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/dart_test_component_controller.h @@ -8,7 +8,6 @@ #include #include -#include #include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/service_isolate.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/service_isolate.cc index d331e96f44a..ea59ccec8fc 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/service_isolate.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/service_isolate.cc @@ -193,7 +193,7 @@ Dart_Isolate CreateServiceIsolate( SHUTDOWN_ON_ERROR(result); InitBuiltinLibrariesForIsolate(std::string(uri), nullptr, fileno(stdout), - fileno(stderr), nullptr, zx::channel(), true); + fileno(stderr), zx::channel(), true); // Make runnable. Dart_ExitScope(); diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn index 5018005b5a9..8e952c82a1b 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn @@ -155,7 +155,6 @@ template("runner_sources") { "$fuchsia_sdk_root/fidl:fuchsia.io", "$fuchsia_sdk_root/fidl:fuchsia.media", "$fuchsia_sdk_root/fidl:fuchsia.memorypressure", - "$fuchsia_sdk_root/fidl:fuchsia.sys", "$fuchsia_sdk_root/fidl:fuchsia.ui.app", "$fuchsia_sdk_root/fidl:fuchsia.ui.composition", "$fuchsia_sdk_root/fidl:fuchsia.ui.pointer", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/accessibility_bridge.h b/engine/src/flutter/shell/platform/fuchsia/flutter/accessibility_bridge.h index 8e3487c0ad4..bf9ec8d4483 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/accessibility_bridge.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/accessibility_bridge.h @@ -10,7 +10,6 @@ #undef FALSE #include -#include #include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc index 3208146044c..e32ccf920c4 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc @@ -647,8 +647,7 @@ void ComponentV2::CreateView2(fuchsia::ui::app::CreateView2Args view_args) { std::move(fdio_ns_), // FDIO namespace std::move(directory_request_), // outgoing request product_config_, // product configuration - std::vector(), // dart entrypoint args - false // not a v1 component + std::vector() // dart entrypoint args )); } diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.h b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.h index f750319e98c..41eabcca492 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.h @@ -11,7 +11,6 @@ #include #include -#include #include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/engine.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/engine.cc index 2bc95833297..f02dcc13460 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/engine.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/engine.cc @@ -207,8 +207,7 @@ Engine::Engine(Delegate& delegate, UniqueFDIONS fdio_ns, fidl::InterfaceRequest directory_request, FlutterRunnerProductConfiguration product_config, - const std::vector& dart_entrypoint_args, - bool for_v1_component) + const std::vector& dart_entrypoint_args) : delegate_(delegate), thread_label_(std::move(thread_label)), thread_host_(CreateThreadHost(thread_label_, runner_services)), @@ -220,7 +219,7 @@ Engine::Engine(Delegate& delegate, Initialize(std::move(view_ref_pair), std::move(svc), std::move(runner_services), std::move(settings), std::move(fdio_ns), std::move(directory_request), - std::move(product_config), dart_entrypoint_args, for_v1_component); + std::move(product_config), dart_entrypoint_args); } void Engine::Initialize( @@ -231,8 +230,7 @@ void Engine::Initialize( UniqueFDIONS fdio_ns, fidl::InterfaceRequest directory_request, FlutterRunnerProductConfiguration product_config, - const std::vector& dart_entrypoint_args, - bool for_v1_component) { + const std::vector& dart_entrypoint_args) { // Flatland uses |view_creation_token_| for linking. FML_CHECK(view_creation_token_.value.is_valid()); @@ -584,18 +582,9 @@ void Engine::Initialize( // Shell has been created. Before we run the engine, set up the isolate // configurator. - { - fuchsia::sys::EnvironmentPtr environment; - if (for_v1_component) { - svc->Connect(environment.NewRequest()); - } - - isolate_configurator_ = std::make_unique( - std::move(fdio_ns), - // v2 components do not use fuchsia.sys.Environment. - for_v1_component ? std::move(environment) : nullptr, - directory_request.TakeChannel(), std::move(isolate_view_ref.reference)); - } + isolate_configurator_ = std::make_unique( + std::move(fdio_ns), directory_request.TakeChannel(), + std::move(isolate_view_ref.reference)); // This platform does not get a separate surface platform view creation // notification. Fire one eagerly. diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/engine.h b/engine/src/flutter/shell/platform/fuchsia/flutter/engine.h index 113e6e15898..d4a00c9e28e 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/engine.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/engine.h @@ -59,8 +59,7 @@ class Engine final : public fuchsia::memorypressure::Watcher { UniqueFDIONS fdio_ns, fidl::InterfaceRequest directory_request, FlutterRunnerProductConfiguration product_config, - const std::vector& dart_entrypoint_args, - bool for_v1_component); + const std::vector& dart_entrypoint_args); ~Engine(); @@ -81,8 +80,7 @@ class Engine final : public fuchsia::memorypressure::Watcher { UniqueFDIONS fdio_ns, fidl::InterfaceRequest directory_request, FlutterRunnerProductConfiguration product_config, - const std::vector& dart_entrypoint_args, - bool for_v1_component); + const std::vector& dart_entrypoint_args); static void WarmupSkps( fml::BasicTaskRunner* concurrent_task_runner, diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/focus_delegate.h b/engine/src/flutter/shell/platform/fuchsia/flutter/focus_delegate.h index ec6ae91ae7c..65250bad69d 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/focus_delegate.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/focus_delegate.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_FOCUS_DELEGATE_H_ #define FLUTTER_SHELL_PLATFORM_FUCHSIA_FOCUS_DELEGATE_H_ -#include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/isolate_configurator.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/isolate_configurator.cc index 030f4bf9bcf..8c3d457a6a6 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/isolate_configurator.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/isolate_configurator.cc @@ -13,13 +13,10 @@ namespace flutter_runner { -IsolateConfigurator::IsolateConfigurator( - UniqueFDIONS fdio_ns, - fuchsia::sys::EnvironmentHandle environment, - zx::channel directory_request, - zx::eventpair view_ref) +IsolateConfigurator::IsolateConfigurator(UniqueFDIONS fdio_ns, + zx::channel directory_request, + zx::eventpair view_ref) : fdio_ns_(std::move(fdio_ns)), - environment_(std::move(environment)), directory_request_(std::move(directory_request)), view_ref_(std::move(view_ref)) {} @@ -43,8 +40,7 @@ bool IsolateConfigurator::ConfigureCurrentIsolate() { } void IsolateConfigurator::BindFuchsia() { - fuchsia::dart::Initialize(std::move(environment_), - std::move(directory_request_), + fuchsia::dart::Initialize(std::move(directory_request_), std::move(view_ref_)); } diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/isolate_configurator.h b/engine/src/flutter/shell/platform/fuchsia/flutter/isolate_configurator.h index f38bed4f01b..dc8c3173426 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/isolate_configurator.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/isolate_configurator.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_ISOLATE_CONFIGURATOR_H_ #define FLUTTER_SHELL_PLATFORM_FUCHSIA_ISOLATE_CONFIGURATOR_H_ -#include #include #include "flutter/fml/macros.h" @@ -19,7 +18,6 @@ namespace flutter_runner { class IsolateConfigurator final { public: IsolateConfigurator(UniqueFDIONS fdio_ns, - fuchsia::sys::EnvironmentHandle environment, zx::channel directory_request, zx::eventpair view_ref); @@ -32,7 +30,6 @@ class IsolateConfigurator final { private: bool used_ = false; UniqueFDIONS fdio_ns_; - fuchsia::sys::EnvironmentHandle environment_; zx::channel directory_request_; zx::eventpair view_ref_; diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/platform_view.h b/engine/src/flutter/shell/platform/fuchsia/flutter/platform_view.h index 32995bc7b35..8ab5a14e00e 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/platform_view.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/platform_view.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_PLATFORM_VIEW_H_ #define FLUTTER_SHELL_PLATFORM_FUCHSIA_PLATFORM_VIEW_H_ -#include #include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/runner.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/runner.cc index d9af6c25249..e5dadc66696 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/runner.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/runner.cc @@ -204,7 +204,6 @@ Runner::Runner(fml::RefPtr task_runner, } Runner::~Runner() { - context_->outgoing()->RemovePublicService(); context_->outgoing() ->RemovePublicService(); diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/runner.h b/engine/src/flutter/shell/platform/fuchsia/flutter/runner.h index 4c077b6e818..6584ef1fa23 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/runner.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/runner.h @@ -9,7 +9,6 @@ #include #include -#include #include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-test.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-test.cc index 94f3909d05c..bbce8eed34d 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-test.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/mouse-input-test.cc @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-test.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-test.cc index 95fdb3a307b..345f9763ce3 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-test.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-test.cc @@ -4,7 +4,6 @@ #include #include -#include #include #include #include