Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / mojo / shell / capability_filter.h
blob2d0ef85442276e130bccc7fec9f756f1becbe364
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
3 // found in the LICENSE file.
5 #ifndef MOJO_SHELL_CAPABILITY_FILTER_H_
6 #define MOJO_SHELL_CAPABILITY_FILTER_H_
8 #include <map>
9 #include <set>
11 #include "mojo/public/cpp/bindings/array.h"
13 namespace mojo {
14 namespace shell {
16 struct Identity;
18 // A set of names of interfaces that may be exposed to an application.
19 using AllowedInterfaces = std::set<std::string>;
20 // A map of allowed applications to allowed interface sets. See shell.mojom for
21 // more details.
22 using CapabilityFilter = std::map<std::string, AllowedInterfaces>;
24 // Returns a capability filter that allows an application to connect to any
25 // other application and any service exposed by other applications.
26 CapabilityFilter GetPermissiveCapabilityFilter();
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);
33 } // namespace shell
34 } // namespace mojo
37 #endif // MOJO_SHELL_CAPABILITY_FILTER_H_