| 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 struct Identity; |
| 17 |
| 16 // 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. |
| 17 using AllowedInterfaces = std::set<std::string>; | 19 using AllowedInterfaces = std::set<std::string>; |
| 18 // 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 |
| 19 // more details. | 21 // more details. |
| 20 using CapabilityFilter = std::map<std::string, AllowedInterfaces>; | 22 using CapabilityFilter = std::map<std::string, AllowedInterfaces>; |
| 21 | 23 |
| 22 // 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 |
| 23 // other application and any service exposed by other applications. | 25 // other application and any service exposed by other applications. |
| 24 CapabilityFilter GetPermissiveCapabilityFilter(); | 26 CapabilityFilter GetPermissiveCapabilityFilter(); |
| 25 | 27 |
| 28 // Returns the set of interfaces that an application instance with |filter| is |
| 29 // allowed to see from an instance with |identity|. |
| 30 AllowedInterfaces GetAllowedInterfaces(const CapabilityFilter& filter, |
| 31 const Identity& identity); |
| 32 |
| 26 } // namespace shell | 33 } // namespace shell |
| 27 } // namespace mojo | 34 } // namespace mojo |
| 28 | 35 |
| 29 | 36 |
| 30 #endif // MOJO_SHELL_CAPABILITY_FILTER_H_ | 37 #endif // MOJO_SHELL_CAPABILITY_FILTER_H_ |
| OLD | NEW |