diff --git a/shell/platform/fuchsia/dart_runner/BUILD.gn b/shell/platform/fuchsia/dart_runner/BUILD.gn index bf3d774c6784b..3e8d5a056fd33 100644 --- a/shell/platform/fuchsia/dart_runner/BUILD.gn +++ b/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/shell/platform/fuchsia/dart_runner/main.cc b/shell/platform/fuchsia/dart_runner/main.cc index 15b7fe889cc81..1ab0648eaf3bc 100644 --- a/shell/platform/fuchsia/dart_runner/main.cc +++ b/shell/platform/fuchsia/dart_runner/main.cc @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include diff --git a/shell/platform/fuchsia/dart_runner/meta/common.shard.cml b/shell/platform/fuchsia/dart_runner/meta/common.shard.cml index 4868e5d428d16..e10a98271165d 100644 --- a/shell/platform/fuchsia/dart_runner/meta/common.shard.cml +++ b/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/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/dart-aot-runner-integration-test.cc b/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/dart-aot-runner-integration-test.cc index 34b0cedf468c1..7e762ae601374 100644 --- a/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/dart-aot-runner-integration-test.cc +++ b/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/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml b/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml index 1dff27943eedf..272489d6c931b 100644 --- a/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_aot_runner/meta/dart-aot-runner-integration-test.cml +++ b/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/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/dart-jit-runner-integration-test.cc b/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/dart-jit-runner-integration-test.cc index 3845c9f246b75..b8b4ee30ce1bf 100644 --- a/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/dart-jit-runner-integration-test.cc +++ b/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/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml b/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml index b2afa5382e133..d95f61ee8e578 100644 --- a/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/dart_jit_runner/meta/dart-jit-runner-integration-test.cml +++ b/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/shell/platform/fuchsia/flutter/BUILD.gn b/shell/platform/fuchsia/flutter/BUILD.gn index 1d5609ac608b1..f68c44972e830 100644 --- a/shell/platform/fuchsia/flutter/BUILD.gn +++ b/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/shell/platform/fuchsia/flutter/accessibility_bridge.h b/shell/platform/fuchsia/flutter/accessibility_bridge.h index bf9ec8d4483e8..b4bc5948d28f5 100644 --- a/shell/platform/fuchsia/flutter/accessibility_bridge.h +++ b/shell/platform/fuchsia/flutter/accessibility_bridge.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include diff --git a/shell/platform/fuchsia/flutter/main.cc b/shell/platform/fuchsia/flutter/main.cc index bf67e1c5eb538..21162214a8d54 100644 --- a/shell/platform/fuchsia/flutter/main.cc +++ b/shell/platform/fuchsia/flutter/main.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include -#include +#include #include #include diff --git a/shell/platform/fuchsia/flutter/meta/common.shard.cml b/shell/platform/fuchsia/flutter/meta/common.shard.cml index afc80d528d64f..6bc325ab628a8 100644 --- a/shell/platform/fuchsia/flutter/meta/common.shard.cml +++ b/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/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn b/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn index 6b2dd7ed77b23..bc36d9033e075 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/embedder/BUILD.gn +++ b/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/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc b/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc index db875cf5109de..17cfb87e55aec 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/embedder/flutter-embedder-test.cc +++ b/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/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml b/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml index e0f267a348d1b..2db3c10762e6a 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/embedder/meta/flutter-embedder-test.cml +++ b/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/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml b/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml index a57ff11b97be1..367f4c81db3bf 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/mouse-input/meta/mouse-input-test.cml +++ b/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/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml b/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml index 8058e8a385651..48aa950c01898 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/text-input/meta/text-input-test.cml +++ b/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/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml b/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml index c0f6de3bf0caa..de1f89b080a0a 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/touch-input/meta/touch-input-test.cml +++ b/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/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn b/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn index 812703ec22781..e7b6dc40187ad 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/utils/BUILD.gn +++ b/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/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc b/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc index 7100e9b563f24..e36718a448081 100644 --- a/shell/platform/fuchsia/flutter/tests/integration/utils/portable_ui_test.cc +++ b/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/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn b/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn index 8c3f624178800..d1898a0531fea 100644 --- a/shell/platform/fuchsia/runtime/dart/utils/BUILD.gn +++ b/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/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.cc b/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.cc index b420be79e16cd..474fa29eef292 100644 --- a/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.cc +++ b/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/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.h b/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.h index 8eb7d5d3bcf0f..f9c9153b3050b 100644 --- a/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.h +++ b/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_; };