OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_POLICY_CORE_COMMON_SCHEMA_INTERNAL_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_SCHEMA_INTERNAL_H_ |
6 #define COMPONENTS_POLICY_CORE_COMMON_SCHEMA_INTERNAL_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_SCHEMA_INTERNAL_H_ |
7 | 7 |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "components/policy/policy_export.h" | 9 #include "components/policy/policy_export.h" |
10 | 10 |
11 namespace policy { | 11 namespace policy { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 // These types are used internally by the SchemaOwner parser, and by the | 14 // These types are used internally by the SchemaOwner parser, and by the |
15 // compile-time code generator. They shouldn't be used directly. | 15 // compile-time code generator. They shouldn't be used directly. |
16 | 16 |
17 struct POLICY_EXPORT SchemaNode { | 17 struct POLICY_EXPORT SchemaNode { |
18 base::Value::Type type; | 18 base::Value::Type type; |
19 | 19 int extra; |
20 // If |type| is TYPE_LIST then this is a SchemaNode* describing the | |
21 // element type. | |
22 // | |
23 // If |type| is TYPE_DICTIONARY then this is a PropertiesNode* that can | |
24 // contain any number of named properties and optionally a SchemaNode* for | |
25 // additional properties. | |
26 // | |
27 // This is NULL if |type| has any other values. | |
28 const void* extra; | |
29 }; | 20 }; |
30 | 21 |
31 struct POLICY_EXPORT PropertyNode { | 22 struct POLICY_EXPORT PropertyNode { |
32 const char* key; | 23 const char* key; |
33 const SchemaNode* schema; | 24 int schema; |
34 }; | 25 }; |
35 | 26 |
36 struct POLICY_EXPORT PropertiesNode { | 27 struct POLICY_EXPORT PropertiesNode { |
37 const PropertyNode* begin; | 28 int begin; |
38 const PropertyNode* end; | 29 int end; |
39 const SchemaNode* additional; | 30 int additional; |
| 31 }; |
| 32 |
| 33 struct POLICY_EXPORT SchemaData { |
| 34 const SchemaNode* schema_nodes; |
| 35 const PropertyNode* property_nodes; |
| 36 const PropertiesNode* properties_nodes; |
40 }; | 37 }; |
41 | 38 |
42 } // namespace internal | 39 } // namespace internal |
43 } // namespace policy | 40 } // namespace policy |
44 | 41 |
45 #endif // COMPONENTS_POLICY_CORE_COMMON_SCHEMA_INTERNAL_H_ | 42 #endif // COMPONENTS_POLICY_CORE_COMMON_SCHEMA_INTERNAL_H_ |
OLD | NEW |