From 884512b9e448c64e2190dd2eb800c0a6c881d23e Mon Sep 17 00:00:00 2001 From: Miguel <1889916+miguelfrde@users.noreply.github.com> Date: Mon, 12 Feb 2024 18:42:16 +0100 Subject: [PATCH] [fuchsia] Update Inspect library usage (flutter/engine#50467) The new Inspect library uses InspectSink as described in [RFC-168](https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0168_exposing_inspect_through_inspectsink?hl=en). Additionally it's using the new CPP bindings instead of the deprecated HLCPP bindings. Bug: https://g-issues.fuchsia.dev/issues/320785253 I've verified on a relevant Fuchsia build that the Flutter runner continues to correctly publish Inspect after this change. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing. --- .../platform/fuchsia/dart_runner/BUILD.gn | 5 ++-- .../platform/fuchsia/dart_runner/main.cc | 2 +- .../fuchsia/dart_runner/meta/common.shard.cml | 23 ++----------------- .../dart-aot-runner-integration-test.cc | 1 + .../meta/dart-aot-runner-integration-test.cml | 1 + .../dart-jit-runner-integration-test.cc | 1 + .../meta/dart-jit-runner-integration-test.cml | 1 + .../shell/platform/fuchsia/flutter/BUILD.gn | 2 +- .../fuchsia/flutter/accessibility_bridge.h | 2 +- .../shell/platform/fuchsia/flutter/main.cc | 2 +- .../fuchsia/flutter/meta/common.shard.cml | 23 ++----------------- .../tests/integration/embedder/BUILD.gn | 1 + .../embedder/flutter-embedder-test.cc | 3 +++ .../embedder/meta/flutter-embedder-test.cml | 1 + .../mouse-input/meta/mouse-input-test.cml | 1 + .../text-input/meta/text-input-test.cml | 1 + .../touch-input/meta/touch-input-test.cml | 1 + .../flutter/tests/integration/utils/BUILD.gn | 1 + .../integration/utils/portable_ui_test.cc | 2 ++ .../fuchsia/runtime/dart/utils/BUILD.gn | 5 ++-- .../runtime/dart/utils/root_inspect_node.cc | 10 ++++---- .../runtime/dart/utils/root_inspect_node.h | 5 ++-- 22 files changed, 38 insertions(+), 56 deletions(-) diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn index bf3d774c67..3e8d5a056f 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn @@ -58,9 +58,10 @@ template("runner_sources") { "$fuchsia_sdk_root/pkg:async-loop-cpp", "$fuchsia_sdk_root/pkg:async-loop-default", "$fuchsia_sdk_root/pkg:fidl_cpp", + "$fuchsia_sdk_root/pkg:inspect", + "$fuchsia_sdk_root/pkg:inspect_component_cpp", "$fuchsia_sdk_root/pkg:sys_cpp", "$fuchsia_sdk_root/pkg:sys_cpp_testing", - "$fuchsia_sdk_root/pkg:sys_inspect_cpp", "$fuchsia_sdk_root/pkg:trace", "$fuchsia_sdk_root/pkg:vfs_cpp", "$fuchsia_sdk_root/pkg:zx", @@ -99,7 +100,7 @@ template("runner") { deps = [ ":" + target_name + "_runner_sources", - "$fuchsia_sdk_root/pkg:sys_inspect_cpp", + "$fuchsia_sdk_root/pkg:inspect_component_cpp", "$fuchsia_sdk_root/pkg:trace-provider-so", ] + extra_deps } diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/main.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/main.cc index 15b7fe889c..1ab0648eaf 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/main.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/main.cc @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/meta/common.shard.cml b/engine/src/flutter/shell/platform/fuchsia/dart_runner/meta/common.shard.cml index 4868e5d428..e10a982711 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/meta/common.shard.cml +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/meta/common.shard.cml @@ -2,16 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. { - capabilities: [ - // Required for inspect. - // Copied from inspect/client.shard.cml because out-of-tree doesn't - // have support for CML includes from the SDK. - { - directory: "diagnostics", - rights: [ "connect" ], - path: "/diagnostics", - }, - ], use: [ // This is used by the Dart VM to communicate from Dart code to C++ code. { @@ -36,6 +26,7 @@ protocol: [ "fuchsia.device.NameProvider", // For fdio uname() "fuchsia.feedback.CrashReporter", + "fuchsia.inspect.InspectSink", // For inspect "fuchsia.intl.PropertyProvider", // For dartVM timezone support "fuchsia.logger.LogSink", // For syslog "fuchsia.net.name.Lookup", // For fdio sockets @@ -50,15 +41,5 @@ from: "parent", availability: "optional", }, - ], - expose: [ - // Required for inspect. - // Copied from inspect/client.shard.cml because out-of-tree doesn't - // have support for CML includes from the SDK. - { - directory: "diagnostics", - from: "self", - to: "framework", - }, - ], + ] } diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/dart-aot-runner-integration-test.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/dart-aot-runner-integration-test.cc index 34b0cedf46..7e762ae601 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/dart-aot-runner-integration-test.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/dart-aot-runner-integration-test.cc @@ -83,6 +83,7 @@ TEST_F(RealmBuilderTest, DartRunnerStartsUp) { Protocol{"fuchsia.posix.socket.Provider"}, Protocol{"fuchsia.intl.PropertyProvider"}, Protocol{"fuchsia.vulkan.loader.Loader"}, + Protocol{"fuchsia.inspect.InspectSink"}, Directory{"config-data"}}, .source = ParentRef(), .targets = {kDartAotRunnerRef, kDartAotEchoServerRef}}); diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml index 1dff27943e..272489d6c9 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml @@ -19,6 +19,7 @@ // Offer capabilities needed by components in this test realm. // Keep it minimal, describe only what's actually needed. protocol: [ + "fuchsia.inspect.InspectSink", "fuchsia.logger.LogSink", "fuchsia.sysmem.Allocator", "fuchsia.tracing.provider.Registry", diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/dart-jit-runner-integration-test.cc b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/dart-jit-runner-integration-test.cc index 3845c9f246..b8b4ee30ce 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/dart-jit-runner-integration-test.cc +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/dart-jit-runner-integration-test.cc @@ -81,6 +81,7 @@ TEST_F(RealmBuilderTest, DartRunnerStartsUp) { Protocol{"fuchsia.tracing.provider.Registry"}, Protocol{"fuchsia.posix.socket.Provider"}, Protocol{"fuchsia.intl.PropertyProvider"}, + Protocol{"fuchsia.inspect.InspectSink"}, Directory{"config-data"}}, .source = ParentRef(), .targets = {kDartJitRunnerRef, kDartJitEchoServerRef}}); diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml index b2afa5382e..d95f61ee8e 100644 --- a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml @@ -19,6 +19,7 @@ // Offer capabilities needed by components in this test realm. // Keep it minimal, describe only what's actually needed. protocol: [ + "fuchsia.inspect.InspectSink", "fuchsia.logger.LogSink", "fuchsia.sysmem.Allocator", "fuchsia.tracing.provider.Registry", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn index 1d5609ac60..f68c44972e 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn @@ -140,8 +140,8 @@ template("runner_sources") { public_deps = [ "$fuchsia_sdk_root/pkg:inspect", + "$fuchsia_sdk_root/pkg:inspect_component_cpp", "$fuchsia_sdk_root/pkg:sys_cpp", - "$fuchsia_sdk_root/pkg:sys_inspect_cpp", "//flutter/shell/platform/fuchsia/runtime/dart/utils", ] + flutter_public_deps 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 bf9ec8d448..b4bc5948d2 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/accessibility_bridge.h +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/accessibility_bridge.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/main.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/main.cc index bf67e1c5eb..21162214a8 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/main.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/main.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include -#include +#include #include #include diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/meta/common.shard.cml b/engine/src/flutter/shell/platform/fuchsia/flutter/meta/common.shard.cml index afc80d528d..6bc325ab62 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/meta/common.shard.cml +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/meta/common.shard.cml @@ -2,16 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file { - capabilities: [ - // Required for inspect. - // Copied from inspect/client.shard.cml because out-of-tree doesn't - // have support for CML includes from the SDK. - { - directory: "diagnostics", - rights: [ "connect" ], - path: "/diagnostics", - }, - ], use: [ // This is used by the Dart VM to communicate from Dart code to C++ code. { @@ -43,6 +33,7 @@ "fuchsia.device.NameProvider", "fuchsia.feedback.CrashReporter", "fuchsia.fonts.Provider", + "fuchsia.inspect.InspectSink", // Copied from inspect/client.shard.cml. "fuchsia.intl.PropertyProvider", "fuchsia.logger.LogSink", // Copied from syslog/client.shard.cml. "fuchsia.media.ProfileProvider", @@ -64,15 +55,5 @@ ], availability: "optional", }, - ], - expose: [ - // Required for inspect. - // Copied from inspect/client.shard.cml because out-of-tree doesn't - // have support for CML includes from the SDK. - { - directory: "diagnostics", - from: "self", - to: "framework", - }, - ], + ] } diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn index 6b2dd7ed77..bc36d9033e 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn @@ -23,6 +23,7 @@ executable("flutter-embedder-test-bin") { libs = [ "$fuchsia_sdk_path/arch/$target_cpu/sysroot/lib/libzircon.so" ] deps = [ + "$fuchsia_sdk_root/fidl:fuchsia.inspect", "$fuchsia_sdk_root/fidl:fuchsia.logger", "$fuchsia_sdk_root/fidl:fuchsia.tracing.provider", "$fuchsia_sdk_root/fidl:fuchsia.ui.app", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc index db875cf510..17cfb87e55 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include #include #include #include @@ -232,6 +233,7 @@ void FlutterEmbedderTest::SetUpRealmBase() { Route{.capabilities = { Protocol{fuchsia::logger::LogSink::Name_}, + Protocol{fuchsia::inspect::InspectSink::Name_}, Protocol{fuchsia::sysmem::Allocator::Name_}, Protocol{fuchsia::tracing::provider::Registry::Name_}, Protocol{kVulkanLoaderServiceName}, @@ -243,6 +245,7 @@ void FlutterEmbedderTest::SetUpRealmBase() { // Route base system services to the test UI stack. realm_builder_.AddRoute(Route{ .capabilities = {Protocol{fuchsia::logger::LogSink::Name_}, + Protocol{fuchsia::inspect::InspectSink::Name_}, Protocol{fuchsia::sysmem::Allocator::Name_}, Protocol{fuchsia::tracing::provider::Registry::Name_}, Protocol{kVulkanLoaderServiceName}}, diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml index e0f267a348..2db3c10762 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml @@ -18,6 +18,7 @@ // Offer capabilities needed by components in this test realm. // Keep it minimal, describe only what's actually needed. protocol: [ + "fuchsia.inspect.InspectSink", "fuchsia.logger.LogSink", "fuchsia.sysmem.Allocator", "fuchsia.tracing.provider.Registry", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml index a57ff11b97..367f4c81db 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml @@ -25,6 +25,7 @@ // Offer capabilities needed by components in this test realm. // Keep it minimal, describe only what's actually needed. protocol: [ + "fuchsia.inspect.InspectSink", "fuchsia.kernel.RootJobForInspect", "fuchsia.kernel.Stats", "fuchsia.logger.LogSink", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml index 8058e8a385..48aa950c01 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml @@ -24,6 +24,7 @@ offer: [ { protocol: [ + "fuchsia.inspect.InspectSink", "fuchsia.kernel.RootJobForInspect", "fuchsia.kernel.Stats", "fuchsia.logger.LogSink", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml index c0f6de3bf0..de1f89b080 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml @@ -25,6 +25,7 @@ // Offer capabilities needed by components in this test realm. // Keep it minimal, describe only what's actually needed. protocol: [ + "fuchsia.inspect.InspectSink", "fuchsia.kernel.RootJobForInspect", "fuchsia.kernel.Stats", "fuchsia.logger.LogSink", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn index 812703ec22..e7b6dc4018 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn @@ -41,6 +41,7 @@ source_set("portable_ui_test") { deps = [ ":check_view", + "$fuchsia_sdk_root/fidl:fuchsia.inspect", "$fuchsia_sdk_root/fidl:fuchsia.logger", "$fuchsia_sdk_root/fidl:fuchsia.ui.app", "$fuchsia_sdk_root/fidl:fuchsia.ui.composition", diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc index 7100e9b563..e36718a448 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc @@ -4,6 +4,7 @@ #include "portable_ui_test.h" +#include #include #include #include @@ -77,6 +78,7 @@ void PortableUITest::SetUpRealmBase() { // // Route base system services to flutter and the test UI stack. realm_builder_.AddRoute(Route{ .capabilities = {Protocol{fuchsia::logger::LogSink::Name_}, + Protocol{fuchsia::inspect::InspectSink::Name_}, Protocol{fuchsia::sysmem::Allocator::Name_}, Protocol{fuchsia::tracing::provider::Registry::Name_}, Protocol{fuchsia::ui::input::ImeService::Name_}, diff --git a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn index 8c3f624178..d1898a0531 100644 --- a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn @@ -44,7 +44,7 @@ template("make_utils") { "$fuchsia_sdk_root/pkg:async-loop-default", "$fuchsia_sdk_root/pkg:fdio", "$fuchsia_sdk_root/pkg:sys_cpp", - "$fuchsia_sdk_root/pkg:sys_inspect_cpp", + "$fuchsia_sdk_root/pkg:inspect_component_cpp", "$fuchsia_sdk_root/pkg:trace", "$fuchsia_sdk_root/pkg:vfs_cpp", "$fuchsia_sdk_root/pkg:zx", @@ -99,7 +99,8 @@ executable("dart_utils_unittests") { deps = [ ":utils", ":utils_fixtures", - "$fuchsia_sdk_root/pkg:sys_inspect_cpp", + "$fuchsia_sdk_root/pkg:inspect_component_cpp", + "$fuchsia_sdk_root/pkg:sys_cpp", "//flutter/testing", "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:dart_io_api", diff --git a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.cc b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.cc index b420be79e1..474fa29eef 100644 --- a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.cc +++ b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.cc @@ -3,26 +3,28 @@ // found in the LICENSE file. #include "root_inspect_node.h" +#include namespace dart_utils { -std::unique_ptr RootInspectNode::inspector_; +std::unique_ptr RootInspectNode::inspector_; std::mutex RootInspectNode::mutex_; void RootInspectNode::Initialize(sys::ComponentContext* context) { std::lock_guard lock(mutex_); if (!inspector_) { - inspector_ = std::make_unique(context); + inspector_ = std::make_unique( + async_get_default_dispatcher(), inspect::PublishOptions{}); } } inspect::Node RootInspectNode::CreateRootChild(const std::string& name) { std::lock_guard lock(mutex_); - return inspector_->inspector()->GetRoot().CreateChild(name); + return inspector_->inspector().GetRoot().CreateChild(name); } inspect::Inspector* RootInspectNode::GetInspector() { - return inspector_->inspector(); + return &inspector_->inspector(); } } // namespace dart_utils diff --git a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.h b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.h index 8eb7d5d3bc..f9c9153b30 100644 --- a/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.h +++ b/engine/src/flutter/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.h @@ -5,7 +5,8 @@ #ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_RUNTIME_DART_UTILS_ROOT_INSPECT_NODE_H_ #define FLUTTER_SHELL_PLATFORM_FUCHSIA_RUNTIME_DART_UTILS_ROOT_INSPECT_NODE_H_ -#include +#include +#include #include #include @@ -36,7 +37,7 @@ class RootInspectNode { static inspect::Inspector* GetInspector(); private: - static std::unique_ptr inspector_; + static std::unique_ptr inspector_; static std::mutex mutex_; };