| Index: mojo/shell/public/cpp/capabilities.h
|
| diff --git a/mojo/shell/public/cpp/capabilities.h b/mojo/shell/public/cpp/capabilities.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b3aeb117ac5d400e1905d07b6b29a3242fbfec83
|
| --- /dev/null
|
| +++ b/mojo/shell/public/cpp/capabilities.h
|
| @@ -0,0 +1,55 @@
|
| +// 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.
|
| +
|
| +#ifndef MOJO_SHELL_PUBLIC_CPP_CAPABILITIES_H_
|
| +#define MOJO_SHELL_PUBLIC_CPP_CAPABILITIES_H_
|
| +
|
| +#include <map>
|
| +#include <set>
|
| +#include <string>
|
| +
|
| +#include "mojo/shell/public/interfaces/shell_resolver.mojom.h"
|
| +
|
| +namespace mojo {
|
| +namespace caps {
|
| +using Class = std::string;
|
| +using Classes = std::set<std::string>;
|
| +using Interface = std::string;
|
| +using Interfaces = std::set<std::string>;
|
| +using Name = std::string;
|
| +
|
| +struct CapabilitySpec {
|
| + Classes classes;
|
| + Interfaces interfaces;
|
| +};
|
| +
|
| +struct Capabilities {
|
| + std::map<Class, Interfaces> provided;
|
| + std::map<Name, CapabilitySpec> required;
|
| +};
|
| +
|
| +} // namespace caps
|
| +
|
| +template <>
|
| +struct TypeConverter<shell::mojom::CapabilitiesPtr, caps::Capabilities> {
|
| + static shell::mojom::CapabilitiesPtr Convert(const caps::Capabilities& input);
|
| +};
|
| +template <>
|
| +struct TypeConverter<caps::Capabilities, shell::mojom::CapabilitiesPtr> {
|
| + static caps::Capabilities Convert(const shell::mojom::CapabilitiesPtr& input);
|
| +};
|
| +
|
| +template <>
|
| +struct TypeConverter<shell::mojom::CapabilitySpecPtr, caps::CapabilitySpec> {
|
| + static shell::mojom::CapabilitySpecPtr Convert(
|
| + const caps::CapabilitySpec& input);
|
| +};
|
| +template <>
|
| +struct TypeConverter<caps::CapabilitySpec, shell::mojom::CapabilitySpecPtr> {
|
| + static caps::CapabilitySpec Convert(
|
| + const shell::mojom::CapabilitySpecPtr& input);
|
| +};
|
| +} // namespace mojo
|
| +
|
| +#endif // MOJO_SHELL_PUBLIC_CPP_CAPABILITIES_H_
|
|
|