| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module mojo.shell.mojom; | 5 module mojo.shell.mojom; |
| 6 | 6 |
| 7 import "mojo/shell/public/interfaces/capabilities.mojom"; | 7 import "mojo/shell/public/interfaces/capabilities.mojom"; |
| 8 | 8 |
| 9 // The result of a Resolve operation via ShellResolver. |
| 10 struct ResolveResult { |
| 11 // The mojo: name that was requested to be resolved. |
| 12 string name; |
| 13 |
| 14 // The mojo: name of the physical package supplying the requested name. This |
| 15 // could be the same name that was passed, or the name of a package that |
| 16 // contains it. |
| 17 string resolved_name; |
| 18 |
| 19 // An additional piece of metadata that identifies what instance |name| should |
| 20 // be run in. It's possible that |name| may provide several services that |
| 21 // should be run as different instances. |
| 22 string qualifier; |
| 23 |
| 24 // The set of capabilities provided and required by |name|. |
| 25 CapabilitySpec capabilities; |
| 26 |
| 27 // A file URL to the package specified by |name|. |
| 28 // TODO(beng): What if resolved_mojo_name needs to be re-resolved? |
| 29 string package_url; |
| 30 }; |
| 31 |
| 9 // Implemented exclusively for the Mojo Shell's use in resolving mojo: names | 32 // Implemented exclusively for the Mojo Shell's use in resolving mojo: names |
| 10 // and reading static manifest information. | 33 // and reading static manifest information. |
| 11 interface ShellResolver { | 34 interface ShellResolver { |
| 12 // Resolves |mojo_name| to the following metadata: | 35 // Resolves |mojo_name| and returns a ResolveResult containing metadata from |
| 13 // | 36 // the catalog that the Shell uses to run an instance of it. |
| 14 // resolved_mojo_name | 37 ResolveMojoName(string mojo_name) => (ResolveResult result); |
| 15 // another mojo: name of an application implementing mojo::ShellClientFactory | |
| 16 // that can handle connections to |mojo_name|. | |
| 17 // | |
| 18 // qualifier | |
| 19 // an additional piece of metadata that identifies what instance | |
| 20 // |resolved_mojo_name| should be run in. It's possible that | |
| 21 // |resolved_mojo_name| may provide several services that should be run as | |
| 22 // different instances. | |
| 23 // | |
| 24 // mojo_file_url | |
| 25 // a file URL to the application specified in |resolved_mojo_name| | |
| 26 // TODO(beng): what if |resolved_mojo_name| needs to be re-resolved?? | |
| 27 // | |
| 28 // filter | |
| 29 // the base CapabilityFilter within which an instance of |resolved_mojo_name| | |
| 30 // must be run for |mojo_name|. | |
| 31 // | |
| 32 // If |mojo_name| can't be resolved (i.e. not a mojo: or exe: scheme), then | |
| 33 // the callback will be run with null |mojo_file_url|, and |filter|. | |
| 34 ResolveMojoName(string mojo_name) => | |
| 35 (string resolved_mojo_name, | |
| 36 string qualifier, | |
| 37 CapabilitySpec? capability_spec, | |
| 38 string? mojo_file_url); | |
| 39 }; | 38 }; |
| OLD | NEW |