blob: ccb684bbd8746f307fad12a8887734b93b560335 [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.pkg;
using fuchsia.io;
using zx;
/// This resolves font packages from a registry.
///
/// This is intended to be implemented by package resolver components, and used
/// exclusively by fuchsia.fonts.Provider.
///
/// DEPRECATED. This is an interim solution, and will be revisited when Component Framework v2
/// becomes available and allows non-component packages and easier directory routing.
[Deprecated = "For use only in Font Provider. To be replaced after Components v2 launch.",
Discoverable]
protocol FontResolver {
/// Populates or updates the cache of a font package, fetching it if it is not present on the
/// local system.
///
/// + request `package_url` the package URL of a font package.
/// + request `update_policy` the freshness and caching policies to be used when the
/// `FontResolver` is fetching packages.
/// + request `directory_request` a request for a directory that will be resolved when the
/// package has been successfully cached. The directory should contain a single file,
/// corresponding to the asset filename. The client should retain the directory handle
/// for as long as needed to prevent the package from being evicted from cache.
/// * error a zx_status value indicating failure. One of the following:
/// * `ZX_ERR_ACCESS_DENIED` if the resolver does not have permission to fetch a
/// package blob.
/// * `ZX_ERR_IO` if there is some other unspecified error during I/O.
/// * `ZX_ERR_NOT_FOUND` if the font package or a package blob does not exist, or is
/// not known to be a font package.
/// * `ZX_ERR_NO_SPACE` if there is no space available to store the package.
/// * `ZX_ERR_UNAVAILABLE` if the resolver is currently unable to fetch a package blob.
Resolve(
string package_url,
UpdatePolicy update_policy,
request<fuchsia.io.Directory> directory_request
)
-> () error zx.status;
};