OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 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 SANDBOX_SRC_POLICY_LOW_LEVEL_H__ | 5 #ifndef SANDBOX_SRC_POLICY_LOW_LEVEL_H__ |
6 #define SANDBOX_SRC_POLICY_LOW_LEVEL_H__ | 6 #define SANDBOX_SRC_POLICY_LOW_LEVEL_H__ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 PolicyBuffer data[1]; | 75 PolicyBuffer data[1]; |
76 }; | 76 }; |
77 | 77 |
78 class PolicyRule; | 78 class PolicyRule; |
79 | 79 |
80 // Provides the means to collect rules into a policy store (memory) | 80 // Provides the means to collect rules into a policy store (memory) |
81 class LowLevelPolicy { | 81 class LowLevelPolicy { |
82 public: | 82 public: |
83 // policy_store: must contain allocated memory and the internal | 83 // policy_store: must contain allocated memory and the internal |
84 // size fields set to correct values. | 84 // size fields set to correct values. |
85 explicit LowLevelPolicy(PolicyGlobal* policy_store) | 85 explicit LowLevelPolicy(PolicyGlobal* policy_store); |
86 : policy_store_(policy_store) { | |
87 } | |
88 | 86 |
89 // Destroys all the policy rules. | 87 // Destroys all the policy rules. |
90 ~LowLevelPolicy(); | 88 ~LowLevelPolicy(); |
91 | 89 |
92 // Adds a rule to be generated when Done() is called. | 90 // Adds a rule to be generated when Done() is called. |
93 // service: The id of the service that this rule is associated with, | 91 // service: The id of the service that this rule is associated with, |
94 // for example the 'Open Thread' service or the "Create File" service. | 92 // for example the 'Open Thread' service or the "Create File" service. |
95 // returns false on error. | 93 // returns false on error. |
96 bool AddRule(int service, PolicyRule* rule); | 94 bool AddRule(int service, PolicyRule* rule); |
97 | 95 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 char* data_start, size_t* data_size) const; | 175 char* data_start, size_t* data_size) const; |
178 PolicyBuffer* buffer_; | 176 PolicyBuffer* buffer_; |
179 OpcodeFactory* opcode_factory_; | 177 OpcodeFactory* opcode_factory_; |
180 EvalResult action_; | 178 EvalResult action_; |
181 bool done_; | 179 bool done_; |
182 }; | 180 }; |
183 | 181 |
184 } // namespace sandbox | 182 } // namespace sandbox |
185 | 183 |
186 #endif // SANDBOX_SRC_POLICY_LOW_LEVEL_H__ | 184 #endif // SANDBOX_SRC_POLICY_LOW_LEVEL_H__ |
OLD | NEW |