| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 [DartPackage="mojo", | |
| 6 JavaPackage="org.chromium.mojo.bindings"] | |
| 7 // TODO(rudominer) Move this file into the module mojo.bindings when | |
| 8 // https://github.com/domokit/mojo/issues/435 is fixed. | |
| 9 module mojo.bindings.types; | |
| 10 | |
| 11 import "mojom_types.mojom"; | |
| 12 | |
| 13 // This is a companion interface to ServiceProvider. An implementation of | |
| 14 // ServiceProvider may optionally offer descriptions of the services it | |
| 15 // provides by making this interface available. A client obtains access | |
| 16 // to a ServiceDescriber service by invoking | |
| 17 // ServiceProvider.ConnectToService(SERVICE_DESCRIBER_INTERFACE_NAME, pipe). | |
| 18 [ServiceName="mojo::bindings::types::ServiceDescriber"] | |
| 19 interface ServiceDescriber { | |
| 20 // Requests access to a ServiceDescription for the service with the | |
| 21 // given name. The |interface_name| is the same string that would be passed | |
| 22 // to ServiceProvider.ConnectToService() in order to request the service | |
| 23 // with the given name. If the host is not willing or able to describe the | |
| 24 // service with the given name it will close the |description_request| pipe. | |
| 25 DescribeService(string interface_name, | |
| 26 ServiceDescription& description_request); | |
| 27 }; | |
| 28 | |
| 29 // A ServiceDescription allows a client to request information about the Mojom | |
| 30 // types used to implement a particular Mojo service. | |
| 31 // | |
| 32 // A Mojo service has a *top-level* interface: the interface that is bound to | |
| 33 // the message pipe |pipe| as a result of calling | |
| 34 // ServiceProvider.ConnectToService(). | |
| 35 // | |
| 36 // The *complete type set* of a Mojo service is the closure of this top-level | |
| 37 // interface under type reference. That is, the complete type set includes all | |
| 38 // of the types referenced directly in the definition of the top-level interface | |
| 39 // and the types referenced by those types etc. The complete type set of a Mojo | |
| 40 // service may include other interfaces besides the top-level interface. | |
| 41 // | |
| 42 // An implementation of ServiceDescription contains information about all | |
| 43 // of the types in the complete type set of the service. | |
| 44 interface ServiceDescription { | |
| 45 // Returns a MojomInterface for the top-level interface of this service. | |
| 46 GetTopLevelInterface() => (MojomInterface mojomInterface); | |
| 47 | |
| 48 // Returns the |UserDefinedType| for the given |type_key|. Valid keys are | |
| 49 // those that are embedded in the structures returned from earlier queries | |
| 50 // of this ServiceDescription. If the key is invalid then |type| will be null. | |
| 51 GetTypeDefinition(string type_key) | |
| 52 => (mojo.bindings.types.UserDefinedType? type); | |
| 53 | |
| 54 // Returns all the data queryable via GetTypeDefinition in a single | |
| 55 // structure, or null if the implementation is not willing or not able to | |
| 56 // provide all of the data at once. | |
| 57 GetAllTypeDefinitions() => (map<string, UserDefinedType>? definitions); | |
| 58 }; | |
| OLD | NEW |