blob: 17081220f040c1f509f70e9e508ae5129c3eb75e [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]
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 `LaunchSessionError.NOT_FOUND` if `configuration.session_url` is
/// missing or could not be resolved
/// * error `LaunchSessionError.FAILED` if the session failed to launch
LaunchSession(SessionConfiguration configuration) -> () error LaunchSessionError;
/// Restarts the current session.
///
/// * error `LaunchSessionError.NOT_FOUND` if no session is currently running,
/// or `LaunchSessionError.FAILED` if it failed to restart
RestartSession() -> () error LaunchSessionError;
};
/// Errors returned when a session fails to launch or restart.
enum LaunchSessionError {
/// There was an error resolving the session's component URL.
NOT_FOUND = 1;
/// The session failed to launch.
FAILED = 2;
};
/// Describes a session to launch.
table SessionConfiguration {
/// The component URL of the session.
1: string:fuchsia.url.MAX_URL_LENGTH session_url;
};