OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef MOJO_SHELL_CAPABILITY_FILTER_H_ | 5 #ifndef MOJO_SHELL_CAPABILITY_FILTER_H_ |
6 #define MOJO_SHELL_CAPABILITY_FILTER_H_ | 6 #define MOJO_SHELL_CAPABILITY_FILTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "mojo/public/cpp/bindings/array.h" | 11 #include "mojo/public/cpp/bindings/array.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 namespace shell { | 14 namespace shell { |
15 | 15 |
16 class Identity; | 16 struct Identity; |
17 | 17 |
18 // A set of names of interfaces that may be exposed to an application. | 18 // A set of names of interfaces that may be exposed to an application. |
19 using AllowedInterfaces = std::set<std::string>; | 19 using AllowedInterfaces = std::set<std::string>; |
20 // A map of allowed applications to allowed interface sets. See shell.mojom for | 20 // A map of allowed applications to allowed interface sets. See shell.mojom for |
21 // more details. | 21 // more details. |
22 using CapabilityFilter = std::map<std::string, AllowedInterfaces>; | 22 using CapabilityFilter = std::map<std::string, AllowedInterfaces>; |
23 | 23 |
24 // Returns a capability filter that allows an application to connect to any | 24 // Returns a capability filter that allows an application to connect to any |
25 // other application and any service exposed by other applications. | 25 // other application and any service exposed by other applications. |
26 CapabilityFilter GetPermissiveCapabilityFilter(); | 26 CapabilityFilter GetPermissiveCapabilityFilter(); |
27 | 27 |
28 // Returns the set of interfaces that an application instance with |filter| is | 28 // Returns the set of interfaces that an application instance with |filter| is |
29 // allowed to see from an instance with |identity|. | 29 // allowed to see from an instance with |identity|. |
30 AllowedInterfaces GetAllowedInterfaces(const CapabilityFilter& filter, | 30 AllowedInterfaces GetAllowedInterfaces(const CapabilityFilter& filter, |
31 const Identity& identity); | 31 const Identity& identity); |
32 | 32 |
33 } // namespace shell | 33 } // namespace shell |
34 } // namespace mojo | 34 } // namespace mojo |
35 | 35 |
36 | 36 |
37 #endif // MOJO_SHELL_CAPABILITY_FILTER_H_ | 37 #endif // MOJO_SHELL_CAPABILITY_FILTER_H_ |
OLD | NEW |