Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: mojo/shell/public/cpp/capabilities.h

Issue 1776813002: CapabilitySpec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@42cpi
Patch Set: . Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/shell/public/cpp/BUILD.gn ('k') | mojo/shell/public/cpp/lib/capabilities.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SHELL_PUBLIC_CPP_CAPABILITIES_H_
6 #define MOJO_SHELL_PUBLIC_CPP_CAPABILITIES_H_
7
8 #include <map>
9 #include <set>
10 #include <string>
11
12 #include "mojo/shell/public/interfaces/shell_resolver.mojom.h"
13
14 namespace mojo {
15 namespace caps {
16 using Class = std::string;
17 using Classes = std::set<std::string>;
18 using Interface = std::string;
19 using Interfaces = std::set<std::string>;
20 using Name = std::string;
21
22 struct CapabilitySpec {
23 Classes classes;
24 Interfaces interfaces;
25 };
26
27 struct Capabilities {
28 std::map<Class, Interfaces> provided;
29 std::map<Name, CapabilitySpec> required;
30 };
31
32 } // namespace caps
33
34 template <>
35 struct TypeConverter<shell::mojom::CapabilitiesPtr, caps::Capabilities> {
36 static shell::mojom::CapabilitiesPtr Convert(const caps::Capabilities& input);
37 };
38 template <>
39 struct TypeConverter<caps::Capabilities, shell::mojom::CapabilitiesPtr> {
40 static caps::Capabilities Convert(const shell::mojom::CapabilitiesPtr& input);
41 };
42
43 template <>
44 struct TypeConverter<shell::mojom::CapabilitySpecPtr, caps::CapabilitySpec> {
45 static shell::mojom::CapabilitySpecPtr Convert(
46 const caps::CapabilitySpec& input);
47 };
48 template <>
49 struct TypeConverter<caps::CapabilitySpec, shell::mojom::CapabilitySpecPtr> {
50 static caps::CapabilitySpec Convert(
51 const shell::mojom::CapabilitySpecPtr& input);
52 };
53 } // namespace mojo
54
55 #endif // MOJO_SHELL_PUBLIC_CPP_CAPABILITIES_H_
OLDNEW
« no previous file with comments | « mojo/shell/public/cpp/BUILD.gn ('k') | mojo/shell/public/cpp/lib/capabilities.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698