naiveproxy/services/service_manager/public/mojom/interface_provider_spec.mojom
2018-12-09 21:59:24 -05:00

45 lines
2.0 KiB
Plaintext

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module service_manager.mojom;
// Defines a set of Mojo interfaces. The string value is the fully qualified
// name of the interface in the form "module::path::InterfaceName". We don't
// represent this as a bare array in-situ in mojom because we rely on type maps
// to generate a set container in C++ which is unavailable for a bare array.
struct InterfaceSet {
array<string> interfaces;
};
// Defines a set of capability names. A "capability" can be a collection of Mojo
// interface names, or just some control bit that affects behavior in the
// service that provides it. See note above about not just using a bare array.
struct CapabilitySet {
array<string> capabilities;
};
// An InterfaceProviderSpec is the static definition of a collection of
// capabilities that a service provides to other services and a collection of
// capabilities that it requires from other services.
struct InterfaceProviderSpec {
// The capabilities provided by this service, and for each class an array of
// interfaces. If no interfaces are granted with a capability, the array will
// be empty.
// A map of class name -> array of interfaces. The array can be empty,
// non-empty, or ["*"], which means allow access to all interfaces.
map<string, InterfaceSet> provides;
// The services this service needs to speak to, and the capabilities it
// requires from each.
// A map of service name -> collection of required capabilities. "*" is also
// supported as the key, which supplies a set of capabilities required from
// all services in addition to specific ones specified.
map<string, CapabilitySet> requires;
};
// The name of the InterfaceProviderSpec in service manifests used by the
// Service Manager to control capabilities & interfaces exposed between
// services via Connector.
const string kServiceManager_ConnectorSpec = "service_manager:connector";