OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2008 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 SANDBOX_SRC_POLICY_PARAMS_H__ | |
6 #define SANDBOX_SRC_POLICY_PARAMS_H__ | |
7 | |
8 #include "sandbox/src/policy_engine_params.h" | |
9 | |
10 namespace sandbox { | |
11 | |
12 class ParameterSet; | |
13 | |
14 // Warning: The following macros store the address to the actual variables, in | |
15 // other words, the values are not copied. | |
16 #define POLPARAMS_BEGIN(type) class type { public: enum Args { | |
17 #define POLPARAM(arg) arg, | |
18 #define POLPARAMS_END(type) PolParamLast }; }; \ | |
19 typedef sandbox::ParameterSet type##Array [type::PolParamLast]; | |
20 | |
21 // Policy parameters for file open / create. | |
22 POLPARAMS_BEGIN(OpenFile) | |
23 POLPARAM(NAME) | |
24 POLPARAM(BROKER) // TRUE if called from the broker. | |
25 POLPARAM(ACCESS) | |
26 POLPARAM(OPTIONS) | |
27 POLPARAMS_END(OpenFile) | |
28 | |
29 // Policy parameter for name-based policies. | |
30 POLPARAMS_BEGIN(FileName) | |
31 POLPARAM(NAME) | |
32 POLPARAM(BROKER) // TRUE if called from the broker. | |
33 POLPARAMS_END(FileName) | |
34 | |
35 COMPILE_ASSERT(OpenFile::NAME == FileName::NAME, to_simplify_fs_policies); | |
36 COMPILE_ASSERT(OpenFile::BROKER == FileName::BROKER, to_simplify_fs_policies); | |
37 | |
38 // Policy parameter for name-based policies. | |
39 POLPARAMS_BEGIN(NameBased) | |
40 POLPARAM(NAME) | |
41 POLPARAMS_END(NameBased) | |
42 | |
43 // Policy parameters for open event. | |
44 POLPARAMS_BEGIN(OpenEventParams) | |
45 POLPARAM(NAME) | |
46 POLPARAM(ACCESS) | |
47 POLPARAMS_END(OpenEventParams) | |
48 | |
49 // Policy Parameters for reg open / create. | |
50 POLPARAMS_BEGIN(OpenKey) | |
51 POLPARAM(NAME) | |
52 POLPARAM(ACCESS) | |
53 POLPARAMS_END(OpenKey) | |
54 | |
55 // Policy parameter for name-based policies. | |
56 POLPARAMS_BEGIN(HandleTarget) | |
57 POLPARAM(NAME) | |
58 POLPARAM(TARGET) | |
59 POLPARAMS_END(HandleTarget) | |
60 | |
61 | |
62 } // namespace sandbox | |
63 | |
64 #endif // SANDBOX_SRC_POLICY_PARAMS_H__ | |
OLD | NEW |