Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: components/policy/core/common/schema.h

Issue 143413002: Add additional restriction to policy schema internal (part2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@expand-policy-schema
Patch Set: fix comments Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/policy/core/common/schema.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | components/policy/core/common/schema.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698