0

[fuchsia] Route diagnostics dictionary to Chromium

Route the diagnostics dictionary to Chromium.

The diagnostics dictionary is not in itself a capability,
it is a concept that exists at the component framework level
and exists to ensure that a bundle of capabilities is routed between
different components in the system. It is not necessary for those
components, or child processes to "use" specific capabilities from
that bundle. This merely changes how the existing capabilities are
routed and ensures that all components in the component hierarchy
receive the capabilities in the bundle, allowing child components
that want to use a capability added in the future to easily
use it from that bundle without requiring that all components
in the hierarchy are explicitly updated to route it.

Cq-Include-Trybots: luci.chrome.try:fuchsia-smoke-sherlock

Fixed: 376922343

Change-Id: I22a5ede694c3088c015d626753569a5d699ab378
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6354008
Commit-Queue: Brian Bosak <bbosak@google.com>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Zijie He <zijiehe@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1437522}
This commit is contained in:
Brian Bosak
2025-03-25 08:53:17 -07:00
committed by Chromium LUCI CQ
parent fa281b92a1
commit 50129934db
24 changed files with 96 additions and 45 deletions

@ -30,7 +30,7 @@
to: "#isolated_archivist",
},
{
protocol: "fuchsia.logger.LogSink",
dictionary: "diagnostics",
from: "parent",
to: "#isolated_archivist",
},

@ -17,12 +17,16 @@
offer: [
{
protocol: [
"fuchsia.logger.LogSink",
"fuchsia.tracing.provider.Registry",
],
from: "parent",
to: "#isolated_font_provider",
},
{
dictionary: "diagnostics",
from: "parent",
to: "#isolated_font_provider",
},
],
facets: {
"fuchsia.test": {

@ -4,5 +4,9 @@
{
use: [
{ protocol: [ "fuchsia.logger.Log" ] },
{
protocol: "fuchsia.logger.LogSink",
from: "parent/diagnostics",
}
],
}

@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{
include: [
"syslog/client.shard.cml",
],
// The following components must be subpackaged by all Chromium tests that
// aren't system tests, to provide implementations of always-required
// capabilities (see the `use`s and `offer`s).
@ -20,9 +17,12 @@
],
offer: [
{
protocol: "fuchsia.logger.LogSink",
dictionary: "diagnostics",
from: "parent",
to: [ "#intl_property_manager" ],
to: [
"#intl_property_manager",
"#build-info-service",
],
}
],
use: [

@ -16,7 +16,6 @@
offer: [
{
protocol: [
"fuchsia.logger.LogSink",
"fuchsia.sysinfo.SysInfo",
"fuchsia.sysmem.Allocator",
"fuchsia.sysmem2.Allocator",
@ -24,6 +23,11 @@
from: "parent",
to: "#isolated_codec_factory",
},
{
dictionary: "diagnostics",
from: "parent",
to: "#isolated_codec_factory",
},
{
directory: "dev-mediacodec",
from: "parent",

@ -14,7 +14,7 @@
],
offer: [
{
protocol: "fuchsia.logger.LogSink",
dictionary: "diagnostics",
from: "parent",
to: [
"#isolated_a11y_manager",

@ -2,15 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{
include: [
"syslog/client.shard.cml",
],
use: [
{
directory: "tzdata-icu",
rights: [ "r*" ],
path: "/config/tzdata/icu",
},
{
protocol: "fuchsia.logger.LogSink",
from: "parent/diagnostics",
},
{
storage: "cache",
path: "/cache",

@ -10,7 +10,7 @@
],
offer: [
{
protocol: "fuchsia.logger.LogSink",
dictionary: "diagnostics",
from: "parent",
to: "#test_fonts",
},

@ -29,7 +29,6 @@
},
{
protocol: [
"fuchsia.logger.LogSink",
"fuchsia.scheduler.ProfileProvider",
"fuchsia.sysmem.Allocator",
"fuchsia.sysmem2.Allocator",
@ -39,6 +38,11 @@
from: "parent",
to: "#test_ui_stack",
},
{
dictionary: "diagnostics",
from: "parent",
to: "#test_ui_stack",
},
],
facets: {
"fuchsia.test": {

@ -3,11 +3,10 @@
// found in the LICENSE file.
{
include: [
"syslog/client.shard.cml",
"vulkan/client.shard.cml",
"//build/config/fuchsia/test/elf_test_runner.shard.test-cml",
"//build/config/fuchsia/test/chromium_system_test_facet.shard.test-cml",
"//build/config/fuchsia/test/test_fonts.shard.test-cml",
"vulkan/client.shard.cml",
],
program: {
binary: "content_shell",

@ -15,6 +15,7 @@
#include "base/command_line.h"
using ::component_testing::ChildRef;
using ::component_testing::Dictionary;
using ::component_testing::Directory;
using ::component_testing::ParentRef;
using ::component_testing::Protocol;
@ -89,9 +90,18 @@ void AddRouteFromParent(RealmBuilder& realm_builder,
.targets = {std::move(child_ref)}});
}
void AddDictionaryRouteFromParent(RealmBuilder& realm_builder,
std::string_view child_name,
std::string_view dictionary_name) {
ChildRef child_ref{std::string_view(child_name.data(), child_name.size())};
realm_builder.AddRoute(Route{.capabilities = {Dictionary{dictionary_name}},
.source = ParentRef{},
.targets = {std::move(child_ref)}});
}
void AddSyslogRoutesFromParent(RealmBuilder& realm_builder,
std::string_view child_name) {
AddRouteFromParent(realm_builder, child_name, "fuchsia.logger.LogSink");
AddDictionaryRouteFromParent(realm_builder, child_name, "diagnostics");
}
void AddVulkanRoutesFromParent(RealmBuilder& realm_builder,

@ -4,8 +4,6 @@
{
include: [
"//fuchsia_web/webinstance_host/web_instance_host.shard.cml",
"inspect/client.shard.cml",
"syslog/client.shard.cml",
// `main()` intantiates tracing directly.
// Although the protocol is technically optional, as in this shard, not

@ -25,7 +25,6 @@
"fuchsia.hwinfo.Product",
// "fuchsia.intl.PropertyProvider" is provided by #intl_property_manager.
"fuchsia.kernel.VmexResource",
"fuchsia.logger.LogSink",
"fuchsia.media.ProfileProvider",
"fuchsia.scheduler.RoleManager",
"fuchsia.memorypressure.Provider",
@ -57,6 +56,11 @@
from: "parent",
to: "#realm_builder",
},
{
dictionary: "diagnostics",
from: "parent",
to: "#realm_builder",
},
{
protocol: [ "fuchsia.buildinfo.Provider" ],
from: "#build-info-service",

@ -35,6 +35,7 @@
#include "media/fuchsia/audio/fake_audio_device_enumerator_local_component.h"
using ::component_testing::ChildRef;
using ::component_testing::Dictionary;
using ::component_testing::Directory;
using ::component_testing::DirectoryContents;
using ::component_testing::FrameworkRef;
@ -134,7 +135,7 @@ CastRunnerLauncher::CastRunnerLauncher(CastRunnerFeatures runner_features) {
Protocol{"fuchsia.hwinfo.Product"},
Protocol{fuchsia::intl::PropertyProvider::Name_},
Protocol{fuchsia::kernel::VmexResource::Name_},
Protocol{"fuchsia.logger.LogSink"},
Dictionary{"diagnostics"},
Protocol{fuchsia::media::ProfileProvider::Name_},
Protocol{"fuchsia.scheduler.RoleManager"},
Protocol{fuchsia::memorypressure::Provider::Name_},

@ -12,8 +12,6 @@
"//build/config/fuchsia/test/chromium_system_test_facet.shard.test-cml",
"//build/config/fuchsia/test/elf_test_runner.shard.test-cml",
"sys/component/realm_builder_absolute.shard.cml",
"syslog/client.shard.cml",
],
program: {
binary: "cast_streaming_shell_exe",
@ -58,6 +56,11 @@
subdir: "web_engine",
availability: "optional",
},
{
dictionary:"diagnostics",
from: "parent",
to: "#realm_builder",
},
{
// Holds ICU time zone data files.
// See:

@ -8,7 +8,6 @@
{
include: [
"//fuchsia_web/webinstance_host/web_instance_host.shard.cml",
"syslog/client.shard.cml",
],
program: {
runner: "elf",
@ -24,7 +23,10 @@
{
protocol: "fuchsia.posix.socket.Provider",
},
{
protocol: "fuchsia.logger.LogSink",
from: "parent/diagnostics",
},
// Required if not run with --headless.
{
protocol: [ "fuchsia.element.GraphicalPresenter" ],

@ -12,8 +12,6 @@
"//build/config/fuchsia/test/chromium_system_test_facet.shard.test-cml",
"//build/config/fuchsia/test/elf_test_runner.shard.test-cml",
"sys/component/realm_builder_absolute.shard.cml",
"syslog/client.shard.cml",
],
program: {
binary: "web_engine_shell_exec",
@ -60,7 +58,7 @@
"fuchsia.fonts.Provider",
"fuchsia.hwinfo.Product",
"fuchsia.intl.PropertyProvider",
// "fuchsia.logger/LogSink", is included by the shard above.
// "fuchsia.logger/LogSink", is included by the RealmBuilder shard
"fuchsia.memorypressure.Provider",
"fuchsia.process.Launcher",
"fuchsia.sysmem.Allocator",

@ -8,7 +8,6 @@
{
include: [
"//fuchsia_web/webinstance_host/web_instance_host.shard.cml",
"syslog/client.shard.cml",
],
program: {
runner: "elf",
@ -26,7 +25,10 @@
protocol: [ "fuchsia.element.GraphicalPresenter" ],
availability: "optional",
},
{
protocol: "fuchsia.logger.LogSink",
from: "parent/diagnostics",
},
// Used to hold the cdm_data directory passed to web_instance.
{
storage: "data",

@ -4,9 +4,6 @@
{
include: [
"//fuchsia_web/webinstance_host/web_instance_host_with_svc_directory.shard.cml",
// Use but do not offer. All capability routing be via FIDL calls.
"syslog/use.shard.cml",
],
program: {
runner: "elf",
@ -23,6 +20,12 @@
],
},
],
use: [
{
protocol: "fuchsia.logger.LogSink",
from: "parent/diagnostics",
},
],
expose: [
{
protocol: [

@ -50,7 +50,7 @@ namespace {
::component_testing::Protocol{"fuchsia.hwinfo.Product"},
::component_testing::Protocol{"fuchsia.intl.PropertyProvider"},
::component_testing::Protocol{"fuchsia.kernel.VmexResource"},
::component_testing::Protocol{"fuchsia.logger.LogSink"},
::component_testing::Dictionary{"diagnostics"},
::component_testing::Protocol{"fuchsia.memorypressure.Provider"},
::component_testing::Protocol{"fuchsia.process.Launcher"},
::component_testing::Protocol{"fuchsia.sysmem.Allocator"},

@ -30,7 +30,6 @@
"fuchsia.hwinfo.Product",
"fuchsia.intl.PropertyProvider",
"fuchsia.kernel.VmexResource",
"fuchsia.logger.LogSink",
"fuchsia.media.ProfileProvider",
"fuchsia.scheduler.RoleManager",
"fuchsia.memorypressure.Provider",
@ -65,7 +64,6 @@
{
protocol: [
"fuchsia.logger.LogSink",
"fuchsia.scheduler.ProfileProvider",
"fuchsia.sysmem.Allocator",
"fuchsia.sysmem2.Allocator",

@ -8,8 +8,6 @@
{
include: [
"//fuchsia_web/webengine/web_instance-common.shard.cml",
"inspect/client.shard.cml",
"syslog/client.shard.cml",
],
// These uses are based on https://fuchsia.dev/reference/fidl/fuchsia.web,
@ -32,6 +30,13 @@
"fuchsia.sysmem2.Allocator",
],
},
{
protocol: [
"fuchsia.logger.LogSink",
"fuchsia.inspect.InspectSink"
],
from: "parent/diagnostics",
},
{
// Optional capabilities, dependent on `ContextFeatureFlags` and other
// optional functionality. Protocols for `ContextFeatureFlags` are listed

@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{
include: [
// Enable logging from the Component that is a web_instance_host.
"syslog/use.shard.cml",
],
collections: [
// The collection in which child instances are dynamically created.
{
@ -49,6 +45,11 @@
from: "parent",
to: "#web_instances",
},
{
dictionary: "diagnostics",
from: "parent",
to: "#web_instances",
},
{
// Statically offered to all web_instances regardless of whether they were
// created with `ContextFeatureFlags.NETWORK`.
@ -66,7 +67,6 @@
"fuchsia.fonts.Provider",
"fuchsia.hwinfo.Product",
"fuchsia.intl.PropertyProvider",
"fuchsia.logger.LogSink", // Targeted copy of syslog/offer.shard.cml.
"fuchsia.memorypressure.Provider",
"fuchsia.process.Launcher",
"fuchsia.sysmem.Allocator",

@ -4,8 +4,6 @@
{
include: [
"//src/sys/test_runners/elf/ambient_exec.shard.cml",
"inspect/offer.shard.cml",
"syslog/client.shard.cml",
],
program: {
binary: "bin/crashpad_tests",
@ -36,6 +34,10 @@
protocol: [ "fuchsia.posix.socket.Provider" ],
from: "#netstack",
},
{
protocol: [ "fuchsia.logger.LogSink" ],
from: "parent/diagnostics",
},
{
protocol: [ "fuchsia.process.Launcher" ],
},
@ -50,6 +52,15 @@
from: "#dns_resolver",
to: "#crashpad_test",
},
{
dictionary: "diagnostics",
from: "parent",
to: [
"#dns_resolver",
"#netstack",
"#crashpad_test",
]
},
{
protocol: "fuchsia.net.routes.State",
from: "#netstack",