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_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_ |
6 #define COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // This method should be called only if type() == TYPE_LIST, | 111 // This method should be called only if type() == TYPE_LIST, |
112 // otherwise invalid memory will be read. A CHECK is currently enforcing this. | 112 // otherwise invalid memory will be read. A CHECK is currently enforcing this. |
113 Schema GetItems() const; | 113 Schema GetItems() const; |
114 | 114 |
115 private: | 115 private: |
116 // Builds a schema pointing to the inner structure of |storage|, | 116 // Builds a schema pointing to the inner structure of |storage|, |
117 // rooted at |node|. | 117 // rooted at |node|. |
118 Schema(const scoped_refptr<const InternalStorage>& storage, | 118 Schema(const scoped_refptr<const InternalStorage>& storage, |
119 const internal::SchemaNode* node); | 119 const internal::SchemaNode* node); |
120 | 120 |
| 121 bool ValidateIntegerRestriction(int index, int value) const; |
| 122 bool ValidateStringRestriction(int index, const char *str) const; |
| 123 |
121 scoped_refptr<const InternalStorage> storage_; | 124 scoped_refptr<const InternalStorage> storage_; |
122 const internal::SchemaNode* node_; | 125 const internal::SchemaNode* node_; |
123 }; | 126 }; |
124 | 127 |
125 } // namespace policy | 128 } // namespace policy |
126 | 129 |
127 #endif // COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_ | 130 #endif // COMPONENTS_POLICY_CORE_COMMON_SCHEMA_H_ |
OLD | NEW |