chromium/fuchsia_web/runners/cast/cast_runner.cml

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{
  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
    // providing it will result in log spam.
    "trace/use.shard.cml",

    "vulkan/client.shard.cml",
  ],
  program: {
    runner: "elf",
    binary: "cast_runner_exe",
    // Enable graceful teardown since the web_instance uses dynamic
    // capabilities via this Component.
    lifecycle: { stop_event: "notify" },
  },
  capabilities: [
    {
      protocol: [
        "chromium.cast.DataReset",
        "fuchsia.web.Debug",
        "fuchsia.web.FrameHost",
      ]
    },
    {
      resolver: "cast-resolver",
      path: "/svc/fuchsia.component.resolution.Resolver",
    },
    {
      runner: "cast-runner",
      path: "/svc/fuchsia.component.runner.ComponentRunner",
    },
  ],
  expose: [
    {
      protocol: [
        "chromium.cast.DataReset",
        "fuchsia.web.Debug",
        "fuchsia.web.FrameHost",
      ],
      from: "self",
    },
    {
      resolver: "cast-resolver",
      from: "self",
    },
    {
      runner: "cast-runner",
      from: "self",
    },
  ],
  use: [
    {
      directory: "config-data",
      rights: [ "r*" ],
      path: "/config/data",
      availability: "optional",
    },
    {
      directory: "tzdata-icu",
      rights: [ "r*" ],
      path: "/config/tzdata/icu",
    },
    {
      // Capabilities used by the Runner itself.
      protocol: [
        "chromium.cast.ApplicationConfigManager",
        "chromium.cast.CorsExemptHeaderProvider",
        "fuchsia.feedback.CrashReportingProductRegister",
      ]
    },
    {
      protocol: "fuchsia.component.Realm",
      from: "framework",
    },
    {
      storage: "cache",
      path: "/cache",
    },
  ],
}