chromium/fuchsia_web/runners/cast/fidl/application_config.fidl

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

library chromium.cast;

using fuchsia.diagnostics;
using fuchsia.media;
using fuchsia.ui.gfx;
using fuchsia.web;
using zx;

/// Describes the configuration under which a Cast application should run.
type ApplicationConfig = resource table {
    /// Cast application Id.
    1: id string;

    /// Name to display to the user when referring to this application.
    2: display_name string;

    /// URL from which the application should be loaded, if it has a web-based
    /// implementation.
    3: web_url string;

    // Removed in https://crrev.com/c/1793791.
    // 4: bool touch_enabled_policy;

    // If true, enable remote debugging for this application.
    // if false or unset, remote debugging is disabled for this application.
    5: enable_remote_debugging bool;

    /// List of directories whose contents are served via `fuchsia-dir://`
    /// URLs. Networking will be disabled if any directories are set.
    6: content_directories_for_isolated_application vector<fuchsia.web.ContentDirectoryProvider>;

    /// The URL of the agent to handle this application.
    7: agent_url string;

    /// Simulates a different resolution for rendering.
    8: force_content_dimensions fuchsia.ui.gfx.vec2;

    /// List of the web permissions that should be granted to the application.
    9: permissions vector<fuchsia.web.PermissionDescriptor>;

    /// The initial minimum severity of `console` logs that will be logged to the
    /// [`fuchsia.logger/LogSink`] configured for this application. If not set, no
    /// messages will be logged.
    // TODO(crbug.com/42050112): Deprecate once there is another mechanism.
    10: initial_min_console_log_severity fuchsia.diagnostics.Severity;

    /// The usage for [`fuchsia.media/AudioRenderer`] created by the app. If not
    /// specified, then audio will be played through
    /// [`fuchsia.media/AudioConsumer`].
    11: audio_renderer_usage fuchsia.media.AudioRenderUsage;

    /// Optionally specifies an amount of time to grant to the Cast activity's
    /// web content to perform teardown tasks, in addition to the time permitted
    /// for the component to stop. Setting this value therefore allows the
    /// application's web content to out-live the component itself, for up to
    /// the specified duration.
    12: shutdown_delay zx.Duration;
};

/// Service interface for working with application configurations.
@discoverable
closed protocol ApplicationConfigManager {
    /// Returns the ApplicationConfig for the specified application Id.
    strict GetConfig(struct {
        id string;
    }) -> (resource struct {
        config ApplicationConfig;
    });
};