blob: a5ce9c9cf50205779ceb1dd1597f5b19cfab6098 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.session;
using fuchsia.url;
/// A protocol used to launch sessions.
@discoverable
closed protocol Launcher {
/// Launches the session detailed in `configuration`.
///
/// If a session is currently running, the component associated with the running
/// session will be destroyed.
///
/// + `configuration` describes the session to launch.
/// * error `LaunchError.INVALID_ARGS` if `configuration.session_url` is not set.
/// * error `LaunchError.NOT_FOUND` if `configuration.session_url`
/// could not be resolved.
/// * error `LaunchError.DESTROY_COMPONENT_FAILED` if an existing session component
/// could not be destroyed. The existing session remains running at this point.
/// * error `LaunchError.CREATE_COMPONENT_FAILED` if the session component
/// could not be started. No session will be running at this point.
strict Launch(struct {
configuration LaunchConfiguration;
}) -> () error LaunchError;
};
/// An error that occurs when launching a session.
type LaunchError = flexible enum {
/// The session's `LaunchConfiguration` is malformed.
INVALID_ARGS = 1;
/// There was an error resolving the session's component URL.
NOT_FOUND = 2;
/// The session component could not be destroyed.
DESTROY_COMPONENT_FAILED = 3;
/// The session component could not be created.
CREATE_COMPONENT_FAILED = 4;
};
/// Describes a session to launch.
type LaunchConfiguration = table {
/// The component URL of the session.
1: session_url string:fuchsia.url.MAX_URL_LENGTH;
};